From 9cf60497a3131f31be952c9d75e41737be9f7e23 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sat, 27 Jan 2024 10:41:28 -0600 Subject: [PATCH 001/113] feat: enable dependabot.yml (#616) ### Briefly, what does this PR introduce? Enable dependabot for github-actions upgrades. --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..0d08e261a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 2fcf79bd102949c98847b73c54fd2b0743fc7fb5 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sat, 27 Jan 2024 22:52:25 -0600 Subject: [PATCH 002/113] fix(ci): update various github actions for nodejs v20 (#617) ### Briefly, what does this PR introduce? This updates all github actions which started to emit warnings recently due to being based on nodejs v16. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- .github/workflows/linux-eic-shell.yml | 173 ++++++++++++++++---------- 1 file changed, 105 insertions(+), 68 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 7cc0f6372..aac898e02 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -18,7 +18,7 @@ jobs: xmllint-before-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: | sudo apt-get update sudo apt-get install -y libxml2-utils @@ -30,7 +30,7 @@ jobs: configs_csv: ${{ steps.list-detector-configs.outputs.configs_csv }} configs_json: ${{ steps.list-detector-configs.outputs.configs_json }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - id: list-detector-configs run: | CONFIGS_CSV=$( @@ -57,13 +57,13 @@ jobs: env: PREFIX: ${{ github.workspace }}/install steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare ccache timestamp id: ccache_cache_timestamp run: | echo "timestamp=$(date --iso-8601=minutes)" >> $GITHUB_OUTPUT - name: Retrieve ccache cache files - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .ccache key: ccache-${{ matrix.CC }}-${{ github.ref_name }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }} @@ -77,7 +77,7 @@ jobs: echo "cache_dir=${{ github.workspace }}/.ccache" >> ~/.ccache/ccache.conf echo "max_size=500MB" >> ~/.ccache/ccache.conf echo "compression=true" >> ~/.ccache/ccache.conf - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - name: Setup CVMFS OSG eic-shell environment uses: eic/run-cvmfs-osg-eic-shell@main with: @@ -91,7 +91,7 @@ jobs: run: | CC=${{ matrix.CC }} CXX=${{ matrix.CXX }} cmake -B build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache cmake --build build -- -k -j 2 install - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: build-${{ matrix.CC }}-full-eic-shell path: install/ @@ -103,7 +103,7 @@ jobs: ${DETECTOR_PATH}/compact/ecal/forward_scfi.xml \ ${DETECTOR_PATH}/compact/far_forward/ZDC_Ecal_WSciFi.xml \ ${DETECTOR_PATH}/compact/pid/mrich.xml - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: build-${{ matrix.CC }}-fast-eic-shell path: install/ @@ -113,7 +113,7 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ @@ -151,12 +151,12 @@ jobs: - build - list-detector-configs steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-fast-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -174,12 +174,12 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-fast-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -195,12 +195,12 @@ jobs: - build - list-detector-configs steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -213,7 +213,7 @@ jobs: geoConverter -compact2gdml -input ${DETECTOR_PATH}/${config}.xml -output ${config}.gdml ; echo "::endgroup::" ; done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: gdml path: "*.gdml" @@ -225,12 +225,12 @@ jobs: - build - list-detector-configs steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -243,7 +243,7 @@ jobs: geoConverter -compact2tgeo -input ${DETECTOR_PATH}/${config}.xml -output ${config}.root echo "::endgroup::" ; done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: tgeo path: "*.root" @@ -256,12 +256,12 @@ jobs: matrix: detector_config: [epic_craterlake] steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -270,9 +270,9 @@ jobs: run: | mkdir -p doc npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | tee doc/${{matrix.detector_config}}_constants.out - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: constants + name: ${{matrix.detector_config}}_constants.out path: doc/${{matrix.detector_config}}_constants.out if-no-files-found: error @@ -283,12 +283,12 @@ jobs: matrix: detector_config: [epic_craterlake] steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -306,19 +306,42 @@ jobs: ".output doc/${{matrix.detector_config}}.html" \ "select * from detector_parameter_table;" sed -i '1s/^/<html><body><table border="1" style="border-collapse:collapse">\n/;$a</table></body></html>' doc/${{matrix.detector_config}}.html - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: constants + name: ${{matrix.detector_config}}_constants.toml path: doc/${{matrix.detector_config}}_constants.toml if-no-files-found: error - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: DetectorParameterTable + name: ${{matrix.detector_config}}_DetectorParameterTable path: | doc/${{matrix.detector_config}}.csv doc/${{matrix.detector_config}}.html if-no-files-found: error + merge-constants: + runs-on: ubuntu-latest + needs: + - dump-constants + - dump-parameter-table + steps: + - uses: actions/upload-artifact/merge@v4 + with: + name: constants + pattern: '*_constants.*' + delete-merged: true + + merge-parameter-table: + runs-on: ubuntu-latest + needs: + - dump-parameter-table + steps: + - uses: actions/upload-artifact/merge@v4 + with: + name: DetectorParameterTable + pattern: '*_DetectorParameterTable' + delete-merged: true + check-overlap-tgeo: runs-on: ubuntu-latest needs: build @@ -328,12 +351,12 @@ jobs: detector_config: [epic_craterlake] # FIXME fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -350,12 +373,12 @@ jobs: needs: build if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -364,7 +387,7 @@ jobs: mkdir -p doc checkGeometry -f true -c ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml | tee geometry_check_full.out mv statistics.root geometry_check_full.root - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: check-geometry-full path: | @@ -381,12 +404,12 @@ jobs: detector_config: [epic_craterlake] fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-full-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -406,12 +429,12 @@ jobs: detector_config: [epic_inner_detector, epic_craterlake] fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-fast-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -464,12 +487,12 @@ jobs: detector_config: [epic_craterlake] fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: build-gcc-fast-eic-shell path: install/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -477,7 +500,7 @@ jobs: setup: install/setup.sh run: | bin/generate_prim_file -c $DETECTOR_PATH/${{ matrix.detector_config }}.xml -o prim -D -t ${{ matrix.detector_config }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.detector_config }}.prim path: prim/${{ matrix.detector_config }}.prim @@ -493,12 +516,12 @@ jobs: detector_config: [epic_craterlake] fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: ${{ matrix.detector_config }}.prim path: prim/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -506,9 +529,9 @@ jobs: run: | mkdir -p images bin/make_dawn_views -i prim/${{ matrix.detector_config }}.prim -t ${{ matrix.view }} -d scripts/${{ matrix.view }} -D - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.detector_config }}_views + name: ${{ matrix.detector_config }}_views_${{ matrix.view }} path: images/ if-no-files-found: error @@ -523,12 +546,12 @@ jobs: detector_config: [epic_craterlake] fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: ${{ matrix.detector_config }}.prim path: prim/ - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" @@ -536,30 +559,44 @@ jobs: run: | mkdir -p images bin/make_dawn_views -i prim/${{ matrix.detector_config }}.prim -t ${{ matrix.view }} -d scripts/${{ matrix.view }} -D -- ${{ matrix.slice }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.detector_config }}_views + name: ${{ matrix.detector_config }}_views_${{ matrix.view }}_${{ matrix.slice }} path: images/ if-no-files-found: error #TODO view20 - build-artifacts-page: + merge-dawn-view: runs-on: ubuntu-latest needs: - dawn-view - dawn-view-slices + strategy: + matrix: + detector_config: [epic_craterlake] + steps: + - uses: actions/upload-artifact/merge@v4 + with: + name: ${{ matrix.detector_config }}_views + pattern: ${{ matrix.detector_config }}_views_* + delete-merged: true + + build-artifacts-page: + runs-on: ubuntu-latest + needs: - convert-to-gdml - convert-to-tgeo - - dump-constants - - dump-parameter-table + - merge-constants + - merge-parameter-table + - merge-dawn-view steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: path: artifacts/ - uses: actions/jekyll-build-pages@v1 - - uses: actions/upload-pages-artifact@v1 + - uses: actions/upload-pages-artifact@v3 with: retention-days: 7 @@ -577,4 +614,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 From b25299f332915f8e8eee94ccf3152747893f9bd2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 28 Jan 2024 09:10:36 -0500 Subject: [PATCH 003/113] labeler.yml: fix config for v5 (#618) Fixes a regression from #616 --- .github/labeler.yml | 127 +++++++++++++++++++++++++++----------------- 1 file changed, 77 insertions(+), 50 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index b72e65db6..07b36d704 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,73 +1,100 @@ "topic: backward": - - "compact/**/backward_*" - - "compact/**/mrich*" - - "compact/**/pfrich*" +- changed-files: + - any-glob-to-any-file: + - "compact/**/backward_*" + - "compact/**/mrich*" + - "compact/**/pfrich*" "topic: barrel": - - "compact/**/barrel_*" - - "compact/**/*_barrel.xml" - - "compact/**/dirc*" - - "compact/hcal_gdml.xml" - - "src/Barrel*" - - "src/SciGlassCalorimeter_geo.cpp" +- changed-files: + - any-glob-to-any-file: + - "compact/**/barrel_*" + - "compact/**/*_barrel.xml" + - "compact/**/dirc*" + - "compact/hcal_gdml.xml" + - "src/Barrel*" + - "src/SciGlassCalorimeter_geo.cpp" "topic: calorimetry": - - "compact/ecal/**/*" - - "compact/hcal/**/*" - - "compact/hcal_gdml.xml" - - "src/*Calorimeter*" +- changed-files: + - any-glob-to-any-file: + - "compact/ecal/**/*" + - "compact/hcal/**/*" + - "compact/hcal_gdml.xml" + - "src/*Calorimeter*" "topic: documentation": - - "**/*.md" +- changed-files: + - any-glob-to-any-file: + - "**/*.md" "topic: far-backward": - - "compact/far_backward/**" - - "src/Backwards*" +- changed-files: + - any-glob-to-any-file: + - "compact/far_backward/**" + - "src/Backwards*" "topic: far-forward": - - "compact/far_forward/**" - - "src/Forward*" - - "src/B0*" - - "src/ZDC*" - - "src/ZeroDegreeCalorimeter*" +- changed-files: + - any-glob-to-any-file: + - "compact/far_forward/**" + - "src/Forward*" + - "src/B0*" + - "src/ZDC*" + - "src/ZeroDegreeCalorimeter*" "topic: forward": - - "compact/**/forward_*" - - "compact/**/drich*" - - "src/*Tracker*" +- changed-files: + - any-glob-to-any-file: + - "compact/**/forward_*" + - "compact/**/drich*" + - "src/*Tracker*" "topic: infrastructure": - - ".*" - - ".github/**/*" - - "CMakeLists.txt" - - "bin/**/*" - - "doc/**/*" - - "macro/**/*" - - "reports/**/*" - - "requirements.txt" - - "scripts/**/*" - - "templates/setup.sh.in" - - "views/**/*" +- changed-files: + - any-glob-to-any-file: + - ".*" + - ".github/**/*" + - "CMakeLists.txt" + - "bin/**/*" + - "doc/**/*" + - "macro/**/*" + - "reports/**/*" + - "requirements.txt" + - "scripts/**/*" + - "templates/setup.sh.in" + - "views/**/*" "topic: magnets": - - "compact/far_backward/magnets.xml" - - "compact/far_forward/magnets.xml" - - "compact/fields/**/*" - - "compact/fields.xml" - - "compact/solenoid.xml" +- changed-files: + - any-glob-to-any-file: + - "compact/far_backward/magnets.xml" + - "compact/far_forward/magnets.xml" + - "compact/fields/**/*" + - "compact/fields.xml" + - "compact/solenoid.xml" "topic: materials": - - "compact/materials.xml" - - "compact/optical_materials.xml" +- changed-files: + - any-glob-to-any-file: + - "compact/materials.xml" + - "compact/optical_materials.xml" "topic: PID": - - "compact/pid/**/*" - - "compact/tracking/**/tof_*" - - "src/*RICH*" - - "src/*DIRC*" - - "src/*TOF*" - - "src/MRich*" +- changed-files: + - any-glob-to-any-file: + - "compact/pid/**/*" + - "compact/tracking/**/tof_*" + - "src/*RICH*" + - "src/*DIRC*" + - "src/*TOF*" + - "src/MRich*" "topic: tracking": - - any: ["compact/tracking/**/*", "!compact/tracking/**/tof_*"] - - "src/*Tracker*" +- all: + - changed-files: + - any-glob-to-any-file: + - "compact/tracking/**/*" + - "src/*Tracker*" + - all-globs-to-all-files: + - "!compact/tracking/**/tof_*" From 596a4591aa5c4ac930dd8587ed00d1301220ca9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:47:41 -0600 Subject: [PATCH 004/113] build(deps): bump korthout/backport-action from 1 to 2 (#620) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 1 to 2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/korthout/backport-action/releases">korthout/backport-action's releases</a>.</em></p> <blockquote> <h2>Backport-action v2.0.0</h2> <h2>What's Changed</h2> <p><strong>Breaking change</strong>: Support for node16 has been dropped with this release. If you're using self-hosted runners, please ensure that node20 is available. We also recommend using <code>actions/checkout@v4</code> alongside <code>korthout/backport-action@v2</code>.</p> <ul> <li>Update from node16 to node20 by <a href="https://github.com/korthout"><code>@korthout</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/392">korthout/backport-action#392</a></li> </ul> <h2>Updated Dependencies</h2> <ul> <li>build(deps): bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/382">korthout/backport-action#382</a></li> <li>build(deps): bump <code>@actions/core</code> from 1.10.0 to 1.10.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/385">korthout/backport-action#385</a></li> <li>build(deps): bump <code>@types/dedent</code> from 0.7.0 to 0.7.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/388">korthout/backport-action#388</a></li> <li>build(deps): bump <code>@actions/github</code> from 5.1.1 to 6.0.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/387">korthout/backport-action#387</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/korthout/backport-action/compare/v1.4.0...v2.0.0">https://github.com/korthout/backport-action/compare/v1.4.0...v2.0.0</a></p> <h2>Backport-action v1.4.0</h2> <h2>What's Changed</h2> <ul> <li>Use <a href="https://github.com/korthout/backport-action#merge_commits"><code>merge_commits</code></a> input to skip merge commits by <a href="https://github.com/korthout"><code>@korthout</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/375">korthout/backport-action#375</a> <a href="https://redirect.github.com/korthout/backport-action/pull/376">korthout/backport-action#376</a> <a href="https://redirect.github.com/korthout/backport-action/pull/377">korthout/backport-action#377</a></li> </ul> <h2>Other</h2> <ul> <li>Update dependencies to latest available</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/korthout/backport-action/compare/v1.3.0...v1.4.0">https://github.com/korthout/backport-action/compare/v1.3.0...v1.4.0</a></p> <h2>Backport-action v1.3.1</h2> <h2>What's Changed</h2> <ul> <li>[Backport release-v1.3] Exclude headref from selected branches by <a href="https://github.com/github-actions"><code>@github-actions</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/345">korthout/backport-action#345</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/korthout/backport-action/compare/v1.3.0...v1.3.1">https://github.com/korthout/backport-action/compare/v1.3.0...v1.3.1</a></p> <h2>Backport-action v1.3.0</h2> <h2>What's Changed</h2> <ul> <li>Use <code>target_branches</code> input to select target branches by <a href="https://github.com/korthout"><code>@korthout</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/340">korthout/backport-action#340</a></li> </ul> <h2>Other</h2> <ul> <li>Improve documentation by <a href="https://github.com/korthout"><code>@korthout</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/331">korthout/backport-action#331</a></li> <li>Update dependencies to latest available</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/korthout/backport-action/compare/v1.2.0...v1.3.0">https://github.com/korthout/backport-action/compare/v1.2.0...v1.3.0</a></p> <h2>Backport-action v1.2.0</h2> <h2>What's Changed</h2> <ul> <li>Copy labels as specified by <code>copy_labels_pattern</code> by <a href="https://github.com/lheckemann"><code>@lheckemann</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/327">korthout/backport-action#327</a></li> </ul> <h2>Other</h2> <ul> <li>Update dependencies to latest available</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/korthout/backport-action/commit/e8161d6a0dbfa2651b7daa76cbb75bc7c925bbf3"><code>e8161d6</code></a> dist: release 2.4.1</li> <li><a href="https://github.com/korthout/backport-action/commit/2740887b8d9fb88f6b5760681af4ec8e6037083c"><code>2740887</code></a> dist: build new version</li> <li><a href="https://github.com/korthout/backport-action/commit/ec07f3ebed7bed80b0bca599f62d80696da9d9a0"><code>ec07f3e</code></a> Merge pull request <a href="https://redirect.github.com/korthout/backport-action/issues/410">#410</a> from jschmid1/fix/template-rendering</li> <li><a href="https://github.com/korthout/backport-action/commit/75b4a31e0ebd542d32b841976d44f5ea206e51c9"><code>75b4a31</code></a> fix: rendering templates due to missing brackets</li> <li><a href="https://github.com/korthout/backport-action/commit/4e7a9017281328af5f90da75811038d809578573"><code>4e7a901</code></a> dist: release 2.5.0-SNAPSHOT</li> <li><a href="https://github.com/korthout/backport-action/commit/79b9f245a4132c5bf4bca01c7526cfea24059c03"><code>79b9f24</code></a> dist: release 2.4.0</li> <li><a href="https://github.com/korthout/backport-action/commit/8546a417ed6a4c0a7296b6373bf5ba65937772bb"><code>8546a41</code></a> Merge pull request <a href="https://redirect.github.com/korthout/backport-action/issues/409">#409</a> from jschmid1/feat/pull_description_body</li> <li><a href="https://github.com/korthout/backport-action/commit/29fedd9c934e40c0070c8c8d9b8843f6d1b26329"><code>29fedd9</code></a> docs: reorder the placeholders alphanumerically</li> <li><a href="https://github.com/korthout/backport-action/commit/258a18ba7f3c1e690a9e16739faf469d021d43b9"><code>258a18b</code></a> docs: align pull_description placeholder text</li> <li><a href="https://github.com/korthout/backport-action/commit/ba84c7a0105bf08e022a22ccfc40f247c9ceaf24"><code>ba84c7a</code></a> feat: add <code>pull_description</code> to placeholders</li> <li>Additional commits viewable in <a href="https://github.com/korthout/backport-action/compare/v1...v2">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pr-backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-backport.yml b/.github/workflows/pr-backport.yml index aca2b5273..cd66df1d4 100644 --- a/.github/workflows/pr-backport.yml +++ b/.github/workflows/pr-backport.yml @@ -14,6 +14,6 @@ jobs: steps: - uses: actions/checkout@v3 - name: Create backport pull requests - uses: korthout/backport-action@v1 + uses: korthout/backport-action@v2 with: github_token: ${{ secrets.BACKPORT_ACTION_TOKEN }} From 02604bc0cc2a36f3a4f9fc93ad4178149a4d8821 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 22:31:12 -0600 Subject: [PATCH 005/113] build(deps): bump cvmfs-contrib/github-action-cvmfs from 3 to 4 (#622) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [cvmfs-contrib/github-action-cvmfs](https://github.com/cvmfs-contrib/github-action-cvmfs) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cvmfs-contrib/github-action-cvmfs/releases">cvmfs-contrib/github-action-cvmfs's releases</a>.</em></p> <blockquote> <h2>v4.0</h2> <h2>What's Changed</h2> <ul> <li>feat: add logging groups by <a href="https://github.com/wdconinc"><code>@wdconinc</code></a> in <a href="https://redirect.github.com/cvmfs-contrib/github-action-cvmfs/pull/24">cvmfs-contrib/github-action-cvmfs#24</a></li> <li>fix: update actions/cache from v3 to v4 (node.js v20 support) by <a href="https://github.com/wdconinc"><code>@wdconinc</code></a> in <a href="https://redirect.github.com/cvmfs-contrib/github-action-cvmfs/pull/25">cvmfs-contrib/github-action-cvmfs#25</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/cvmfs-contrib/github-action-cvmfs/compare/v3...v4.0">https://github.com/cvmfs-contrib/github-action-cvmfs/compare/v3...v4.0</a></p> <h2>v3.1</h2> <h2>What's Changed</h2> <ul> <li>ci(chore): replace ubuntu-18.04 with ubuntu-22.04 by <a href="https://github.com/wdconinc"><code>@wdconinc</code></a> in <a href="https://redirect.github.com/cvmfs-contrib/github-action-cvmfs/pull/23">cvmfs-contrib/github-action-cvmfs#23</a></li> <li>ci(chore): upgrade to actions/checkout@v3 by <a href="https://github.com/wdconinc"><code>@wdconinc</code></a> in <a href="https://redirect.github.com/cvmfs-contrib/github-action-cvmfs/pull/22">cvmfs-contrib/github-action-cvmfs#22</a></li> <li>fix: replace set-output with $GITHUB_OUTPUT by <a href="https://github.com/wdconinc"><code>@wdconinc</code></a> in <a href="https://redirect.github.com/cvmfs-contrib/github-action-cvmfs/pull/21">cvmfs-contrib/github-action-cvmfs#21</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/cvmfs-contrib/github-action-cvmfs/compare/v3.0...v3.1">https://github.com/cvmfs-contrib/github-action-cvmfs/compare/v3.0...v3.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cvmfs-contrib/github-action-cvmfs/commit/55899ca74cf78ab874bdf47f5a804e47c198743c"><code>55899ca</code></a> doc: update to v4 in README.md</li> <li><a href="https://github.com/cvmfs-contrib/github-action-cvmfs/commit/56285c6bf8a68cac951e2f6906b64e02832ec3c5"><code>56285c6</code></a> Merge pull request <a href="https://redirect.github.com/cvmfs-contrib/github-action-cvmfs/issues/25">#25</a> from cvmfs-contrib/actions-cache-v4</li> <li><a href="https://github.com/cvmfs-contrib/github-action-cvmfs/commit/0599f454ac918c8caf87c5479225f6dafac8eb0d"><code>0599f45</code></a> fix: update actions/cache from v3 to v4 (node.js v20 support)</li> <li><a href="https://github.com/cvmfs-contrib/github-action-cvmfs/commit/880c9e48fd852f0c10df5b04c33ea23ff92bfc09"><code>880c9e4</code></a> Merge pull request <a href="https://redirect.github.com/cvmfs-contrib/github-action-cvmfs/issues/24">#24</a> from cvmfs-contrib/wdconinc-patch-1</li> <li><a href="https://github.com/cvmfs-contrib/github-action-cvmfs/commit/93984f6d47d7a4007b053d23698f51a6c524109f"><code>93984f6</code></a> fix: typo</li> <li><a href="https://github.com/cvmfs-contrib/github-action-cvmfs/commit/86da191ea97036e5304fe04ae70111ff861c58c1"><code>86da191</code></a> feat: add logging groups</li> <li>See full diff in <a href="https://github.com/cvmfs-contrib/github-action-cvmfs/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/linux-lcg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-lcg.yml b/.github/workflows/linux-lcg.yml index 4ec4b5e2d..189907da8 100644 --- a/.github/workflows/linux-lcg.yml +++ b/.github/workflows/linux-lcg.yml @@ -22,7 +22,7 @@ jobs: LCG: ["LCG_101/x86_64-ubuntu2004-gcc9-opt"] steps: - uses: actions/checkout@v3 - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v4 with: cvmfs_repositories: 'sft.cern.ch,geant4.cern.ch' - uses: aidasoft/run-lcg-view@v1 From b88ab6e42c42e30362fcaa1479a08e11d55d704a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 22:32:25 -0600 Subject: [PATCH 006/113] build(deps): bump actions/upload-artifact from 3 to 4 (#623) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/upload-artifact/releases">actions/upload-artifact's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <h2>What's Changed</h2> <p>The release of upload-artifact@v4 and download-artifact@v4 are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.</p> <p>ℹ️ However, this is a major update that includes breaking changes. Artifacts created with versions v3 and below are not compatible with the v4 actions. Uploads and downloads <em>must</em> use the same major actions versions. There are also key differences from previous versions that may require updates to your workflows.</p> <p>For more information, please see:</p> <ol> <li>The <a href="https://github.blog/changelog/2023-12-14-github-actions-artifacts-v4-is-now-generally-available/">changelog</a> post.</li> <li>The <a href="https://github.com/actions/upload-artifact/blob/main/README.md">README</a>.</li> <li>The <a href="https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md">migration documentation</a>.</li> <li>As well as the underlying npm package, <a href="https://github.com/actions/toolkit/tree/main/packages/artifact"><code>@actions/artifact</code></a> documentation.</li> </ol> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/vmjoseph"><code>@vmjoseph</code></a> made their first contribution in <a href="https://redirect.github.com/actions/upload-artifact/pull/464">actions/upload-artifact#464</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v4.0.0">https://github.com/actions/upload-artifact/compare/v3...v4.0.0</a></p> <h2>v3.1.3</h2> <h2>What's Changed</h2> <ul> <li>chore(github): remove trailing whitespaces by <a href="https://github.com/ljmf00"><code>@ljmf00</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/313">actions/upload-artifact#313</a></li> <li>Bump <code>@actions/artifact</code> version to v1.1.2 by <a href="https://github.com/bethanyj28"><code>@bethanyj28</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/436">actions/upload-artifact#436</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v3.1.3">https://github.com/actions/upload-artifact/compare/v3...v3.1.3</a></p> <h2>v3.1.2</h2> <ul> <li>Update all <code>@actions/*</code> NPM packages to their latest versions- <a href="https://redirect.github.com/actions/upload-artifact/issues/374">#374</a></li> <li>Update all dev dependencies to their most recent versions - <a href="https://redirect.github.com/actions/upload-artifact/issues/375">#375</a></li> </ul> <h2>v3.1.1</h2> <ul> <li>Update actions/core package to latest version to remove <code>set-output</code> deprecation warning <a href="https://redirect.github.com/actions/upload-artifact/issues/351">#351</a></li> </ul> <h2>v3.1.0</h2> <h2>What's Changed</h2> <ul> <li>Bump <code>@actions/artifact</code> to v1.1.0 (<a href="https://redirect.github.com/actions/upload-artifact/pull/327">actions/upload-artifact#327</a>) <ul> <li>Adds checksum headers on artifact upload (<a href="https://redirect.github.com/actions/toolkit/pull/1095">actions/toolkit#1095</a>) (<a href="https://redirect.github.com/actions/toolkit/pull/1063">actions/toolkit#1063</a>)</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/upload-artifact/commit/26f96dfa697d77e81fd5907df203aa23a56210a8"><code>26f96df</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/505">#505</a> from actions/robherley/merge-artifacts</li> <li><a href="https://github.com/actions/upload-artifact/commit/530ed2c9b8e7b46db7acf98b7e543836a040586e"><code>530ed2c</code></a> use correct artifact name in test</li> <li><a href="https://github.com/actions/upload-artifact/commit/53ef6987b3562a24090358abb83a07f2c2bfec26"><code>53ef698</code></a> add additional integration test for merge all behavior</li> <li><a href="https://github.com/actions/upload-artifact/commit/90b0f8eed8fd7a9e62025ff26858a0f618d12b53"><code>90b0f8e</code></a> add workflow to test merging</li> <li><a href="https://github.com/actions/upload-artifact/commit/199a58f54fa418c391917374e9d11f5a5e618ae9"><code>199a58f</code></a> more docs</li> <li><a href="https://github.com/actions/upload-artifact/commit/3f353f9d9ee7e6a8313bfb227f44aa283e6832c9"><code>3f353f9</code></a> ncc</li> <li><a href="https://github.com/actions/upload-artifact/commit/997fffa3558d08f16f0c12036708e1ce7c0a7430"><code>997fffa</code></a> add merge artifact sub-action</li> <li><a href="https://github.com/actions/upload-artifact/commit/52899c8c02604e1c6c9ea56b52ead4671321bd05"><code>52899c8</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/504">#504</a> from actions/robherley/reorganize</li> <li><a href="https://github.com/actions/upload-artifact/commit/da58a3f7b2ea3d2db018d82fe856b2d4b297de35"><code>da58a3f</code></a> ncc</li> <li><a href="https://github.com/actions/upload-artifact/commit/1f64adb8530b493d492e8084db08a55f3856e94e"><code>1f64adb</code></a> fix import</li> <li>Additional commits viewable in <a href="https://github.com/actions/upload-artifact/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/linux-lcg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-lcg.yml b/.github/workflows/linux-lcg.yml index 189907da8..27b5ca75b 100644 --- a/.github/workflows/linux-lcg.yml +++ b/.github/workflows/linux-lcg.yml @@ -35,7 +35,7 @@ jobs: # check geometry source ${PREFIX}/setup.sh checkGeometry -c ${DETECTOR_PATH}/${DETECTOR}.xml - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: build-lcg-ubuntu2004 path: install/ From d70a78688bea10518887a4f38707c4332330e765 Mon Sep 17 00:00:00 2001 From: Matt <posik@temple.edu> Date: Sun, 28 Jan 2024 23:32:27 -0500 Subject: [PATCH 007/113] Outer mpgd barrel geoupdate (#613) ### Briefly, what does this PR introduce? Small updates to detector dimensions. Moved ACTS material binning to outer surface. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [x ] Other: Update dimentsions ### Please check if this PR fulfills the following: - [x ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators  ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/tracking/definitions_craterlake.xml | 2 +- compact/tracking/mpgd_outerbarrel.xml | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/compact/tracking/definitions_craterlake.xml b/compact/tracking/definitions_craterlake.xml index dc7cb92fb..79c3698fc 100644 --- a/compact/tracking/definitions_craterlake.xml +++ b/compact/tracking/definitions_craterlake.xml @@ -27,7 +27,7 @@ <constant name="TrackerEndcapDisk_rmax" value="43*cm"/> <comment> Main parameters for the outer MPGD barrel layer </comment> - <constant name="MPGDOuterBarrelModule_rmin" value="72.5"/> + <constant name="MPGDOuterBarrelModule_rmin" value="72.5*cm"/> <constant name="MPGDOuterBarrelModule_zmin1" value="164.5*cm"/> <constant name="MPGDOuterBarrelModule_zmin2" value="174.5*cm"/> diff --git a/compact/tracking/mpgd_outerbarrel.xml b/compact/tracking/mpgd_outerbarrel.xml index 9f280886f..262e6ece9 100644 --- a/compact/tracking/mpgd_outerbarrel.xml +++ b/compact/tracking/mpgd_outerbarrel.xml @@ -13,15 +13,16 @@ <define> <comment> Frames </comment> - <constant name="MPGDOuterBarrelFrame_width" value="20*mm"/> + <constant name="MPGDOuterBarrelFrame_width" value="15*mm"/> <constant name="MPGDOuterBarrelFrame_thickness" value="7*mm"/> <comment> Module constants </comment> - <constant name="MPGDOuterBarrelModule_roverlap" value="1.2*cm"/> - <constant name="MPGDOuterBarrelModule_zoverlap" value="3*MPGDOuterBarrelFrame_width"/> + <constant name="MPGDOuterBarrelModule_roverlap" value="0*cm"/> + <constant name="MPGDOuterBarrelModule_zoverlap" value="0*MPGDOuterBarrelFrame_width"/> <constant name="MPGDOuterBarrelModule_count" value="12" /> <constant name="MPGDOuterBarrelModule_allowed_space" value="2.5*cm"/> <constant name="MPGDOuterBarrelModule_rmax" value="MPGDOuterBarrelModule_rmin + MPGDOuterBarrelModule_allowed_space" /> + <constant name="MPGDOuterBarrelModule_roffset" value="0.5*cm" /> <constant name="MPGDOuterBarrelModule_width" value="34.0*cm"/> <constant name="MPGDOuerBarrel_length" value="MPGDOuterBarrelModule_zmin1 + MPGDOuterBarrelModule_zmin2"/> <constant name="MPGDOuterBarrelModule_length" value="0.5*(MPGDOuterBarrelModule_zmin1 + MPGDOuterBarrelModule_zmin2 + MPGDOuterBarrelModule_zoverlap)"/> @@ -148,13 +149,13 @@ </module> <comment> Layout for MPGD DIRC layers </comment> <layer module="MPGDOuterBarrelModule" id="0" vis="TrackerSupportVis"> - <envelope_tolerance r_min="-50*mm" r_max="0*mm" z_min="0*mm" z_max="0*mm"/> - <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDOuterBarrelModule_count" bins1="100" /> + <envelope_tolerance r_min="-50*mm" r_max="0*mm" z_min="0*mm" z_max="0*mm"/> + <layer_material surface="outer" binning="binPhi,binZ" bins0="MPGDOuterBarrelModule_count" bins1="100" /> <rphi_layout phi_tilt="0" nphi="MPGDOuterBarrelModule_count" phi0="0" - rc="MPGDOuterBarrelModule_rmin" + rc="MPGDOuterBarrelModule_rmin + MPGDOuterBarrelModule_roffset" dr="0" /> <z_layout dr = "MPGDOuterBarrelModule_roverlap" From 50e81b03c7a6ff5ebd2bfb6d0b314cd6686b799e Mon Sep 17 00:00:00 2001 From: Sebouh Paul <sebouh.paul@gmail.com> Date: Mon, 29 Jan 2024 13:38:02 -0500 Subject: [PATCH 008/113] Update ZDC_Crystal_LYSO.xml: Use readout name EcalFarForwardZDCHits (#612) Changed name of hits to EcalFarForwardZDCHits, as requested by @veprbl when reviewing pull request 1221 in EICrecon. ### Briefly, what does this PR introduce? Changes the name of the output bank for the LYSO section of the ZDC in order to match the convention used for the SiPM-on-tile section ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [X] Other: Changing the name of output banks to match the Change of the name of the readout output of the ZDC LYSO ### Please check if this PR fulfills the following: - [X] Tests for the changes have been added - [X] Documentation has been added / updated - [X] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? Users will need to change their code to use the new name of the ZDC Crystal LYSO detector, which is EcalFarForwardZDCHits ### Does this PR change default behavior? yes --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/far_forward/ZDC_Crystal_LYSO.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/far_forward/ZDC_Crystal_LYSO.xml b/compact/far_forward/ZDC_Crystal_LYSO.xml index 847d14853..f53de6173 100644 --- a/compact/far_forward/ZDC_Crystal_LYSO.xml +++ b/compact/far_forward/ZDC_Crystal_LYSO.xml @@ -41,7 +41,7 @@ name="ZDC_Crystal" type="ZDC_Crystal" vis="ZDC_Crystal_Vis" - readout="ZDCEcalHits"> + readout="EcalFarForwardZDCHits"> <position x="ZDC_Crystal_x_pos" y="ZDC_Crystal_y_pos" z="ZDC_Crystal_z_pos"/> <rotation x="ZDC_Crystal_rotateX_angle" y="ZDC_Crystal_rotateY_angle" z="ZDC_Crystal_rotateZ_angle"/> <dimensions x="ZDC_Crystal_nx * (ZDC_Crystal_cell_width + ZDC_Crystal_frame_thickness) + ZDC_Crystal_frame_thickness" @@ -61,7 +61,7 @@ </detectors> <readouts> - <readout name="ZDCEcalHits"> + <readout name="EcalFarForwardZDCHits"> <segmentation type="NoSegmentation"/> <id>system:8,module:2,crystal:12</id> </readout> From c4341a4356c0643cbdba30f10d880df4c8bf3aea Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Mon, 29 Jan 2024 19:37:07 -0500 Subject: [PATCH 009/113] linux-eic-shell.yml: use all available cores for cmake build (#619) [Should benefit us since we have 4 cores available](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories) --- .github/workflows/linux-eic-shell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index aac898e02..be3a34d76 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -90,7 +90,7 @@ jobs: platform-release: "jug_xl:nightly" run: | CC=${{ matrix.CC }} CXX=${{ matrix.CXX }} cmake -B build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - cmake --build build -- -k -j 2 install + cmake --build build -- -k -j $(getconf _NPROCESSORS_ONLN) install - uses: actions/upload-artifact@v4 with: name: build-${{ matrix.CC }}-full-eic-shell From 048593c2f32dcdda4792cac69df9ebd37a6ed46b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 21:36:53 -0600 Subject: [PATCH 010/113] build(deps): bump aidasoft/run-lcg-view from 1 to 4 (#627) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [aidasoft/run-lcg-view](https://github.com/aidasoft/run-lcg-view) from 1 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/aidasoft/run-lcg-view/releases">aidasoft/run-lcg-view's releases</a>.</em></p> <blockquote> <h2>v4</h2> <h2>What's Changed</h2> <ul> <li>Introduce a group to hide setup from logs by <a href="https://github.com/tmadlener"><code>@tmadlener</code></a> in <a href="https://redirect.github.com/AIDASoft/run-lcg-view/pull/4">AIDASoft/run-lcg-view#4</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/tmadlener"><code>@tmadlener</code></a> made their first contribution in <a href="https://redirect.github.com/AIDASoft/run-lcg-view/pull/3">AIDASoft/run-lcg-view#3</a></li> <li><a href="https://github.com/andresailer"><code>@andresailer</code></a> made their first contribution in <a href="https://redirect.github.com/AIDASoft/run-lcg-view/pull/5">AIDASoft/run-lcg-view#5</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/AIDASoft/run-lcg-view/compare/v3...v4">https://github.com/AIDASoft/run-lcg-view/compare/v3...v4</a></p> <h2>v3</h2> <p>Add support for running the base image directly via <code>/cvmfs/unpacked.cern.ch</code> in singularity (default: false) as well adds support for specifying the base image manually (default: auto discovery)</p> <h2>v2</h2> <p>Add extension to enable usage of Coverity Scan</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/9616cb419b1a2dd0fd08c9d6adcd8fe1edaaa5d0"><code>9616cb4</code></a> Test: coverity.yml</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/af1fb15dfa9ba48a6911bd08feddbda147e858ee"><code>af1fb15</code></a> README.md: update to v4, drop macos</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/50ca15d9fd91e5945b5656a17f4daadf45c2eea3"><code>50ca15d</code></a> Update action.yml</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/c9ff0e464ce86eea1f53acbf1164b08f182ac607"><code>c9ff0e4</code></a> Introduce a group to hide setup from logs</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/22828fc0f2f097ca4f9dc1dd99b5ade3720275be"><code>22828fc</code></a> Remove the mac workflow because CVMFS will stop working</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/995b88b69f5c370cc54ace7138ef745a795817b5"><code>995b88b</code></a> Make ilcsoft workflow to use an existing nightly build</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/9ec999646a0af384ad3aaf34a9ddec3068f98d97"><code>9ec9996</code></a> Update manual to v3</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/5b86ef8e3f27265430936dbf01a7687abb17571c"><code>5b86ef8</code></a> Add description to manual and add test for key4hep</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/3457e7fc02c1546ba2cd8c2d6a42d241af68ed9d"><code>3457e7f</code></a> Add option to specify which base image to use</li> <li><a href="https://github.com/AIDASoft/run-lcg-view/commit/d31e307e6e9097c3f35a517b7c8e36996e4a6054"><code>d31e307</code></a> Release unpacked in re-tag of v2 as it does not provide much of speed improve...</li> <li>Additional commits viewable in <a href="https://github.com/aidasoft/run-lcg-view/compare/v1...v4">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/linux-lcg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-lcg.yml b/.github/workflows/linux-lcg.yml index 27b5ca75b..7903aafe2 100644 --- a/.github/workflows/linux-lcg.yml +++ b/.github/workflows/linux-lcg.yml @@ -25,7 +25,7 @@ jobs: - uses: cvmfs-contrib/github-action-cvmfs@v4 with: cvmfs_repositories: 'sft.cern.ch,geant4.cern.ch' - - uses: aidasoft/run-lcg-view@v1 + - uses: aidasoft/run-lcg-view@v4 with: release-platform: ${{ matrix.LCG }} run: | From 34fcba10c3614719670794f6d8acd7a352ee35b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 04:14:17 -0600 Subject: [PATCH 011/113] build(deps): bump actions/labeler from 4 to 5 (#626) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/labeler](https://github.com/actions/labeler) from 4 to 5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/labeler/releases">actions/labeler's releases</a>.</em></p> <blockquote> <h2>v5.0.0</h2> <h2>What's Changed</h2> <p>This release contains the following breaking changes:</p> <ol> <li> <p>The ability to apply labels based on the names of base and/or head branches was added (<a href="https://redirect.github.com/actions/labeler/issues/186">#186</a> and <a href="https://redirect.github.com/actions/labeler/issues/54">#54</a>). The match object for changed files was expanded with new combinations in order to make it more intuitive and flexible (<a href="https://redirect.github.com/actions/labeler/issues/423">#423</a> and <a href="https://redirect.github.com/actions/labeler/issues/101">#101</a>). As a result, the configuration file structure was significantly redesigned and is not compatible with the structure of the previous version. Please read the <a href="https://github.com/actions/labeler/tree/main#pull-request-labeler">action documentation</a> to find out how to adapt your configuration files for use with the new action version.</p> </li> <li> <p>The bug related to the <code>sync-labels</code> input was fixed (<a href="https://redirect.github.com/actions/labeler/issues/112">#112</a>). Now the input value is read correctly.</p> </li> <li> <p>By default, <code>dot</code> input is set to <code>true</code>. Now, paths starting with a dot (e.g. <code>.github</code>) are matched by default.</p> </li> <li> <p>Version 5 of this action updated the <a href="https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions">runtime to Node.js 20</a>. All scripts are now run with Node.js 20 instead of Node.js 16 and are affected by any breaking changes between Node.js 16 and 20.</p> </li> </ol> <p>For more information, please read the <a href="https://github.com/actions/labeler/tree/main#pull-request-labeler">action documentation</a>.</p> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/joshdales"><code>@joshdales</code></a> made their first contribution in <a href="https://redirect.github.com/actions/labeler/pull/203">actions/labeler#203</a></li> <li><a href="https://github.com/dusan-trickovic"><code>@dusan-trickovic</code></a> made their first contribution in <a href="https://redirect.github.com/actions/labeler/pull/626">actions/labeler#626</a></li> <li><a href="https://github.com/sungh0lim"><code>@sungh0lim</code></a> made their first contribution in <a href="https://redirect.github.com/actions/labeler/pull/630">actions/labeler#630</a></li> <li><a href="https://github.com/TrianguloY"><code>@TrianguloY</code></a> made their first contribution in <a href="https://redirect.github.com/actions/labeler/pull/629">actions/labeler#629</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/labeler/compare/v4...v5.0.0">https://github.com/actions/labeler/compare/v4...v5.0.0</a></p> <h2>v5.0.0-beta.1</h2> <h2>What's Changed</h2> <p>In scope of this beta release, the structure of the configuration file (<code>.github/labeler.yml</code>) was changed from</p> <pre lang="yml"><code>LabelName: - any: - changed-files: ['list', 'of', 'globs'] - base-branch: ['list', 'of', 'regexps'] - head-branch: ['list', 'of', 'regexps'] - all: - changed-files: ['list', 'of', 'globs'] - base-branch: ['list', 'of', 'regexps'] - head-branch: ['list', 'of', 'regexps'] </code></pre> <p>to</p> <pre lang="yml"><code>LabelName: - any: - changed-files: - AnyGlobToAnyFile: ['list', 'of', 'globs'] - AnyGlobToAllFiles: ['list', 'of', 'globs'] - AllGlobsToAnyFile: ['list', 'of', 'globs'] - AllGlobsToAllFiles: ['list', 'of', 'globs'] - base-branch: ['list', 'of', 'regexps'] - head-branch: ['list', 'of', 'regexps'] - all: - changed-files: - AnyGlobToAnyFile: ['list', 'of', 'globs'] - AnyGlobToAllFiles: ['list', 'of', 'globs'] - AllGlobsToAnyFile: ['list', 'of', 'globs'] </tr></table> </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/labeler/commit/8558fd74291d67161a8a78ce36a881fa63b766a9"><code>8558fd7</code></a> Merge pull request <a href="https://redirect.github.com/actions/labeler/issues/709">#709</a> from actions/v5.0.0-beta</li> <li><a href="https://github.com/actions/labeler/commit/000ca75fe6c5838c790ca73b764419065c1594a6"><code>000ca75</code></a> Merge pull request <a href="https://redirect.github.com/actions/labeler/issues/700">#700</a> from MaksimZhukov/apply-suggestions-and-update-docume...</li> <li><a href="https://github.com/actions/labeler/commit/cb66c2f0788d382da1dabd06a094c0bc6ed3e26a"><code>cb66c2f</code></a> Update dist</li> <li><a href="https://github.com/actions/labeler/commit/9181355e36dc8e434c93ba5aaa33f699c4162f38"><code>9181355</code></a> Apply suggestions for the beta vesrion and update the documentation</li> <li><a href="https://github.com/actions/labeler/commit/efe4c1c90edf0ec238b5ee13e66e1abcbbe7446e"><code>efe4c1c</code></a> Merge pull request <a href="https://redirect.github.com/actions/labeler/issues/699">#699</a> from MaksimZhukov/update-node-runtime-and-dependencies</li> <li><a href="https://github.com/actions/labeler/commit/c0957ad7c30fb0638e275122d51df2330459854a"><code>c0957ad</code></a> Run Prettier</li> <li><a href="https://github.com/actions/labeler/commit/8dc8d1842f2f3ed1cf6f4190490ad02e0a755f0c"><code>8dc8d18</code></a> Update Node.js version in reusable workflows</li> <li><a href="https://github.com/actions/labeler/commit/d0d0bbebfbe119c8403a0e2724c5fa5b555c78b9"><code>d0d0bbe</code></a> Update documentation</li> <li><a href="https://github.com/actions/labeler/commit/1375c42512e0b855687040307d6dcaf403da9a4e"><code>1375c42</code></a> 5.0.0</li> <li><a href="https://github.com/actions/labeler/commit/ab7411ec21ea67102994adc0fa01b3f5cf63509f"><code>ab7411e</code></a> Change version of Node.js runtime to node20</li> <li>Additional commits viewable in <a href="https://github.com/actions/labeler/compare/v4...v5">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 057208eda..0127be633 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,6 +9,6 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" From 292d54fdb5fe6907bebcbd1a57ddbdfa38d04af2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:35:52 -0500 Subject: [PATCH 012/113] build(deps): bump actions/checkout from 3 to 4 (#625) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update default runtime to node20 by <a href="https://github.com/takost"><code>@takost</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1436">actions/checkout#1436</a></li> <li>Support fetching without the --progress option by <a href="https://github.com/simonbaird"><code>@simonbaird</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1067">actions/checkout#1067</a></li> <li>Release 4.0.0 by <a href="https://github.com/takost"><code>@takost</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1447">actions/checkout#1447</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/takost"><code>@takost</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1436">actions/checkout#1436</a></li> <li><a href="https://github.com/simonbaird"><code>@simonbaird</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1067">actions/checkout#1067</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3...v4.0.0">https://github.com/actions/checkout/compare/v3...v4.0.0</a></p> <h2>v3.6.0</h2> <h2>What's Changed</h2> <ul> <li>Mark test scripts with Bash'isms to be run via Bash by <a href="https://github.com/dscho"><code>@dscho</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1377">actions/checkout#1377</a></li> <li>Add option to fetch tags even if fetch-depth > 0 by <a href="https://github.com/RobertWieczoreck"><code>@RobertWieczoreck</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/579">actions/checkout#579</a></li> <li>Release 3.6.0 by <a href="https://github.com/luketomlinson"><code>@luketomlinson</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1437">actions/checkout#1437</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/RobertWieczoreck"><code>@RobertWieczoreck</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/579">actions/checkout#579</a></li> <li><a href="https://github.com/luketomlinson"><code>@luketomlinson</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1437">actions/checkout#1437</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3.5.3...v3.6.0">https://github.com/actions/checkout/compare/v3.5.3...v3.6.0</a></p> <h2>v3.5.3</h2> <h2>What's Changed</h2> <ul> <li>Fix: Checkout Issue in self hosted runner due to faulty submodule check-ins by <a href="https://github.com/megamanics"><code>@megamanics</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1196">actions/checkout#1196</a></li> <li>Fix typos found by codespell by <a href="https://github.com/DimitriPapadopoulos"><code>@DimitriPapadopoulos</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1287">actions/checkout#1287</a></li> <li>Add support for sparse checkouts by <a href="https://github.com/dscho"><code>@dscho</code></a> and <a href="https://github.com/dfdez"><code>@dfdez</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1369">actions/checkout#1369</a></li> <li>Release v3.5.3 by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1376">actions/checkout#1376</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/megamanics"><code>@megamanics</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1196">actions/checkout#1196</a></li> <li><a href="https://github.com/DimitriPapadopoulos"><code>@DimitriPapadopoulos</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1287">actions/checkout#1287</a></li> <li><a href="https://github.com/dfdez"><code>@dfdez</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1369">actions/checkout#1369</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3...v3.5.3">https://github.com/actions/checkout/compare/v3...v3.5.3</a></p> <h2>v3.5.2</h2> <h2>What's Changed</h2> <ul> <li>Fix: Use correct API url / endpoint in GHES by <a href="https://github.com/fhammerl"><code>@fhammerl</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1289">actions/checkout#1289</a> based on <a href="https://redirect.github.com/actions/checkout/issues/1286">#1286</a> by <a href="https://github.com/1newsr"><code>@1newsr</code></a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3.5.1...v3.5.2">https://github.com/actions/checkout/compare/v3.5.1...v3.5.2</a></p> <h2>v3.5.1</h2> <h2>What's Changed</h2> <ul> <li>Improve checkout performance on Windows runners by upgrading <code>@actions/github</code> dependency by <a href="https://github.com/BrettDong"><code>@BrettDong</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1246">actions/checkout#1246</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/BrettDong"><code>@BrettDong</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1246">actions/checkout#1246</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v4.1.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1396">Add support for partial checkout filters</a></li> </ul> <h2>v4.0.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1067">Support fetching without the --progress option</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1436">Update to node20</a></li> </ul> <h2>v3.6.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1377">Fix: Mark test scripts with Bash'isms to be run via Bash</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/579">Add option to fetch tags even if fetch-depth > 0</a></li> </ul> <h2>v3.5.3</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1196">Fix: Checkout fail in self-hosted runners when faulty submodule are checked-in</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1287">Fix typos found by codespell</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1369">Add support for sparse checkouts</a></li> </ul> <h2>v3.5.2</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1289">Fix api endpoint for GHES</a></li> </ul> <h2>v3.5.1</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1246">Fix slow checkout on Windows</a></li> </ul> <h2>v3.5.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1237">Add new public key for known_hosts</a></li> </ul> <h2>v3.4.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1209">Upgrade codeql actions to v2</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1210">Upgrade dependencies</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1225">Upgrade <code>@actions/io</code></a></li> </ul> <h2>v3.3.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1045">Implement branch list using callbacks from exec function</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1050">Add in explicit reference to private checkout options</a></li> <li>[Fix comment typos (that got added in <a href="https://redirect.github.com/actions/checkout/issues/770">#770</a>)](<a href="https://redirect.github.com/actions/checkout/pull/1057">actions/checkout#1057</a>)</li> </ul> <h2>v3.2.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/942">Add GitHub Action to perform release</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/967">Fix status badge</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1002">Replace datadog/squid with ubuntu/squid Docker image</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/964">Wrap pipeline commands for submoduleForeach in quotes</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1029">Update <code>@actions/io</code> to 1.1.2</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1039">Upgrading version to 3.2.0</a></li> </ul> <h2>v3.1.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/939">Use <code>@actions/core</code> <code>saveState</code> and <code>getState</code></a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/922">Add <code>github-server-url</code> input</a></li> </ul> <h2>v3.0.2</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/checkout/commit/b4ffde65f46336ab88eb53be808477a3936bae11"><code>b4ffde6</code></a> Link to release page from what's new section (<a href="https://redirect.github.com/actions/checkout/issues/1514">#1514</a>)</li> <li><a href="https://github.com/actions/checkout/commit/8530928916aaef40f59e6f221989ccb31f5759e7"><code>8530928</code></a> Correct link to GitHub Docs (<a href="https://redirect.github.com/actions/checkout/issues/1511">#1511</a>)</li> <li><a href="https://github.com/actions/checkout/commit/7cdaf2fbc075e6f3b9ca94cfd6cec5adc8a75622"><code>7cdaf2f</code></a> Update CODEOWNERS to Launch team (<a href="https://redirect.github.com/actions/checkout/issues/1510">#1510</a>)</li> <li><a href="https://github.com/actions/checkout/commit/8ade135a41bc03ea155e62e844d188df1ea18608"><code>8ade135</code></a> Prepare 4.1.0 release (<a href="https://redirect.github.com/actions/checkout/issues/1496">#1496</a>)</li> <li><a href="https://github.com/actions/checkout/commit/c533a0a4cfc4962971818edcfac47a2899e69799"><code>c533a0a</code></a> Add support for partial checkout filters (<a href="https://redirect.github.com/actions/checkout/issues/1396">#1396</a>)</li> <li><a href="https://github.com/actions/checkout/commit/72f2cec99f417b1a1c5e2e88945068983b7965f9"><code>72f2cec</code></a> Update README.md for V4 (<a href="https://redirect.github.com/actions/checkout/issues/1452">#1452</a>)</li> <li><a href="https://github.com/actions/checkout/commit/3df4ab11eba7bda6032a0b82a6bb43b11571feac"><code>3df4ab1</code></a> Release 4.0.0 (<a href="https://redirect.github.com/actions/checkout/issues/1447">#1447</a>)</li> <li><a href="https://github.com/actions/checkout/commit/8b5e8b768746b50394015010d25e690bfab9dfbc"><code>8b5e8b7</code></a> Support fetching without the --progress option (<a href="https://redirect.github.com/actions/checkout/issues/1067">#1067</a>)</li> <li><a href="https://github.com/actions/checkout/commit/97a652b80035363df47baee5031ec8670b8878ac"><code>97a652b</code></a> Update default runtime to node20 (<a href="https://redirect.github.com/actions/checkout/issues/1436">#1436</a>)</li> <li>See full diff in <a href="https://github.com/actions/checkout/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/linux-lcg.yml | 2 +- .github/workflows/pr-backport.yml | 2 +- .github/workflows/spdx.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-lcg.yml b/.github/workflows/linux-lcg.yml index 7903aafe2..fc2794fe4 100644 --- a/.github/workflows/linux-lcg.yml +++ b/.github/workflows/linux-lcg.yml @@ -21,7 +21,7 @@ jobs: matrix: LCG: ["LCG_101/x86_64-ubuntu2004-gcc9-opt"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: cvmfs-contrib/github-action-cvmfs@v4 with: cvmfs_repositories: 'sft.cern.ch,geant4.cern.ch' diff --git a/.github/workflows/pr-backport.yml b/.github/workflows/pr-backport.yml index cd66df1d4..768d1965f 100644 --- a/.github/workflows/pr-backport.yml +++ b/.github/workflows/pr-backport.yml @@ -12,7 +12,7 @@ jobs: # Don't run on closed unmerged pull requests if: github.event.pull_request.merged steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create backport pull requests uses: korthout/backport-action@v2 with: diff --git a/.github/workflows/spdx.yml b/.github/workflows/spdx.yml index 5060a3e97..351e85500 100644 --- a/.github/workflows/spdx.yml +++ b/.github/workflows/spdx.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: enarx/spdx@266ce9351a52b27e4bce5e1dbeecb23498f33add with: licenses: LGPL-3.0-or-later From c2d4135c7c22a52cb2ca207987b3800e7a26e7da Mon Sep 17 00:00:00 2001 From: lkosarz <42405623+lkosarz@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:03:36 -0500 Subject: [PATCH 013/113] Fix the backward HCal position and add flux return (#615) ### Briefly, what does this PR introduce? Fixed the backward HCal position Added flux return, collar and oculus material All according to the detector parameter table: https://eic.jlab.org/Geometry/Detector/Detector-20240117135224.html ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? ### Does this PR change default behavior? --------- Signed-off-by: lkosarz <leszek.kosarzewski@gmail.com> Signed-off-by: Kosarzewski <kosarzewski.1@asc.ohio-state.edu> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> Co-authored-by: Kosarzewski <kosarzewski.1@asc.ohio-state.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/definitions.xml | 15 +++++- compact/display.xml | 2 + compact/hcal/backward_endcap_flux.xml | 41 +++++++++++++++ configurations/arches.yml | 1 + configurations/brycecanyon.yml | 1 + configurations/calorimeters.yml | 1 + configurations/central.yml | 1 + configurations/craterlake.yml | 1 + configurations/craterlake_10x100.yml | 1 + configurations/craterlake_18x110_Au.yml | 1 + configurations/craterlake_18x275.yml | 1 + configurations/craterlake_5x41.yml | 1 + configurations/full.yml | 1 + src/EndcapFluxReturn_geo.cpp | 66 +++++++++++++++++++++++++ 14 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 compact/hcal/backward_endcap_flux.xml create mode 100644 src/EndcapFluxReturn_geo.cpp diff --git a/compact/definitions.xml b/compact/definitions.xml index 0d53b1b7a..e8d63b29a 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -595,7 +595,7 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <constant name="HcalEndcapPInsert_yposition" value="EcalEndcapPInsert_yposition"/> <constant name="HcalEndcapN_CaloSides" value="60"/> - <constant name="HcalEndcapN_zmin" value="BackwardServiceGap_zmax"/> + <constant name="HcalEndcapN_zmin" value="BackwardServiceGap_zmax + 64.0 * cm"/> <!-- 64 cm gap between service gap, includes 28.5 cm oculus --> <constant name="HcalEndcapN_length" value="45.0*cm"/> <constant name="HcalEndcapN_zmax" value="HcalEndcapN_zmin + HcalEndcapN_length"/> <comment> HcalEndcapN needs to clear the straight beampipe with 1 * crossing angle + its radius of 22.25 mm </comment> @@ -608,8 +608,19 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <constant name="HcalBarrelBackward_zmax" value="BackwardServiceGap_zmin"/> <constant name="HcalBarrel_length" value="HcalBarrelForward_zmax + HcalBarrelBackward_zmax"/> <constant name="HcalBarrel_offset" value="(HcalBarrelForward_zmax - HcalBarrelBackward_zmax)/2"/> - <constant name="HcalEndcapN_rmax" value="HcalBarrel_rmax"/> + <constant name="HcalEndcapN_rmax" value="min(HcalBarrel_rmax, 267.0 * cm)"/> <constant name="LFHCAL_rmax" value="HcalBarrel_rmax"/> + + <constant name="FluxEndcapN_collar_rmax" value="326.2*cm"/> + <constant name="FluxEndcapN_collar_rmin" value="269.0*cm"/> + <constant name="FluxEndcapN_collar_thickness" value="120.4*cm"/> + <constant name="FluxEndcapN_oculus_rmax" value="267.0*cm"/> + <constant name="FluxEndcapN_oculus_rmin" value="213.6*cm"/> + <constant name="FluxEndcapN_oculus_thickness" value="28.5*cm"/> + <constant name="FluxEndcapN_rmax" value="267.0*cm"/> + <constant name="FluxEndcapN_rmin" value="14*cm"/> + <constant name="FluxEndcapN_thickness" value="10*cm"/> + <comment> These are used by ddsim, the region where we store all secondaries diff --git a/compact/display.xml b/compact/display.xml index c940bd022..c81004252 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -98,6 +98,8 @@ <vis name="HcalAbsorberVis" ref="AnlGray" showDaughters="false" visible="false"/> <vis name="HcalEndcapInsertVis" ref="AnlGray" showDaughters="false" visible="true"/> <vis name="LFHCALVis" ref="AnlBlue" showDaughters="true" visible="true"/> + <vis name="FluxEndcapNVis" ref="AnlGray" showDaughters="true" visible="false"/> + <vis name="FluxEndcapNLayerVis" ref="AnlViolet" showDaughters="false" visible="true"/> <comment> Passive steel for flux return </comment> diff --git a/compact/hcal/backward_endcap_flux.xml b/compact/hcal/backward_endcap_flux.xml new file mode 100644 index 000000000..64595615c --- /dev/null +++ b/compact/hcal/backward_endcap_flux.xml @@ -0,0 +1,41 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2023 Wouter Deconinck, Leszek Kosarzewski --> + +<lccdd> + <define> + <documentation> + #### Dimension constants + </documentation> + <constant name="FluxEndcapN_zshift" value="FluxEndcapN_collar_thickness-FluxEndcapN_thickness"/> + <constant name="FluxEndcapN_zmin" value="BackwardServiceGap_zmax"/> + + </define> + + + <!-- Define detector --> + <detectors> + <documentation> + ### Backwards (Negative Z) Endcap Flux Return + </documentation> + <detector name="FluxEndcapN" type="epic_EndcapFluxReturnN" vis="FluxEndcapNVis"> + <position x="0" y="0" z="-FluxEndcapN_zmin"/> + + <layer id="1" name="Collar" material="Steel235" + rmin="FluxEndcapN_collar_rmin" rmax="FluxEndcapN_collar_rmax" zpos="0*cm" + thickness="FluxEndcapN_collar_thickness" vis="FluxEndcapNLayerVis" + /> + <layer id="2" name="Oculus" material="Steel235" + rmin="FluxEndcapN_oculus_rmin" rmax="FluxEndcapN_oculus_rmax" zpos="0*cm" + thickness="FluxEndcapN_oculus_thickness" vis="FluxEndcapNLayerVis" + /> + <layer id="3" name="FluxReturn" material="Steel235" + rmin="FluxEndcapN_rmin" rmax="FluxEndcapN_rmax" zpos="FluxEndcapN_zshift" + thickness="FluxEndcapN_thickness" vis="FluxEndcapNLayerVis" + /> + + + </detector> + </detectors> + + +</lccdd> diff --git a/configurations/arches.yml b/configurations/arches.yml index 52691fe7c..004e43f65 100644 --- a/configurations/arches.yml +++ b/configurations/arches.yml @@ -25,6 +25,7 @@ features: lfhcal_without_space_for_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/configurations/brycecanyon.yml b/configurations/brycecanyon.yml index 5da9620da..4e0cd3e8c 100644 --- a/configurations/brycecanyon.yml +++ b/configurations/brycecanyon.yml @@ -26,6 +26,7 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/configurations/calorimeters.yml b/configurations/calorimeters.yml index 50b627645..542f38c2c 100644 --- a/configurations/calorimeters.yml +++ b/configurations/calorimeters.yml @@ -11,3 +11,4 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: diff --git a/configurations/central.yml b/configurations/central.yml index 352eee8b2..b7f997e53 100644 --- a/configurations/central.yml +++ b/configurations/central.yml @@ -25,3 +25,4 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: diff --git a/configurations/craterlake.yml b/configurations/craterlake.yml index 7e301e7ba..51a600e8d 100644 --- a/configurations/craterlake.yml +++ b/configurations/craterlake.yml @@ -29,6 +29,7 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/configurations/craterlake_10x100.yml b/configurations/craterlake_10x100.yml index 90d1f700f..2bf1db35d 100644 --- a/configurations/craterlake_10x100.yml +++ b/configurations/craterlake_10x100.yml @@ -29,6 +29,7 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/configurations/craterlake_18x110_Au.yml b/configurations/craterlake_18x110_Au.yml index 2862122c2..98a383739 100644 --- a/configurations/craterlake_18x110_Au.yml +++ b/configurations/craterlake_18x110_Au.yml @@ -29,6 +29,7 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/configurations/craterlake_18x275.yml b/configurations/craterlake_18x275.yml index 72f037a22..e9a96660c 100644 --- a/configurations/craterlake_18x275.yml +++ b/configurations/craterlake_18x275.yml @@ -29,6 +29,7 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/configurations/craterlake_5x41.yml b/configurations/craterlake_5x41.yml index 7e301e7ba..51a600e8d 100644 --- a/configurations/craterlake_5x41.yml +++ b/configurations/craterlake_5x41.yml @@ -29,6 +29,7 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/configurations/full.yml b/configurations/full.yml index dbe3eefaf..d99001e42 100644 --- a/configurations/full.yml +++ b/configurations/full.yml @@ -25,6 +25,7 @@ features: forward_insert: barrel_gdml: backward: + backward_endcap_flux: far_forward: far_forward: far_backward: diff --git a/src/EndcapFluxReturn_geo.cpp b/src/EndcapFluxReturn_geo.cpp new file mode 100644 index 000000000..c17158e94 --- /dev/null +++ b/src/EndcapFluxReturn_geo.cpp @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (C) 2024 Leszek Kosarzewski + +//========================================================================== +// Implementation of backward endcap flux return +//-------------------------------------------------------------------------- +// Author: Leszek Kosarzewski (OSU) +//========================================================================== + +#include "DD4hep/DetFactoryHelper.h" +#include "TVector3.h" +#include "XML/Layering.h" + +static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[maybe_unused]] dd4hep::SensitiveDetector sens) +{ + xml_det_t x_det = e; + int det_id = x_det.id(); + std::string det_name = x_det.nameStr(); + dd4hep::Material air = description.air(); + xml_comp_t x_pos = x_det.position(); + + + dd4hep::Assembly assembly(det_name); + dd4hep::DetElement sdet(det_name, det_id); + dd4hep::PlacedVolume pv; + + double disksGap = 0.0; + + // Looping through all the different layer sections + for (xml_coll_t xc(x_det, _U(layer)); xc; ++xc) { + xml_comp_t x_layer = xc; + + int layer_id = x_layer.id(); + double layer_rmax = x_layer.rmax(); + double layer_rmin = x_layer.rmin(); + double layer_thickness = x_layer.thickness(); + double layer_zpos = x_layer.zpos(); + + dd4hep::Material l_mat = description.material(x_layer.materialStr()); + + + dd4hep::DetElement disk_ele("disk_ele", layer_id); + dd4hep::Volume disk(x_layer.nameStr(), dd4hep::Tube(layer_rmin, layer_rmax, layer_thickness / 2, 0.0, 2.0 * M_PI), air); + disk.setVisAttributes(description.visAttributes(x_layer.visStr())); + + dd4hep::Volume halfdisk("halfdisk", dd4hep::Tube(layer_rmin, layer_rmax, layer_thickness / 2, M_PI / 2, M_PI * 3 / 2), l_mat); + halfdisk.setVisAttributes(description.visAttributes(x_layer.visStr())); + dd4hep::PlacedVolume s_phv1 = disk.placeVolume(halfdisk, dd4hep::Position(-disksGap / 2, 0, 0)); + s_phv1.addPhysVolID("halfdisk", 0); + dd4hep::PlacedVolume s_phv2 = disk.placeVolume(halfdisk, dd4hep::Transform3D(dd4hep::RotationZYX(M_PI, 0, 0), dd4hep::Position(+disksGap / 2, 0, 0))); + s_phv2.addPhysVolID("halfdisk", 1); + + + pv = assembly.placeVolume(disk, dd4hep::Position(0, 0, -layer_thickness/2-layer_zpos)); + pv.addPhysVolID("layer", layer_id); + disk_ele.setPlacement(pv); + } + + // Get position and place volume + dd4hep::Position pos(x_pos.x(), x_pos.y(), x_pos.z()); + pv = description.pickMotherVolume(sdet).placeVolume(assembly, pos); + sdet.setPlacement(pv); + return sdet; +} + +DECLARE_DETELEMENT(epic_EndcapFluxReturnN, create_detector) From 7f8b54d9cab5be2bf26645376fcf08eeeb588c22 Mon Sep 17 00:00:00 2001 From: Matt <posik@temple.edu> Date: Thu, 1 Feb 2024 20:56:04 -0500 Subject: [PATCH 014/113] Outer mpgd barrel update (#628) ### Briefly, what does this PR introduce? Adjusts the active to dead area of the outer barrel MPGD and modifies the material budget. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [x ] Other: Geometry/material update - ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ x] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? None ### Does this PR change default behavior? No --- compact/tracking/mpgd_outerbarrel.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compact/tracking/mpgd_outerbarrel.xml b/compact/tracking/mpgd_outerbarrel.xml index 262e6ece9..4d31f71dc 100644 --- a/compact/tracking/mpgd_outerbarrel.xml +++ b/compact/tracking/mpgd_outerbarrel.xml @@ -13,7 +13,7 @@ <define> <comment> Frames </comment> - <constant name="MPGDOuterBarrelFrame_width" value="15*mm"/> + <constant name="MPGDOuterBarrelFrame_width" value="10*mm"/> <constant name="MPGDOuterBarrelFrame_thickness" value="7*mm"/> <comment> Module constants </comment> @@ -23,7 +23,7 @@ <constant name="MPGDOuterBarrelModule_allowed_space" value="2.5*cm"/> <constant name="MPGDOuterBarrelModule_rmax" value="MPGDOuterBarrelModule_rmin + MPGDOuterBarrelModule_allowed_space" /> <constant name="MPGDOuterBarrelModule_roffset" value="0.5*cm" /> - <constant name="MPGDOuterBarrelModule_width" value="34.0*cm"/> + <constant name="MPGDOuterBarrelModule_width" value="36.0*cm"/> <constant name="MPGDOuerBarrel_length" value="MPGDOuterBarrelModule_zmin1 + MPGDOuterBarrelModule_zmin2"/> <constant name="MPGDOuterBarrelModule_length" value="0.5*(MPGDOuterBarrelModule_zmin1 + MPGDOuterBarrelModule_zmin2 + MPGDOuterBarrelModule_zoverlap)"/> <constant name="MPGDOuterBarrelModule_offset" value="(MPGDOuterBarrelModule_zmin2 - MPGDOuterBarrelModule_zmin1)/2.0"/> @@ -38,7 +38,7 @@ <constant name="MPGDOuterBarrelFoilKapton_thickness" value="50*um"/> <constant name="MPGDOuterBarrelReadOutNomex_thickness" value="50*um"/> <constant name="MPGDOuterBarrelReadOutKapton_thickness" value="50*um"/> - <constant name="MPGDOuterBarrelPCB_thickness" value="1.5*mm"/> + <constant name="MPGDOuterBarrelPCB_thickness" value="2.8*mm"/> <comment> Thickness values </comment> <constant name="MPGDOuterBarrelCathode_thickness" value="MPGDOuterBarrelFoilKapton_thickness + MPGDOuterBarrelFoilCu_thickness"/> From eaf7f8089c16ef4e935e97c671e957f82942fea4 Mon Sep 17 00:00:00 2001 From: ARANYA GIRI <101357961+aranyagiri@users.noreply.github.com> Date: Fri, 2 Feb 2024 23:52:33 -0600 Subject: [PATCH 015/113] Add new Lumi CAL design (#435) ### Briefly, what does this PR introduce? Add a W-scintillating fiber calorimeter design for the lumi pair spectrometer. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? ### Does this PR change default behavior? --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> Co-authored-by: Dhevan Gangadharan <dhevanga@gmail.com> Co-authored-by: Dhevan Gangadharan <43478603+dhevang@users.noreply.github.com> Co-authored-by: simonge <simon.gardner@glasgow.ac.uk> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/display.xml | 8 + compact/far_backward/definitions.xml | 35 +++- compact/far_backward/lumi.xml | 2 +- compact/far_backward/lumi/spec_ScFi_cal.xml | 37 ++++ compact/far_backward/taggers.xml | 5 - compact/materials.xml | 12 ++ src/EcalLumiSpecWScFi_geo.cpp | 197 ++++++++++++++++++++ 7 files changed, 281 insertions(+), 15 deletions(-) create mode 100644 compact/far_backward/lumi/spec_ScFi_cal.xml create mode 100644 src/EcalLumiSpecWScFi_geo.cpp diff --git a/compact/display.xml b/compact/display.xml index c81004252..4b54d080b 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -59,6 +59,14 @@ <comment> For shielded modules by default just display to module instead of 6 layers </comment> <vis name="FFTrackerShieldedModuleVis" ref="FFTrackerModuleVis" visible="true" showDaughters="false" /> + <comment> + Luminosity Visualisation + </comment> + <vis name="LumiSpecCAL_ModuleVis" ref="AnlGold" alpha="0.5" visible="true" showDaughters="true"/> + <vis name="LumiSpecCAL_FiberVis" ref="AnlRed" alpha="0.8" visible="true"/> + <vis name="LumiSpecCAL_FiberHolderVis" ref="AnlBlue" alpha="1.0" visible="true"/> + + <comment> ECal Vis </comment> diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index a39df675d..ee3a4b26c 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -224,6 +224,7 @@ <constant name="Tagger2_Max_Theta" value="Tagger1_Min_Theta+0.000*rad"/> <constant name="Tagger2_Min_Offset" value="Q3eR_InnerRadius+Backwards_Box_Wall"/> + <!-- --> <!-- Luminosity System --> <!-- --> @@ -270,18 +271,34 @@ <constant name="LumiConverter_DZ" value="1*mm"/> <!-- Lumi spectrometer CAL --> - <constant name="LumiSpecCAL_DXY" value="0.2*m"/> - <constant name="LumiSpecCALTower_DXY" value="0.02*m"/> - <constant name="LumiSpecCALTower_DZ" value="0.2*m"/> - <constant name="LumiSpecCAL_Z" value="-8*m + LumiSweepMag_Z - LumiSpecCALTower_DZ/2.0"/> - <constant name="LumiSpecCAL_FiveSigma" value="LumiBeamDiv_pref * fabs(LumiSpecCAL_Z)"/> - <constant name="LumiSpecCAL_Y" value="LumiSpecCAL_FiveSigma + LumiSpecCAL_DXY/2.0"/> + <constant name="LumiSpecCAL_SiPMSizeXY" value="3*mm"/> + <constant name="LumiSpecCAL_SiPMNumX" value="20"/> + <constant name="LumiSpecCAL_SiPMNumY" value="3"/> + <constant name="LumiSpecCAL_ZLayers" value="20"/> + <constant name="LumiSpecCAL_XYLayers" value="3"/> + <comment> + Note : Values/Notations for making modules pointing along z-axis. + Rotation of modules wrt XY axis after construction. + </comment> + <constant name="LumiSpecCAL_ModSizeX" value="LumiSpecCAL_SiPMNumX*LumiSpecCAL_SiPMSizeXY"/> + <constant name="LumiSpecCAL_ModSizeY" value="LumiSpecCAL_SiPMNumY*LumiSpecCAL_SiPMSizeXY"/> + <constant name="LumiSpecCAL_DZ" value="LumiSpecCAL_ZLayers*LumiSpecCAL_ModSizeY"/> + <constant name="LumiSpecCAL_DXY" value="LumiSpecCAL_XYLayers*LumiSpecCAL_ModSizeX"/> + <constant name="LumiSpecCAL_ModSizeZ" value="LumiSpecCAL_DXY"/> <!-- fibre length --> + + <constant name="LumiSpecCAL_Z" value="-8*m + LumiSweepMag_Z - LumiSpecCAL_DZ/2.0"/> + <constant name="LumiSpecCAL_FiveSigma" value="LumiBeamDiv_pref * fabs(LumiSpecCAL_Z)"/> + <constant name="LumiSpecCAL_Y" value="LumiSpecCAL_FiveSigma + LumiSpecCAL_DXY/2.0"/> + + <constant name="LumiSpecCAL_FiberRadius" value="0.25*mm"/> + <constant name="LumiSpecCAL_FiberSpaceX" value="0.25*mm"/> + <constant name="LumiSpecCAL_FiberSpaceY" value="0.25*mm"/> <!-- Lumi spectrometer trackers --> <constant name="LumiSpecTracker_pixelSize" value="0.1*mm"/> <constant name="LumiSpecTracker_DXY" value="0.2*m"/> - <constant name="LumiSpecTracker_Z1" value="LumiSpecCAL_Z + LumiSpecCALTower_DZ/2. + 1*cm"/> - <constant name="LumiSpecTracker_Z2" value="LumiSpecCAL_Z + LumiSpecCALTower_DZ/2. + 11*cm"/> + <constant name="LumiSpecTracker_Z1" value="LumiSpecCAL_Z + LumiSpecCAL_DZ/2. + 1*cm"/> + <constant name="LumiSpecTracker_Z2" value="LumiSpecCAL_Z + LumiSpecCAL_DZ/2. + 11*cm"/> <constant name="LumiSpecTracker_Y1" value="LumiSpecCAL_FiveSigma + LumiSpecTracker_DXY/2.0"/> <constant name="LumiSpecTracker_Y2" value="LumiSpecTracker_Y1"/> @@ -293,4 +310,4 @@ <constant name="LumiDirect_XY" value="0.2*m"/> <constant name="LumiDirect_DZ" value="0.2*m"/> - </define> +</define> diff --git a/compact/far_backward/lumi.xml b/compact/far_backward/lumi.xml index 2209a7080..c9dfed457 100644 --- a/compact/far_backward/lumi.xml +++ b/compact/far_backward/lumi.xml @@ -7,7 +7,7 @@ <include ref="lumi/collimator.xml"/> <include ref="lumi/lumi_magnets.xml"/> <include ref="lumi/spec_tracker.xml"/> - <include ref="lumi/spec_homo_cal.xml"/> + <include ref="lumi/spec_ScFi_cal.xml"/> <include ref="lumi/photon_chamber.xml"/> <include ref="lumi/directPC.xml"/> diff --git a/compact/far_backward/lumi/spec_ScFi_cal.xml b/compact/far_backward/lumi/spec_ScFi_cal.xml new file mode 100644 index 000000000..3edf00d97 --- /dev/null +++ b/compact/far_backward/lumi/spec_ScFi_cal.xml @@ -0,0 +1,37 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2023 Aranya Giri --> + +<lccdd> + + <detectors> + <detector id="LumiSpecCAL_ID" name="LumiSpecCAL" type="EcalLumiSpecWScFi" vis="FFPreVis" readout="EcalLumiSpecHits" sizeXY="LumiSpecCAL_DXY" sizeZ="LumiSpecCAL_DZ" nmod_perlayer="LumiSpecCAL_XYLayers" nlayer="LumiSpecCAL_ZLayers" > + <position x="0.0*cm" y="0.0*cm" z="0.0*cm"/> + <rotation x="0.0*rad" y="0.0*rad" z="0.0*rad"/> + <module sizex="LumiSpecCAL_ModSizeX" sizey="LumiSpecCAL_ModSizeY" sizez="LumiSpecCAL_ModSizeZ" material="WPowderplusEpoxy" vis="LumiSpecCAL_ModuleVis"> + <fiber + material="Polystyrene" + radius="LumiSpecCAL_FiberRadius" + spacex="LumiSpecCAL_FiberSpaceX" + spacey="LumiSpecCAL_FiberSpaceY" + vis="LumiSpecCAL_FiberVis"/> + <fiberholder material="Brass360" vis="LumiSpecCAL_FiberHolderVis"/> + </module> + <sector id="0"> + <position x="0.0*cm" y="LumiSpecCAL_Y" z="LumiSpecCAL_Z"/> + <rotation x="0.0*rad" y="0.0*rad" z="0.0*rad"/> + </sector> + <sector id="1"> + <position x="0.0*cm" y="-1*LumiSpecCAL_Y" z="LumiSpecCAL_Z"/> + <rotation x="0.0*rad" y="0.0*rad" z="0.0*rad"/> + </sector> + </detector> + </detectors> + + <readouts> + <readout name="EcalLumiSpecHits"> + <segmentation type="NoSegmentation"/> + <id>system:8,sector:4,orientation:4,layer:8,module:4,fiber_x:16,fiber_y:16</id> + </readout> + </readouts> + +</lccdd> diff --git a/compact/far_backward/taggers.xml b/compact/far_backward/taggers.xml index f6833b6c3..7c16fa727 100644 --- a/compact/far_backward/taggers.xml +++ b/compact/far_backward/taggers.xml @@ -78,11 +78,6 @@ <id>system:8,module:2,layer:4,sensor:4,x:32:-16,y:-16</id> </readout> - <readout name="TaggerCalorimeterHits"> - <segmentation type="NoSegmentation"/> - <id>system:8,module:2,crystal:8,x:32:-16,y:-16</id> - </readout> - </readouts> </lccdd> diff --git a/compact/materials.xml b/compact/materials.xml index 4b625e7fd..5424131ac 100644 --- a/compact/materials.xml +++ b/compact/materials.xml @@ -270,6 +270,11 @@ <fraction n="0.052*19./40" ref="C"/> <fraction n="0.052*21./40" ref="H"/> </material> + <material name="WPowderplusEpoxy"> + <D type="density" unit="g/cm3" value="10.95"/> + <fraction n="0.97" ref="Tungsten"/> + <fraction n="0.03" ref="Epoxy"/> + </material> <material name="CarbonFiber_25percent"> <D type="density" value="0.375" unit="g / cm3"/> <fraction n="1.0" ref="CarbonFiber"/> @@ -479,6 +484,13 @@ <fraction n="0.70" ref="Cu"/> <fraction n="0.30" ref="Zn"/> </material> + <material name="Brass360"> + <D type="density" unit="g/cm3" value="8.49"/> + <fraction n="0.6045" ref="Cu"/> + <fraction n="0.3550" ref="Zn"/> + <fraction n="0.0370" ref="Pb"/> + <fraction n="0.0035" ref="Fe"/> + </material> <material name="NbTi"> <D type="density" value="6.54" unit="g / cm3"/> <fraction n="0.50" ref="Nb"/> diff --git a/src/EcalLumiSpecWScFi_geo.cpp b/src/EcalLumiSpecWScFi_geo.cpp new file mode 100644 index 000000000..048ca9d78 --- /dev/null +++ b/src/EcalLumiSpecWScFi_geo.cpp @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (C) 2023 Aranya Giri, Simon Gardner + +/* Date : 12/12/2023 +W Scifi (EM Calorimeter) Pair Spectrometer */ + +#include "DD4hep/DetFactoryHelper.h" +#include <XML/Helper.h> +#include <algorithm> +#include <iostream> +#include <tuple> +#include <TVector3.h> + +using namespace std; +using namespace dd4hep; + +// Definition of function to build the modules +static tuple<Volume, Position> build_specScFiCAL_module(const Detector& description, const xml::Component& mod_x, SensitiveDetector& sens); + +// Driver Function +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) +{ + sens.setType("calorimeter"); + + xml_det_t x_det = e; + xml_comp_t x_mod = x_det.child( _Unicode(module) ); + string det_name = x_det.nameStr(); + int det_ID = x_det.id(); + + Material Air = description.material("Air"); + + // Create main detector element to be returned at the end + DetElement det( det_name, det_ID ); + + // Mother volume + Volume motherVol = description.pickMotherVolume( det ); + + // Detector assembly + Assembly assembly( det_name ); + assembly.setVisAttributes( description.visAttributes(x_det.attr<std::string>(_Unicode(vis))) ); + + double detSizeXY = getAttrOrDefault( x_det, _Unicode(sizeXY), 180*mm); + double detSizeZ = getAttrOrDefault( x_det, _Unicode(sizeZ), 180*mm); + int nmod_perlayer = getAttrOrDefault( x_det, _Unicode(nmod_perlayer), 3); + int nlayer = getAttrOrDefault( x_det, _Unicode(nlayer), 20); + + // Global detector position and resolution + xml_comp_t pos = x_det.position(); + xml_comp_t rot = x_det.rotation(); + + auto [modVol, modSize] = build_specScFiCAL_module(description, x_mod, sens); + + // Position of first module, layer from center of CAL + double mod_pos0 = -(detSizeXY/2.0) + (modSize.x()/2.0); + double layer_pos0 = -(detSizeZ/2.0) + (modSize.y()/2.0); + + Box layerBox ( detSizeXY/2, modSize.y()/2, detSizeXY/2 ); + Volume layerVol( "layer", layerBox, Air); + layerVol.setVisAttributes( description.visAttributes(x_mod.attr<std::string>(_Unicode(vis))) ); + + //Fill layer with modules + for(int mod_id=0; mod_id< nmod_perlayer; mod_id++){ + + //Build // to z-axis, then rotate + double mod_pos_z = 0.0*cm; + double mod_pos_y = 0.0*cm; + double mod_pos_x = mod_id*modSize.x() + mod_pos0; + + PlacedVolume modPV = layerVol.placeVolume( modVol, Position( mod_pos_x, mod_pos_y, mod_pos_z ) ); + modPV.addPhysVolID( "module", mod_id ); + }//imod-loop close + + Box sectorBox( detSizeXY/2, detSizeXY/2, detSizeZ/2 ); + Volume sectorVol( det_name+"_sector", sectorBox, Air); + sectorVol.setVisAttributes( description.visAttributes(x_mod.attr<std::string>(_Unicode(vis))) ); + + //Fill sector with layers + for(int layer_id=0; layer_id< nlayer; layer_id++){ + + double lay_pos_z = -layer_id*modSize.y() - layer_pos0; + double lay_pos_y = 0.0*cm; + double lay_pos_x = 0.0*cm; + int orientation = layer_id%2==0; + + RotationZYX lay_rot = RotationZYX( 0, 0, -90.0*degree); + if(orientation) lay_rot*=RotationY(-90.0*degree); + + PlacedVolume layPV = sectorVol.placeVolume( layerVol, Transform3D( lay_rot, Position( lay_pos_x, lay_pos_y, lay_pos_z ) ) ); + layPV.addPhysVolID( "layer", layer_id ).addPhysVolID( "orientation", orientation ); + + }//layer_id-loop close + + // loop over sectors(top, bottom) + for( xml_coll_t si(x_det, _Unicode(sector)); si; si++) { + + xml_comp_t x_sector( si ); + int sector_id = x_sector.id(); + xml_comp_t sec_pos = x_sector.position(); + xml_comp_t sec_rot = x_sector.rotation(); + + PlacedVolume secPV = assembly.placeVolume( sectorVol, Transform3D( RotationZYX(sec_rot.z(), sec_rot.y(), sec_rot.x() ), Position( sec_pos.x(), sec_pos.y(), sec_pos.z() ) ) ); + secPV.addPhysVolID( "sector", sector_id ); + }// sectors + + // Place assembly into mother volume. Assembly is centered at origin + PlacedVolume detPV = motherVol.placeVolume( assembly, Transform3D( RotationZYX( rot.z(), rot.y(), rot.x() ), Position( pos.x(), pos.y(), pos.z() ) ) ); + detPV.addPhysVolID("system", det_ID); + // Connect to system ID + det.setPlacement(detPV); + + return det; +} //Driver class close + +static tuple<Volume, Position> build_specScFiCAL_module( const Detector& description, const xml::Component& mod_x, SensitiveDetector& sens){ + + //--------------------Module Setup--------------------------------------------------------------------- + double sx = mod_x.attr<double>(_Unicode(sizex)); + double sy = mod_x.attr<double>(_Unicode(sizey)); + double sz = mod_x.attr<double>(_Unicode(sizez)); + + Position modSize(sx, sy, sz); + + Box modShape( modSize.x()/2.0, modSize.y()/2.0, modSize.z()/2.0 ); + auto modMat = description.material(mod_x.attr<std::string>(_Unicode(material))); + Volume modVol("module_vol", modShape, modMat); + + modVol.setVisAttributes(description.visAttributes(mod_x.attr<std::string>(_Unicode(vis)))); + //----------------------------Scintillating fibers ----------------------------------------------------------- + + //fibers + auto fiber_tube = mod_x.child(_Unicode(fiber)); + auto fr = fiber_tube.attr<double>(_Unicode(radius)); + auto fsx = fiber_tube.attr<double>(_Unicode(spacex)); + auto fsy = fiber_tube.attr<double>(_Unicode(spacey)); + auto fiberMat = description.material(fiber_tube.attr<std::string>(_Unicode(material))); + Tube fiberShape(0., fr, modSize.z() / 2.0); + Volume fiberVol("fiber_vol", fiberShape, fiberMat); + fiberVol.setVisAttributes(description.visAttributes(fiber_tube.attr<std::string>(_Unicode(vis)))); + fiberVol.setSensitiveDetector(sens); + + //double submod_sizexy = 2.0*fr; // size of square = diameter of tubes. + int num_submodX = int (modSize.x() / (2*fr + 2.0*fsx) ); + int num_submodY = int (modSize.y() / (2*fr + 2.0*fsy) ); + + double submod_xpos0 = -modSize.x()/2.0 + fr + fsx; + double submod_ypos0 = -modSize.y()/2.0 + fr + fsy; + int nfibers = 0; + + //Fiber Holder + auto fiberholder_x = mod_x.child(_Unicode(fiberholder)); + double fh_dz = 0.6*mm; //thickness of fiber holder + + double fh_outerbox_y = 2.0*fr + 2.0*fsy; + double fh_outerbox_x = 2.0*fr + 2.0*fsx; + Box fh_outerbox(fh_outerbox_x/2.0, fh_outerbox_y/2.0, fh_dz/2.0); + + double fh_innerbox_y = 2.0*fr; + double fh_innerbox_x = 2.0*fr; + Box fh_innerbox(fh_innerbox_x/2.0, fh_innerbox_y/2.0, fh_dz/2.0); + + SubtractionSolid fiberholder_solid(fh_outerbox, fh_innerbox, Position(0.0, 0.0,0.0)); + auto fiberholderMat = description.material(fiberholder_x.attr<std::string>(_Unicode(material))); + Volume fiberholderVol("fiberholder_vol",fiberholder_solid, fiberholderMat); + fiberholderVol.setVisAttributes(description.visAttributes(fiberholder_x.attr<std::string>(_Unicode(vis)))); + + int nfh = 0; + + //placement of fibers and fiberholder + for(int iy = 0; iy< num_submodY; iy++){ + + for(int ix=0; ix< num_submodX; ix++){ + + double submod_pos_x = submod_xpos0 + ix*(2.0*fr + 2.0*fsx); //mm + double submod_pos_y = submod_ypos0 + iy*(2.0*fr + 2.0*fsy); //mm + double submod_pos_z = 0*mm ; //mm + + //placement of fiber + auto fiberPV = modVol.placeVolume(fiberVol, nfibers++, Position{submod_pos_x, submod_pos_y, submod_pos_z}); + fiberPV.addPhysVolID("fiber_x", ix+1).addPhysVolID("fiber_y", iy+1); + + //placement of fiber holder 6.6*cm apart c-to-c + int num_holders = 4; // which means 4 regions + double fh_pos_z0 = -1*(modSize.z()/2.0) + (fh_dz/2.0); + + for(int iz=0; iz<num_holders;iz++){ + double fh_pos_z = fh_pos_z0 + iz*( (modSize.z() - fh_dz)/(num_holders-1) ); + modVol.placeVolume(fiberholderVol, nfh++, Position{submod_pos_x, submod_pos_y, fh_pos_z}); + }//iz close + + }//ix close + }//iy close + + return make_tuple(modVol, modSize); + +}// build_specScifiCAL_module function close + +DECLARE_DETELEMENT(EcalLumiSpecWScFi, create_detector) From 33f186f3a2545945b907794b9ac1921410bcc36d Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Wed, 7 Feb 2024 12:43:45 -0600 Subject: [PATCH 016/113] feat: add front support to BarrelImaging Calorimeter (#608) ### Briefly, what does this PR introduce? Adds the 0.5 cm aluminum front support ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: akshaya <99753263+AkshayaVijay@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/definitions.xml | 2 +- compact/ecal/barrel_interlayers.xml | 13 ++++++++----- src/BarrelCalorimeterImaging_geo.cpp | 27 +++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/compact/definitions.xml b/compact/definitions.xml index e8d63b29a..9cca86c2f 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -544,7 +544,7 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <constant name="EcalEndcapN_rmin" value="9.*cm"/> <!-- Currently fix value hardcoded --> <constant name="EcalEndcapN_rmax" value="63.*cm"/> <!-- Currently fix value hardcoded --> - <constant name="EcalBarrelRegion_thickness" value="38.*cm"/> + <constant name="EcalBarrelRegion_thickness" value="40.*cm"/> <constant name="EcalBarrel_rmin" value="max(81.*cm, CentralTrackingRegion_rmax + BarrelPIDRegion_thickness + BarrelExtraSpace_thickness)"/> <!-- FIXME hardcoded max --> <constant name="EcalBarrel_inner_margin" value="2*cm"/> <constant name="EcalBarrel_rmax" value="EcalBarrel_rmin + EcalBarrelRegion_thickness"/> diff --git a/compact/ecal/barrel_interlayers.xml b/compact/ecal/barrel_interlayers.xml index 7cac6d796..037f24248 100644 --- a/compact/ecal/barrel_interlayers.xml +++ b/compact/ecal/barrel_interlayers.xml @@ -30,7 +30,8 @@ <constant name="EcalBarrel_Calorimeter_offset" value="(EcalBarrel_Calorimeter_zmax - EcalBarrel_Calorimeter_zmin)/2.0"/> - <constant name="EcalBarrel_Support_thickness" value="3*cm"/> + <constant name="EcalBarrel_FrontSupportThickness" value="0.5*cm"/> + <constant name="EcalBarrel_BackSupportThickness" value="3*cm"/> <constant name="EcalBarrel_SiliconThickness" value="500*um"/> <constant name="EcalBarrel_ElectronicsThickness" value="150*um"/> <constant name="EcalBarrel_CopperThickness" value="100*um"/> @@ -68,7 +69,7 @@ <constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing * 17"/> <constant name="EcalBarrel_TotalFiberLayers_num" value="12"/> <constant name="EcalBarrel_SectorRepeat" value="EcalBarrelSectorsN"/> - <constant name="EcalBarrel_AvailThickness" value="EcalBarrelRegion_thickness - EcalBarrel_Support_thickness"/> + <constant name="EcalBarrel_AvailThickness" value="EcalBarrelRegion_thickness - EcalBarrel_BackSupportThickness - EcalBarrel_FrontSupportThickness"/> <constant name="EcalBarrel_ImagingLayerThickness" value="1.5*cm"/> @@ -145,9 +146,11 @@ </module_component> </module> + <support thickness="EcalBarrel_FrontSupportThickness" material="Aluminum" vis="EcalBarrelSupportVis"/> + <layer repeat="1" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" - space_before="0.*cm"> + space_before="EcalBarrel_FrontSupportThickness"> <barrel_envelope inner_r="EcalBarrel_rmin - EcalBarrel_Stave_thickness" outer_r="EcalBarrel_rmin + EcalBarrel_Stave_thickness" @@ -237,7 +240,7 @@ <sectors vis="EcalBarrelSectorVis"/> <layer repeat="EcalBarrelImagingLayers_num-1" vis="EcalBarrelLayerVis" space_between="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween" - space_before="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween/2."> + space_before="EcalBarrel_FrontSupportThickness + EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween/2."> <slice material="SciFiPb_PbGlue" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis"> <fiber material="SciFiPb_Scintillator" sensitive="yes" @@ -270,7 +273,7 @@ </slice> </layer> - <support thickness="EcalBarrel_Support_thickness" material="Aluminum" vis="EcalBarrelSupportVis"/> + <support thickness="EcalBarrel_BackSupportThickness" material="Aluminum" vis="EcalBarrelSupportVis"/> </detector> </detectors> diff --git a/src/BarrelCalorimeterImaging_geo.cpp b/src/BarrelCalorimeterImaging_geo.cpp index 3b3aed02b..190c14eb5 100644 --- a/src/BarrelCalorimeterImaging_geo.cpp +++ b/src/BarrelCalorimeterImaging_geo.cpp @@ -28,6 +28,10 @@ using namespace dd4hep; typedef ROOT::Math::XYPoint Point; +// geometry helpers +static void buildSupport(Detector& desc, Volume& mother, xml_comp_t x_support, + const std::tuple<double, double, double, double>& dimensions); + // barrel ecal layers contained in an assembly static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { @@ -176,8 +180,10 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) } } } - - // Loop over the sets of layer elements in the detector. + if (x_detector.hasChild(_Unicode(support))) { + buildSupport(desc, sector_volume, x_detector.child(_Unicode(support)), {inner_r, layer_pos_z, x_dimensions.z(), half_dphi}); + } + //Loop over the sets of layer elements in the detector. int layer_num = 1; for (xml_coll_t i_layer(x_detector, _U(layer)); i_layer; ++i_layer) { xml_comp_t x_layer = i_layer; @@ -399,4 +405,21 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) return sdet; } +// simple aluminum sheet cover +// dimensions: (inner r, position in z, length, phi) +static void buildSupport(Detector& desc, Volume& sector_volume, xml_comp_t x_support, + const std::tuple<double, double, double, double>& dimensions) +{ + auto [inner_r, pos_z, sector_length, hphi] = dimensions; + double support_thickness = getAttrOrDefault(x_support, _Unicode(thickness), 0.5 * cm); + auto material = desc.material(x_support.materialStr()); + double trd_y = sector_length / 2.; + double trd_x1_support = std::tan(hphi) * pos_z; + double trd_x2_support = std::tan(hphi) * (pos_z + support_thickness); + + Trapezoid s_shape(trd_x1_support, trd_x2_support, trd_y, trd_y, support_thickness / 2.); + Volume s_vol("support_layer", s_shape, material); + s_vol.setVisAttributes(desc.visAttributes(x_support.visStr())); + sector_volume.placeVolume(s_vol, Position(0.0, 0.0, pos_z + support_thickness / 2.)); +} DECLARE_DETELEMENT(epic_EcalBarrelImaging, create_detector) From 4ebc371993b985d7e8312480b0da52fbee0f7e05 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Mon, 12 Feb 2024 11:03:40 -0500 Subject: [PATCH 017/113] Remove stuff from compact/unused (#632) Removes some dead code Resolves: #630 --- .../unused/ecal_backward_crystal_glass.xml | 103 --------- compact/unused/ecal_barrel_hybrid.xml | 155 ------------- compact/unused/ecal_forward_homogenous.xml | 59 ----- compact/unused/ecal_forward_shashlik.xml | 77 ------- compact/unused/gaseous_rich.xml | 75 ------ compact/unused/mm_tracker_barrel.xml | 80 ------- compact/unused/rwell_tracker_barrel.xml | 213 ----------------- compact/unused/tracking_config_mgpds.xml | 23 -- src/CylinderTrackerBarrel_geo.cpp | 194 ---------------- src/GaseousRICH_geo.cpp | 217 ------------------ src/ShashlikCalorimeter_geo.cpp | 188 --------------- 11 files changed, 1384 deletions(-) delete mode 100644 compact/unused/ecal_backward_crystal_glass.xml delete mode 100644 compact/unused/ecal_barrel_hybrid.xml delete mode 100644 compact/unused/ecal_forward_homogenous.xml delete mode 100644 compact/unused/ecal_forward_shashlik.xml delete mode 100644 compact/unused/gaseous_rich.xml delete mode 100644 compact/unused/mm_tracker_barrel.xml delete mode 100644 compact/unused/rwell_tracker_barrel.xml delete mode 100644 compact/unused/tracking_config_mgpds.xml delete mode 100644 src/CylinderTrackerBarrel_geo.cpp delete mode 100644 src/GaseousRICH_geo.cpp delete mode 100644 src/ShashlikCalorimeter_geo.cpp diff --git a/compact/unused/ecal_backward_crystal_glass.xml b/compact/unused/ecal_backward_crystal_glass.xml deleted file mode 100644 index 9fdf26b1e..000000000 --- a/compact/unused/ecal_backward_crystal_glass.xml +++ /dev/null @@ -1,103 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Chao Peng, Wouter Deconinck, Dmitry Romanov, Whitney Armstrong --> - -<lccdd> - <define> - <constant name="CrystalModule_sx" value="20.00*mm"/> - <constant name="CrystalModule_sy" value="20.00*mm"/> - <constant name="CrystalModule_sz" value="200.00*mm"/> - <constant name="CrystalModule_wrap" value="0.50*mm"/> - <constant name="GlassModule_sx" value="40.00*mm"/> - <constant name="GlassModule_sy" value="40.00*mm"/> - <constant name="GlassModule_sz" value="400.00*mm"/> - <constant name="GlassModule_wrap" value="1.00*mm"/> - <constant name="CrystalModule_z0" value="10.*cm"/> - <constant name="GlassModule_z0" value="0.0*cm"/> - <constant name="EcalEndcapN_z0" value="-EcalEndcapN_zmin-max(CrystalModule_sz,GlassModule_sz)/2."/> - <constant name="CrystalModule_dx" value="CrystalModule_sx + CrystalModule_wrap"/> - <constant name="CrystalModule_dy" value="CrystalModule_sy + CrystalModule_wrap"/> - <constant name="GlassModule_dx" value="GlassModule_sx + GlassModule_wrap"/> - <constant name="GlassModule_dy" value="GlassModule_sy + GlassModule_wrap"/> - </define> - <detectors> - <comment> </comment> - <documentation level="10"> - #### Backwards Endcap EM Calorimeter - - Backwards Endcap EM Calorimeter, placements generated by script - </documentation> - <detector id="ECalEndcapN_ID" name="EcalEndcapN" type="epic_HomogeneousCalorimeter" readout="EcalEndcapNHits"> - <position x="0" y="0" z="EcalEndcapN_z0"/> - <rotation x="0" y="0" z="0"/> - <placements> - <lines sector="1" mirrorx="true" mirrory="true"> - <module sizex="CrystalModule_sx" sizey="CrystalModule_sy" sizez="CrystalModule_sz" material="PbWO4" vis="EcalEndcapNModuleVis"/> - <wrapper thickness="CrystalModule_wrap" material="Epoxy" vis="InvisibleWithDaughters"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*1/2." z="CrystalModule_z0" begin="5" nmods="21"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*3/2." z="CrystalModule_z0" begin="5" nmods="21"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*5/2." z="CrystalModule_z0" begin="5" nmods="21"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*7/2." z="CrystalModule_z0" begin="4" nmods="22"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*9/2." z="CrystalModule_z0" begin="3" nmods="23"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*11/2." z="CrystalModule_z0" begin="0" nmods="26"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*13/2." z="CrystalModule_z0" begin="0" nmods="24"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*15/2." z="CrystalModule_z0" begin="0" nmods="24"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*17/2." z="CrystalModule_z0" begin="0" nmods="24"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*19/2." z="CrystalModule_z0" begin="0" nmods="24"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*21/2." z="CrystalModule_z0" begin="0" nmods="24"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*23/2." z="CrystalModule_z0" begin="0" nmods="24"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*25/2." z="CrystalModule_z0" begin="0" nmods="22"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*27/2." z="CrystalModule_z0" begin="0" nmods="22"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*29/2." z="CrystalModule_z0" begin="0" nmods="20"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*31/2." z="CrystalModule_z0" begin="0" nmods="20"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*33/2." z="CrystalModule_z0" begin="0" nmods="18"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*35/2." z="CrystalModule_z0" begin="0" nmods="18"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*37/2." z="CrystalModule_z0" begin="0" nmods="16"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*39/2." z="CrystalModule_z0" begin="0" nmods="16"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*41/2." z="CrystalModule_z0" begin="0" nmods="14"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*43/2." z="CrystalModule_z0" begin="0" nmods="14"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*45/2." z="CrystalModule_z0" begin="0" nmods="12"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*47/2." z="CrystalModule_z0" begin="0" nmods="12"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*49/2." z="CrystalModule_z0" begin="0" nmods="6"/> - <line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*51/2." z="CrystalModule_z0" begin="0" nmods="6"/> - </lines> - <lines sector="2" mirrorx="true" mirrory="true"> - <module sizex="GlassModule_sx" sizey="GlassModule_sy" sizez="GlassModule_sz" material="PbGlass" vis="EcalEndcapNModuleVis"/> - <wrapper thickness="GlassModule_wrap" material="Epoxy" vis="InvisibleWithDaughters"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*1/2." z="GlassModule_z0" begin="13" nmods="10"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*3/2." z="GlassModule_z0" begin="13" nmods="10"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*5/2." z="GlassModule_z0" begin="13" nmods="10"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*7/2." z="GlassModule_z0" begin="12" nmods="10"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*9/2." z="GlassModule_z0" begin="12" nmods="10"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*11/2." z="GlassModule_z0" begin="12" nmods="10"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*13/2." z="GlassModule_z0" begin="11" nmods="11"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*15/2." z="GlassModule_z0" begin="10" nmods="11"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*17/2." z="GlassModule_z0" begin="9" nmods="12"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*19/2." z="GlassModule_z0" begin="8" nmods="13"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*21/2." z="GlassModule_z0" begin="7" nmods="13"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*23/2." z="GlassModule_z0" begin="6" nmods="14"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*25/2." z="GlassModule_z0" begin="3" nmods="16"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*27/2." z="GlassModule_z0" begin="0" nmods="18"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*29/2." z="GlassModule_z0" begin="0" nmods="18"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*31/2." z="GlassModule_z0" begin="0" nmods="16"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*33/2." z="GlassModule_z0" begin="0" nmods="16"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*35/2." z="GlassModule_z0" begin="0" nmods="14"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*37/2." z="GlassModule_z0" begin="0" nmods="13"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*39/2." z="GlassModule_z0" begin="0" nmods="11"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*41/2." z="GlassModule_z0" begin="0" nmods="10"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*43/2." z="GlassModule_z0" begin="0" nmods="7"/> - <line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*45/2." z="GlassModule_z0" begin="0" nmods="3"/> - </lines> - </placements> - </detector> - </detectors> - <readouts> - <comment>Effectively no segmentation, the segmentation is used to provide cell dimension info</comment> - <readout name="EcalEndcapNHits"> - <segmentation type="MultiSegmentation" key="sector"> - <segmentation name="CrystalSeg" key_value="1" type="CartesianGridXY" grid_size_x="CrystalModule_dx" grid_size_y="CrystalModule_dy"/> - <segmentation name="GlassSeg" key_value="2" type="CartesianGridXY" grid_size_x="GlassModule_dx" grid_size_y="GlassModule_dy"/> - </segmentation> - <id>system:8,sector:4,module:20,x:32:-16,y:-16</id> - </readout> - </readouts> -</lccdd> diff --git a/compact/unused/ecal_barrel_hybrid.xml b/compact/unused/ecal_barrel_hybrid.xml deleted file mode 100644 index bd90de65b..000000000 --- a/compact/unused/ecal_barrel_hybrid.xml +++ /dev/null @@ -1,155 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Whitney Armstrong, Maria Zurek, Jihee Kim --> - -<lccdd> - - <display> - <vis name="EcalBarrelEnvelope_vis" alpha="0.9" r="0.99" g="0.5" b="0" showDaughters="true" visible="false" /> - <vis name="EcalBarrelStave_vis" alpha="0.9" r="0.99" g="0.5" b="0" showDaughters="true" visible="false" /> - <vis name="EcalBarrelFiberLayerVis" alpha="1.0" r="102/256" g="102/256" b="102/256" showDaughters="false" visible="true" /> - <vis name="EcalBarrelFiberVis" alpha="1.0" r="0/256" g="130/256" b="202/256" showDaughters="false" visible="false" /> - </display> - <define> - <comment> - --------------------------------------- - EM Calorimeter Parameters with AstroPix - --------------------------------------- - </comment> - <constant name="EcalBarrel_Support_thickness" value="5*cm"/> - <constant name="EcalBarrel_SiliconThickness" value="500*um"/> - <constant name="EcalBarrel_ElectronicsThickness" value="150*um"/> - <constant name="EcalBarrel_CopperThickness" value="100*um"/> - <constant name="EcalBarrel_KaptonThickness" value="200*um"/> - <constant name="EcalBarrel_EpoxyThickness" value="100*um"/> - <constant name="EcalBarrel_CarbonThickness" value="0.5*mm"/> - <constant name="EcalBarrel_CarbonSpacerWidth" value="4*mm"/> - <constant name="EcalBarrel_LayerSpacing" value="6.0*mm"/> - <constant name="EcalBarrel_FiberRadius" value="0.5*mm"/> - <constant name="EcalBarrel_FiberXSpacing" value="1.34*mm"/> - <constant name="EcalBarrel_FiberZSpacing" value="1.22*mm"/> - <comment> - For Pb/SiFi (GlueX): X0 ~ 1.45 cm - For W/SiFi (sPHENIX): X0 ~ 0.7 cm (but different fiber orientation) - </comment> - <constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing*12"/> - <constant name="EcalBarrel_ModRepeat" value="EcalBarrelSectorsN"/> - <constant name="EcalBarrel_ModLength" value="0.5*m"/> - <constant name="EcalBarrel_ModWidth" value="0.5*m"/> - <constant name="EcalBarrel_AvailThickness" value="EcalBarrelEnvelope_thickness-EcalBarrel_Support_thickness"/> - <constant name="EcalBarrel_ImagingLayerThickness" - value="EcalBarrel_SiliconThickness - + EcalBarrel_ElectronicsThickness - + EcalBarrel_CopperThickness - + EcalBarrel_KaptonThickness - + EcalBarrel_EpoxyThickness - + EcalBarrel_CarbonThickness - + EcalBarrel_LayerSpacing - + EcalBarrel_RadiatorThickness"/> - - <constant name="EcalBarrelImagingLayers_max" value="6"/> - <constant name="EcalBarrelImagingLayers" value="min(EcalBarrelImagingLayers_max, floor(EcalBarrel_AvailThickness/EcalBarrel_ImagingLayerThickness))"/> - <constant name="EcalBarrel_FiberLayerThickness_max" value="max(0, EcalBarrel_AvailThickness-(EcalBarrelImagingLayers*EcalBarrel_ImagingLayerThickness-EcalBarrel_RadiatorThickness))"/> - <constant name="EcalBarrel_FiberLayerThickness" value="EcalBarrel_FiberZSpacing*12*15"/> - </define> - - <limits> - </limits> - - <regions> - </regions> - - <display> - </display> - - <detectors> - - <comment> - --------------------- - Barrel EM Calorimeter - --------------------- - A layered EM calorimeter with tungsten and silicon (AstroPix) - </comment> - <detector - id="ECalBarrel_ID" - name="EcalBarrel" - type="epic_EcalBarrelHybrid" - readout="EcalBarrelHits" - calorimeterType="EM_BARREL" - vis="EcalBarrelEnvelope_vis" - offset="EcalBarrel_offset"> - <dimensions numsides="EcalBarrel_ModRepeat" - rmin="EcalBarrel_rmin" - z="EcalBarrel_length"/> - <staves vis="EcalBarrelStave_vis"> - <support inside="true" material="Steel235" vis="AnlOrange" - thickness="EcalBarrel_Support_thickness" - n_beams="3" grid_size="25.0*cm" > - </support> - </staves> - <comment> - --------------------------- - Imaging layers with silicon - --------------------------- - </comment> - <layer repeat="EcalBarrelImagingLayers-1" vis="AnlBlue"> - <slice material="Silicon" thickness="EcalBarrel_SiliconThickness" sensitive="yes" limits="cal_limits" vis="AnlGray"/> - <slice material="Silicon" thickness="EcalBarrel_ElectronicsThickness" vis="AnlGold"/> - <slice material="Copper" thickness="EcalBarrel_CopperThickness" vis="AnlGray"/> - <slice material="Kapton" thickness="EcalBarrel_KaptonThickness" vis="AnlGold"/> - <slice material="Epoxy" thickness="EcalBarrel_EpoxyThickness" vis="AnlGray"/> - <slice material="CarbonFiber" thickness="EcalBarrel_CarbonThickness" vis="AnlGold"/> - <slice material="Lead" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFibersVis"> - <fiber material="PlasticScint" - sensitive="yes" - vis="EcalBarrelFiberVis" - radius="EcalBarrel_FiberRadius" - spacing_x="EcalBarrel_FiberXSpacing" - spacing_z="EcalBarrel_FiberZSpacing"/> - </slice> - <slice material="CarbonFiber" thickness="EcalBarrel_CarbonThickness" vis="AnlGold"/> - <slice material="Air" thickness="EcalBarrel_LayerSpacing" vis="AnlGold"/> - </layer> - <comment> - --------------------------- - Last imiging layer with thick scint fiber layer - --------------------------- - </comment> - <layer repeat="1" vis="AnlBlue"> - <slice material="Silicon" thickness="EcalBarrel_SiliconThickness" sensitive="yes" limits="cal_limits" vis="AnlGray"/> - <slice material="Silicon" thickness="EcalBarrel_ElectronicsThickness" vis="AnlGold"/> - <slice material="Copper" thickness="EcalBarrel_CopperThickness" vis="AnlGray"/> - <slice material="Kapton" thickness="EcalBarrel_KaptonThickness" vis="AnlGold"/> - <slice material="Epoxy" thickness="EcalBarrel_EpoxyThickness" vis="AnlGray"/> - <slice material="CarbonFiber" thickness="EcalBarrel_CarbonThickness" vis="AnlGold"/> - <slice material="Lead" thickness="min(EcalBarrel_FiberLayerThickness_max, EcalBarrel_FiberLayerThickness)" - vis="EcalBarrelFiberLayerVis"> - <fiber material="PlasticScint" - sensitive="yes" - vis="EcalBarrelFiberVis" - radius="EcalBarrel_FiberRadius" - spacing_x="EcalBarrel_FiberXSpacing" - spacing_z="EcalBarrel_FiberZSpacing"> - </fiber> - </slice> - </layer> - - </detector> - </detectors> - - <readouts> - <readout name="EcalBarrelHits"> - <segmentation type="MultiSegmentation" key="fiber"> - <segmentation name="LongiSeg" key_value="0x0" type="CartesianGridXY" grid_size_x="0.5*mm" grid_size_y="0.5*mm"/> - <segmentation name="RadialSeg" key_min="0x1" key_max="0xffffffff" type="NoSegmentation"/> - </segmentation> - <hits_collections> - <hits_collection name="EcalBarrelHits" key="fiber" key_value="0x0"/> - <hits_collection name="EcalBarrelScFiHits" key="fiber" key_min="0x1" key_max="0xffffffff"/> - </hits_collections> - <id>system:8,module:5,layer:4,slice:4,grid:9,fiber:9,x:39:-11,y:-14</id> - </readout> - </readouts> - - - -</lccdd> diff --git a/compact/unused/ecal_forward_homogenous.xml b/compact/unused/ecal_forward_homogenous.xml deleted file mode 100644 index 4d88d1a6c..000000000 --- a/compact/unused/ecal_forward_homogenous.xml +++ /dev/null @@ -1,59 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Whitney Armstrong, Chao Peng, Sylvester Joosten --> - -<lccdd> - <comment> - Simplified homogenous implementation of the forward ScFi calorimeter - </comment> - - <define> - <constant name="EcalEndcapP_FiberRadius" value="0.235*cm"/> - <constant name="EcalEndcapP_FiberOffset" value="0.5*mm"/> - <constant name="EcalEndcapP_FiberSpaceX" value="0.265*mm"/> - <constant name="EcalEndcapP_FiberSpaceY" value="0.425*mm"/> - </define> - - - <limits> - </limits> - - <regions> - </regions> - - <!-- Common Generic visualization attributes --> - <comment>Common Generic visualization attributes</comment> - <display> - </display> - - <detectors> - - <comment> - ------------------------------------------ - Forward (Positive Z) Endcap EM Calorimeter - ------------------------------------------ - An EM calorimeter with ScFi modules - </comment> - <detector id="ECalEndcapP_ID" - name="EcalEndcapP" - type="epic_ScFiCalorimeter" - vis="EcalEndcapVis" - readout="EcalEndcapPHits"> - <position x="0" y="0" z="EcalEndcapP_zmin + EcalEndcapP_length/2."/> - <dimensions rmin="EcalEndcapP_rmin" rmax="EcalEndcapP_rmax" length="EcalEndcapP_length"/> - <module sizex="25*mm" sizey="25*mm" sizez="170*mm" material="AvgTungstenScFi" vis="EcalEndcapBlockVis"> - </module> - </detector> - </detectors> - - <!-- Definition of the readout segmentation/definition --> - <readouts> - <readout name="EcalEndcapPHits"> - <segmentation type="NoSegmentation"/> - <id>system:8,ring:8,module:20,fiber_x:8,fiber_y:8</id> - </readout> - </readouts> - - <plugins> - </plugins> - -</lccdd> diff --git a/compact/unused/ecal_forward_shashlik.xml b/compact/unused/ecal_forward_shashlik.xml deleted file mode 100644 index b28af9a76..000000000 --- a/compact/unused/ecal_forward_shashlik.xml +++ /dev/null @@ -1,77 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Whitney Armstrong, Chao Peng --> - -<lccdd> - <define> - </define> - - - <limits> - </limits> - - <regions> - </regions> - - <!-- Common Generic visualization attributes --> - <comment>Common Generic visualization attributes</comment> - <display> - </display> - - <detectors> - - <comment> - ------------------------------------------ - Forward (Positive Z) Endcap EM Calorimeter - ------------------------------------------ - An EM calorimeter with shashlik hexagon modules - </comment> - <detector id="ECalEndcapP_ID" - name="EcalEndcapP" - type="epic_ShashlikCalorimeter" - readout="EcalEndcapPHits"> - <position x="0" y="0" z="EcalEndcapP_zmin"/> - <placements> - <disk rmin="EcalEndcapP_rmin" rmax = "EcalEndcapP_rmax" sector="1"> - <wrapper thickness="2*mm" material="Epoxy" vis="WhiteVis"/> - <module shape="square" side_length="50*mm" vis="EcalEndcapVis"> - <layer repeat="EcalEndcapPLayer1_NRepeat" vis="EcalEndcapVis"> - <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/> - <slice material="Copper" thickness="EcalCopperThickness"/> - <slice material="Kapton" thickness="EcalKaptonThickness"/> - <slice material="Air" thickness="EcalAir1Thickness"/> - </layer> - <layer repeat="EcalEndcapPLayer2_NRepeat"> - <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/> - <slice material="Air" thickness="EcalAir2Thickness"/> - <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/> - <slice material="Copper" thickness="EcalCopperThickness"/> - <slice material="Kapton" thickness="EcalKaptonThickness"/> - <slice material="Air" thickness="EcalAir1Thickness"/> - </layer> - <layer repeat="EcalEndcapPLayer3_NRepeat"> - <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/> - <slice material="Air" thickness="EcalAir2Thickness"/> - <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/> - <slice material="Copper" thickness="EcalCopperThickness"/> - <slice material="Kapton" thickness="EcalKaptonThickness"/> - <slice material="Air" thickness="EcalAir1Thickness"/> - </layer> - </module> - </disk> - </placements> - </detector> - </detectors> - - <!-- Definition of the readout segmentation/definition --> - <readouts> - <readout name="EcalEndcapPHits"> - <segmentation type="NoSegmentation"/> - <id>system:8,sector:4,module:24,layer:8,slice:8</id> - </readout> - </readouts> - - <plugins> - </plugins> - - -</lccdd> diff --git a/compact/unused/gaseous_rich.xml b/compact/unused/gaseous_rich.xml deleted file mode 100644 index db3b2bc17..000000000 --- a/compact/unused/gaseous_rich.xml +++ /dev/null @@ -1,75 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Chao Peng, Whitney Armstrong --> - -<lccdd> - <define> - <constant name="ForwardRICH_zmin" value="BarrelTracking_length/2.0 + ForwardTracking_length "/> - <constant name="ForwardRICH_rmin" value="ForwardPID_rmin1"/> - <constant name="ForwardRICH_rmax0" value="TrackerBarrel_rmax"/> - <constant name="ForwardRICH_rmax1" value="EcalBarrel_rmin"/> - <constant name="ForwardRICH_rmax2" value="Solenoid_rmin-6*cm"/> - <constant name="ForwardRICHDepth" value="0.9*m"/> - <constant name="ForwardRICH_sensor_rmin" value="ForwardRICH_rmax1 - 40.*cm"/> - <constant name="ForwardRICH_sensor_rmax" value="ForwardRICH_rmax2"/> - </define> - - <detectors> - <detector - id="ForwardRICH_ID" - name="GaseousRICH" - type="epic_GaseousRICH" - readout="ForwardRICHHits" - gas="N2cherenkov" - vis="RICHVis"> - <dimensions - z0="ForwardRICH_zmin" - snout_length="ForwardRICH_length - ForwardRICHDepth" - length="ForwardRICH_length" - rmin="ForwardRICH_rmin" - rmax0="ForwardRICH_rmax0" - rmax1="ForwardRICH_rmax1" - rmax2="ForwardRICH_rmax2"/> - <mirrors thickness="1*mm" material="PyrexGlass" vis="GrayVis"> - <position z="ForwardRICH_length - 13*cm"/> - <mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree" - rotz="0*degree" roty="-15*degree" rotx="0"/> - <mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree" - rotz="60*degree" roty="-15*degree" rotx="0"/> - <mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree" - rotz="120*degree" roty="-15*degree" rotx="0"/> - <mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree" - rotz="180*degree" roty="-15*degree" rotx="0"/> - <mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree" - rotz="240*degree" roty="-15*degree" rotx="0"/> - <mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree" - rotz="300*degree" roty="-15*degree" rotx="0"/> - </mirrors> - <sensors> - <module sx="10*cm" sy="10*cm" sz="1.0*cm" gap="0.2*cm" material="Quartz" vis="AnlGold"/> - <comment>A thin optical material to accept optical photon in simulation</comment> - <optical material="AirOptical" thickness="0.1*mm"/> - <position z="8.*cm"/> - <sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree" - rotz="0*degree" roty="-15*degree" rotx="0"/> - <sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree" - rotz="60*degree" roty="-15*degree" rotx="0"/> - <sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree" - rotz="120*degree" roty="-15*degree" rotx="0"/> - <sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree" - rotz="180*degree" roty="-15*degree" rotx="0"/> - <sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree" - rotz="240*degree" roty="-15*degree" rotx="0"/> - <sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree" - rotz="300*degree" roty="-15*degree" rotx="0"/> - </sensors> - </detector> - </detectors> - - <readouts> - <readout name="ForwardRICHHits"> - <segmentation type="CartesianGridXY" grid_size_x="3*mm" grid_size_y="3*mm" /> - <id>system:8,sector:8,module:16,x:32:-16,y:-16</id> - </readout> - </readouts> - -</lccdd> diff --git a/compact/unused/mm_tracker_barrel.xml b/compact/unused/mm_tracker_barrel.xml deleted file mode 100644 index 22d0e3870..000000000 --- a/compact/unused/mm_tracker_barrel.xml +++ /dev/null @@ -1,80 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Whitney Armstrong, Jihee Kim --> - -<lccdd> - - <comment>Micromegas tracker barrel</comment> - - <define> - - <constant name="MMTrackerBarrel_thickness" value="TrackerBarrel_rmax - TrackerBarrel_rmax"/> - <constant name="MMTrackerBarrel_NLayers" value="5"/> - <constant name="MMTrackerBarrel_delta" value="MMTrackerBarrel_thickness/MMTrackerBarrel_NLayers"/> - - <constant name="MMTrackerBarrelLayer1_rmin" value="800.0 * mm"/> - <constant name="MMTrackerBarrelLayer1_length" value="100.0 * mm"/> - <constant name="MMTrackerBarrelLayer1_thickness" value="10.0 * mm"/> - <constant name="MMTrackerBarrel_NZModules" value="floor(BarrelTracking_length/MMTrackerBarrelLayer1_length)"/> - <constant name="MMTrackerBarrelModulesTotal_length" value="MMTrackerBarrel_NZModules*MMTrackerBarrelLayer1_length"/> - - </define> - - <limits> - </limits> - - <regions> - </regions> - - <display> - </display> - - <detectors> - <detector id="MMTrackerBarrel_ID" name="MMTrackerBarrel" type="epic_MMTrackerBarrel" readout="MMTrackerBarrelHits"> - <module name="Module1" vis="AnlGold"> - <module_envelope rmin="TrackerBarrel_rmax" length="MMTrackerBarrelLayer1_length" thickness="MMTrackerBarrel_delta" - phi="90*degree" /> - <module_component thickness="1.0*mm" material="PEEK" sensitive="false"> - <position x="0" /> - </module_component> - <module_component thickness="1.0*mm" material="PEEK" sensitive="false" - length="MMTrackerBarrelLayer1_length-10.0*mm" - phi="89.0*degree" > - <position x="0" /> - </module_component> - </module> - <layer module="Module1" id="1" vis="GreenVis"> - <barrel_envelope - inner_r="MMTrackerBarrelLayer1_rmin-20.0*mm" - outer_r="MMTrackerBarrelLayer1_rmin + 20.0*mm" - z_length="MMTrackerBarrelModulesTotal_length" /> - <comment> - phi0 : Starting phi of first module. - phi_tilt : Phi tilt of a module. - rc : Radius of the module center. - nphi : Number of modules in phi. - rphi_dr : The delta radius of every other module. - z0 : Z position of first module in phi. - nz : Number of modules to place in z. - dr : Radial displacement parameter, of every other module. - </comment> - <rphi_layout phi_tilt="0.0" nphi="4" phi0="0." rc="MMTrackerBarrelLayer1_rmin" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-MMTrackerBarrelModulesTotal_length/2.0 + MMTrackerBarrelLayer1_length/2.0" - nz="MMTrackerBarrel_NZModules"/> - </layer> - </detector> - - </detectors> - - <readouts> - <readout name="MMTrackerBarrelHits"> - <segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" /> - <id>system:8,sector:8,module:14,x:32:-16,y:-16</id> - </readout> - </readouts> - - <plugins> - </plugins> - - <fields> - </fields> -</lccdd> diff --git a/compact/unused/rwell_tracker_barrel.xml b/compact/unused/rwell_tracker_barrel.xml deleted file mode 100644 index 664d1eba4..000000000 --- a/compact/unused/rwell_tracker_barrel.xml +++ /dev/null @@ -1,213 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Zhenyu Ye --> - -<lccdd> - - <comment>RWell tracker barrel based on Fun4All implementation https://www.dropbox.com/sh/j4n4g5h80g9tai6/AAAzmXSHRGQCShoSiewe6HCDa?dl=0 Where the detector is constructed in the G4_RWell.C and Build_G4_RWell_Sup01.C files - original R=(78.67, 90.0)cm, - DirftGap=(0.4, 0.4)cm, - Length=(200, 200)cm - kapton_thickness = 0.0175; //cm - cu_thickness = 0.002; //cm - prepreg_thickness = 0.005; //cm - pcb_thickness = 0.010; //cm - //inner tube - support_01_thickness = 0.50; - support_01_length = 7.2; - //inner ring - support_02_thickness = 1.6; - support_02_length = 1.2; - //outer ring - support_03_thickness = 0.50; - support_03_length = 1.2; - - Length=TrackerBarrelOuter_length=(160, 160) cm // to avoid conflict with GEM tracker - TODO: fix GEM geometry and restore length - </comment> - - <define> - <constant name="RWellTrackerBarrel_length" value="BarrelTracking_length"/> - <constant name="RWellTrackerBarrel_NZModules" value="1"/> - <constant name="RWellTrackerBarrel_NZSupport" value="2"/> - - <constant name="RWellTrackerBarrel_Kapton_thickness" value="175.0*um"/> - <constant name="RWellTrackerBarrel_Gas_thickness" value="4.0*mm"/> - <constant name="RWellTrackerBarrel_Cu_thickness" value="20.0*um"/> - <constant name="RWellTrackerBarrel_Prepreg_thickness" value="50.0*um"/> - <constant name="RWellTrackerBarrel_Pcb_thickness" value="0.1*mm"/> - - <constant name="RWellTrackerBarrelLayer1_length" value="RWellTrackerBarrel_length"/> - <constant name="RWellTrackerBarrelLayer1_gas_rmin" value="786.7 * mm"/> - <constant name="RWellTrackerBarrelLayer1_rmin" value="RWellTrackerBarrelLayer1_gas_rmin - RWellTrackerBarrel_Kapton_thickness"/> - <constant name="RWellTrackerBarrelLayer1_thickness" value="RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness + RWellTrackerBarrel_Cu_thickness + RWellTrackerBarrel_Prepreg_thickness + RWellTrackerBarrel_Pcb_thickness"/> - - <constant name="RWellTrackerBarrelLayer2_length" value="RWellTrackerBarrel_length"/> - <constant name="RWellTrackerBarrelLayer2_gas_rmin" value="900.0 * mm"/> - <constant name="RWellTrackerBarrelLayer2_rmin" value="RWellTrackerBarrelLayer2_gas_rmin - RWellTrackerBarrel_Kapton_thickness"/> - <constant name="RWellTrackerBarrelLayer2_thickness" value="RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness + RWellTrackerBarrel_Cu_thickness + RWellTrackerBarrel_Prepreg_thickness + RWellTrackerBarrel_Pcb_thickness"/> - - <constant name="RWellTrackerBarrel_STube_thickness" value="0.5*cm"/> - <constant name="RWellTrackerBarrel_STube_length" value="7.2*cm"/> - <constant name="RWellTrackerBarrel_IRing_thickness" value="1.6*cm"/> - <constant name="RWellTrackerBarrel_IRing_length" value="1.2*cm"/> - <constant name="RWellTrackerBarrel_ORing_thickness" value="0.5*cm"/> - <constant name="RWellTrackerBarrel_ORing_length" value="1.2*cm"/> - <constant name="RWellTrackerBarrelLayer1_support_rmin" value="RWellTrackerBarrelLayer1_rmin + RWellTrackerBarrelLayer1_thickness"/> - <constant name="RWellTrackerBarrelLayer2_support_rmin" value="RWellTrackerBarrelLayer2_rmin + RWellTrackerBarrelLayer2_thickness"/> - </define> - - <limits> - </limits> - - <regions> - </regions> - - <display> - </display> - - <detectors> - <detector id="RWellTrackerBarrel_ID" name="RWellTrackerBarrel" type="epic_RWellTrackerBarrel" readout="RWellTrackerBarrelHits"> - - <module name="Module1" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer1_rmin" thickness="RWellTrackerBarrelLayer1_thickness" length="RWellTrackerBarrelLayer1_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer1_rmin" thickness="RWellTrackerBarrel_Kapton_thickness" material="Kapton" name="entrance_window" sensitive="false"/> - <module_component rmin="RWellTrackerBarrelLayer1_rmin + RWellTrackerBarrel_Kapton_thickness" thickness="RWellTrackerBarrel_Gas_thickness" material="Ar10CO2" name="drift region" sensitive="true"/> - <module_component rmin="RWellTrackerBarrelLayer1_rmin + RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness" thickness="RWellTrackerBarrel_Cu_thickness" material="Copper" name="Cu" sensitive="false"/> - <module_component rmin="RWellTrackerBarrelLayer1_rmin + RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness + RWellTrackerBarrel_Cu_thickness" thickness="RWellTrackerBarrel_Prepreg_thickness" material="Nomex" name="Prepreg" sensitive="false"/> - <module_component rmin="RWellTrackerBarrelLayer1_rmin + RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness + RWellTrackerBarrel_Cu_thickness + RWellTrackerBarrel_Prepreg_thickness" thickness="RWellTrackerBarrel_Pcb_thickness" material="Fr4" name="Pcb" sensitive="false"/> - </module> - - <module name="Module1_STube" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer1_support_rmin" thickness="RWellTrackerBarrel_STube_thickness" length="RWellTrackerBarrel_STube_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer1_support_rmin" thickness="RWellTrackerBarrel_STube_thickness" material="Cfrp_intt" name="support_tube" sensitive="false"/> - </module> - <module name="Module1_IRing" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness" thickness="RWellTrackerBarrel_IRing_thickness" length="RWellTrackerBarrel_IRing_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness" thickness="RWellTrackerBarrel_IRing_thickness" material="Cfrp_intt" name="support_inner_ring" sensitive="false"/> - </module> - <module name="Module1_ORing" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" thickness="RWellTrackerBarrel_ORing_thickness" length="RWellTrackerBarrel_ORing_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" thickness="RWellTrackerBarrel_ORing_thickness" material="Cfrp_intt" name="support_outer_ring" sensitive="false"/> - </module> - - <module name="Module2" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer2_rmin" thickness="RWellTrackerBarrelLayer2_thickness" length="RWellTrackerBarrelLayer2_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer2_rmin" thickness="RWellTrackerBarrel_Kapton_thickness" material="Kapton" name="entrance_window" sensitive="false"/> - <module_component rmin="RWellTrackerBarrelLayer2_rmin + RWellTrackerBarrel_Kapton_thickness" thickness="RWellTrackerBarrel_Gas_thickness" material="Ar10CO2" name="drift region" sensitive="true"/> - <module_component rmin="RWellTrackerBarrelLayer2_rmin + RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness" thickness="RWellTrackerBarrel_Cu_thickness" material="Copper" name="Cu" sensitive="false"/> - <module_component rmin="RWellTrackerBarrelLayer2_rmin + RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness + RWellTrackerBarrel_Cu_thickness" thickness="RWellTrackerBarrel_Prepreg_thickness" material="Nomex" name="Prepreg" sensitive="false"/> - <module_component rmin="RWellTrackerBarrelLayer2_rmin + RWellTrackerBarrel_Kapton_thickness + RWellTrackerBarrel_Gas_thickness + RWellTrackerBarrel_Cu_thickness + RWellTrackerBarrel_Pcb_thickness" thickness="RWellTrackerBarrel_Pcb_thickness" material="Fr4" name="Pcb" sensitive="false"/> - </module> - - <module name="Module2_STube" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer2_support_rmin" thickness="RWellTrackerBarrel_STube_thickness" length="RWellTrackerBarrel_STube_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer2_support_rmin" thickness="RWellTrackerBarrel_STube_thickness" material="Cfrp_intt" name="support_tube" sensitive="false"/> - </module> - <module name="Module2_IRing" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness" thickness="RWellTrackerBarrel_IRing_thickness" length="RWellTrackerBarrel_IRing_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness" thickness="RWellTrackerBarrel_IRing_thickness" material="Cfrp_intt" name="support_inner_ring" sensitive="false"/> - </module> - <module name="Module2_ORing" vis="GreenVis"> - <module_envelope - rmin="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" thickness="RWellTrackerBarrel_ORing_thickness" length="RWellTrackerBarrel_ORing_length" phi="360*degree" /> - <module_component rmin="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" thickness="RWellTrackerBarrel_ORing_thickness" material="Cfrp_intt" name="support_outer_ring" sensitive="false"/> - </module> - - <layer module="Module1" id="1" vis="GreenVis"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer1_rmin" - outer_r="RWellTrackerBarrelLayer1_rmin + RWellTrackerBarrelLayer1_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer1_rmin" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrelLayer1_length/2.0" - nz="RWellTrackerBarrel_NZModules"/> - </layer> - <layer module="Module1_STube" id="2" vis="InvisibleWithDaughters"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer1_support_rmin" - outer_r="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer1_support_rmin" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrel_STube_length/2.0" - nz="RWellTrackerBarrel_NZSupport"/> - </layer> - <layer module="Module1_IRing" id="3" vis="InvisibleWithDaughters"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness" - outer_r="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrel_IRing_length/2.0" - nz="RWellTrackerBarrel_NZSupport"/> - </layer> - <layer module="Module1_ORing" id="4" vis="InvisibleWithDaughters"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" - outer_r="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness + RWellTrackerBarrel_ORing_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer1_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrel_ORing_length/2.0" - nz="RWellTrackerBarrel_NZSupport"/> - </layer> - - <layer module="Module2" id="5" vis="GreenVis"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer2_rmin" - outer_r="RWellTrackerBarrelLayer2_rmin + RWellTrackerBarrelLayer2_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer2_rmin" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrelLayer2_length/2.0" - nz="RWellTrackerBarrel_NZModules"/> - </layer> - <layer module="Module2_STube" id="6" vis="InvisibleWithDaughters"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer2_support_rmin" - outer_r="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer2_support_rmin" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrel_STube_length/2.0" - nz="RWellTrackerBarrel_NZSupport"/> - </layer> - <layer module="Module2_IRing" id="7" vis="InvisibleWithDaughters"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness" - outer_r="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrel_IRing_length/2.0" - nz="RWellTrackerBarrel_NZSupport"/> - </layer> - <layer module="Module2_ORing" id="8" vis="InvisibleWithDaughters"> - <barrel_envelope - inner_r="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" - outer_r="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness + RWellTrackerBarrel_ORing_thickness" - z_length="RWellTrackerBarrel_length" /> - <rphi_layout phi_tilt="0.0" nphi="1" phi0="0." rc="RWellTrackerBarrelLayer2_support_rmin + RWellTrackerBarrel_STube_thickness + RWellTrackerBarrel_IRing_thickness" dr="0.0 * mm"/> - <z_layout dr="0.0 * mm" z0="-RWellTrackerBarrel_length/2.0 + RWellTrackerBarrel_ORing_length/2.0" - nz="RWellTrackerBarrel_NZSupport"/> - </layer> - - </detector> - - </detectors> - - <readouts> - <readout name="RWellTrackerBarrelHits"> - <segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" /> - <id>system:8,barrel:3,layer:4,module:7,sensor:2,x:32:-16,y:-16</id> - </readout> - </readouts> - - <plugins> - </plugins> - - <fields> - </fields> -</lccdd> diff --git a/compact/unused/tracking_config_mgpds.xml b/compact/unused/tracking_config_mgpds.xml deleted file mode 100644 index b2c65ab2d..000000000 --- a/compact/unused/tracking_config_mgpds.xml +++ /dev/null @@ -1,23 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten --> - -<lccdd> - - <display> - </display> - <define> - </define> - - <documentation level="10"> - ### Mixed tracking configuration - - This configuration needs attention! - </documentation> - - <include ref="rwell_tracker_barrel.xml"/> - <!--include ref="compact/ce_GEM.xml"/--> - <!--include ref="compact/mm_tracker_barrel.xml"/--> - <!--include ref="compact/cb_VTX_Barrel.xml"/--> - <!--include ref="compact/gem_tracker_endcap.xml"/--> - -</lccdd> diff --git a/src/CylinderTrackerBarrel_geo.cpp b/src/CylinderTrackerBarrel_geo.cpp deleted file mode 100644 index 9e1105fae..000000000 --- a/src/CylinderTrackerBarrel_geo.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Whitney Armstrong - -//========================================================================== -// Specialized generic detector constructor -//========================================================================== - -#include "DD4hep/DetFactoryHelper.h" -#include "DD4hep/Printout.h" - -using namespace std; -using namespace dd4hep; -using namespace dd4hep::detail; - -/** A barrel tracker with a module that is curved (not flat). - * - * \ingroup tracking - */ -static Ref_t CylinderTrackerBarrel_create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ - typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; - Material air = description.air(); - - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - DetElement sdet(det_name, det_id); - - - Assembly assembly(det_name); - map<string, Volume> mod_volumes; - map<string, Placements> sensitives; - PlacedVolume pv; - - sens.setType("tracker"); - int n_modules = 0; - for (xml_coll_t mi(x_det, _U(module)); mi; ++mi) { - n_modules++; - xml_comp_t x_mod = mi; - xml_comp_t m_env = x_mod.child(_U(module_envelope)); - string m_nam = x_mod.nameStr(); - - Assembly module_assembly(_toString(n_modules, "mod_assembly_%d")); - auto module_rmin = m_env.rmin(); - auto module_thickness = m_env.thickness(); - auto module_length = m_env.length(); - auto module_phi = getAttrOrDefault(m_env, _Unicode(phi), 90.0); - - Volume m_vol( - m_nam, - Tube(module_rmin, module_rmin + module_thickness, module_length / 2, -module_phi / 2.0, module_phi / 2.0), air); - int ncomponents = 0, sensor_number = 1; - module_assembly.placeVolume(m_vol, Position(-module_rmin, 0, 0)); - mod_volumes[m_nam] = module_assembly; - m_vol.setVisAttributes(description.visAttributes(x_mod.visStr())); - - auto comp_rmin = module_rmin; - for (xml_coll_t ci(x_mod, _U(module_component)); ci; ++ci, ++ncomponents) { - xml_comp_t x_comp = ci; - xml_comp_t x_pos = x_comp.position(false); - xml_comp_t x_rot = x_comp.rotation(false); - string c_nam = _toString(ncomponents, "component%d"); - - auto comp_thickness = x_comp.thickness(); - comp_rmin = getAttrOrDefault(x_comp, _Unicode(rmin), comp_rmin); - auto comp_phi = getAttrOrDefault(x_comp, _Unicode(phi), module_phi); - auto comp_phi0 = getAttrOrDefault(x_comp, _Unicode(phi0), 0.0); - auto comp_length = getAttrOrDefault(x_comp, _Unicode(length), module_length); - - Tube c_tube(comp_rmin, comp_rmin + comp_thickness, comp_length / 2, -comp_phi / 2.0 + comp_phi0, - comp_phi / 2.0 + comp_phi0); - Volume c_vol(c_nam, c_tube, description.material(x_comp.materialStr())); - PlacedVolume c_pv; - - if (x_pos && x_rot) { - Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0)); - RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0)); - c_pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); - } else if (x_rot) { - c_pv = m_vol.placeVolume(c_vol, RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0))); - } else if (x_pos) { - c_pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0))); - } else { - c_pv = m_vol.placeVolume(c_vol); - } - c_vol.setRegion(description, x_comp.regionStr()); - c_vol.setLimitSet(description, x_comp.limitsStr()); - c_vol.setVisAttributes(description, x_comp.visStr()); - if (x_comp.isSensitive()) { - c_pv.addPhysVolID(_U(sensor), sensor_number++); - c_vol.setSensitiveDetector(sens); - sensitives[m_nam].push_back(c_pv); - } - comp_rmin = comp_rmin + comp_thickness; - } - } - for (xml_coll_t li(x_det, _U(layer)); li; ++li) { - xml_comp_t x_layer = li; - xml_comp_t x_barrel = x_layer.child(_U(barrel_envelope)); - xml_comp_t x_layout = x_layer.child(_U(rphi_layout)); - xml_comp_t z_layout = x_layer.child(_U(z_layout)); // Get the <z_layout> element. - int lay_id = x_layer.id(); - string m_nam = x_layer.moduleStr(); - string lay_nam = _toString(x_layer.id(), "layer%d"); - Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2); - Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. - lay_vol.setVisAttributes(description.visAttributes(x_layer.visStr())); - double phi0 = x_layout.phi0(); // Starting phi of first module. - double phi_tilt = x_layout.phi_tilt(); // Phi tilt of a module. - double rc = x_layout.rc(); // Radius of the module center. - int nphi = x_layout.nphi(); // Number of modules in phi. - double rphi_dr = x_layout.dr(); // The delta radius of every other module. - double phi_incr = (M_PI * 2) / nphi; // Phi increment for one module. - double phic = phi0; // Phi of the module center. - double z0 = z_layout.z0(); // Z position of first module in phi. - double nz = z_layout.nz(); // Number of modules to place in z. - double z_dr = z_layout.dr(); // Radial displacement parameter, of every other module. - Volume m_env = mod_volumes[m_nam]; - DetElement lay_elt(sdet, _toString(x_layer.id(), "layer%d"), lay_id); - - Placements& sensVols = sensitives[m_nam]; - - // Z increment for module placement along Z axis. - // Adjust for z0 at center of module rather than - // the end of cylindrical envelope. - double z_incr = nz > 1 ? (2.0 * z0) / (nz - 1) : 0.0; - // Starting z for module placement along Z axis. - double module_z = -z0; - int module = 1; - - // Loop over the number of modules in phi. - for (int ii = 0; ii < nphi; ii++) { - double dx = z_dr * std::cos(phic + phi_tilt); // Delta x of module position. - double dy = z_dr * std::sin(phic + phi_tilt); // Delta y of module position. - double x = rc * std::cos(phic); // Basic x module position. - double y = rc * std::sin(phic); // Basic y module position. - - // Loop over the number of modules in z. - for (int j = 0; j < nz; j++) { - string module_name = _toString(module, "module%d"); - DetElement mod_elt(lay_elt, module_name, module); - // Module PhysicalVolume. - // Transform3D - // tr(RotationZYX(0,-((M_PI/2)-phic-phi_tilt),M_PI/2),Position(x,y,module_z)); - // NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the - // outside - Transform3D tr(RotationZYX(phic - phi_tilt, 0, 0), Position(x, y, module_z)); - - pv = lay_vol.placeVolume(m_env, tr); - pv.addPhysVolID("module", module); - mod_elt.setPlacement(pv); - for (size_t ic = 0; ic < sensVols.size(); ++ic) { - PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(mod_elt, sens_pv.volume().name(), module); - comp_elt.setPlacement(sens_pv); - - } - - /// Increase counters etc. - module++; - // Adjust the x and y coordinates of the module. - x += dx; - y += dy; - // Flip sign of x and y adjustments. - dx *= -1; - dy *= -1; - // Add z increment to get next z placement pos. - module_z += z_incr; - } - phic += phi_incr; // Increment the phi placement of module. - rc += rphi_dr; // Increment the center radius according to dr parameter. - rphi_dr *= -1; // Flip sign of dr parameter. - module_z = -z0; // Reset the Z placement parameter for module. - } - // Create the PhysicalVolume for the layer. - pv = assembly.placeVolume(lay_vol); // Place layer in mother - pv.addPhysVolID("layer", lay_id); // Set the layer ID. - lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr()); - lay_elt.setPlacement(pv); - } - sdet.setAttributes(description, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr()); - // assembly.setVisAttributes(description.invisible()); - pv = description.pickMotherVolume(sdet).placeVolume(assembly); - pv.addPhysVolID("system", det_id); // Set the subdetector system ID. - pv.addPhysVolID("barrel", 1); // Flag this as a barrel subdetector. - sdet.setPlacement(pv); - return sdet; -} - -// clang-format off -DECLARE_DETELEMENT(epic_CylinderTrackerBarrel, CylinderTrackerBarrel_create_detector) -DECLARE_DETELEMENT(epic_MMTrackerBarrel, CylinderTrackerBarrel_create_detector) -DECLARE_DETELEMENT(epic_RWellTrackerBarrel, CylinderTrackerBarrel_create_detector) -DECLARE_DETELEMENT(epic_CylinderVertexBarrel, CylinderTrackerBarrel_create_detector) diff --git a/src/GaseousRICH_geo.cpp b/src/GaseousRICH_geo.cpp deleted file mode 100644 index 698afbd64..000000000 --- a/src/GaseousRICH_geo.cpp +++ /dev/null @@ -1,217 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Chao Peng, Whitney Armstrong - -//========================================================================== -// Gaseous Ring Imaging Cherenkov Detector -//-------------------------------------------------------------------------- -// -// Author: C. Peng (ANL) -// Date: 09/30/2020 -// -//========================================================================== - -#include "DD4hep/DetFactoryHelper.h" -#include "DD4hep/OpticalSurfaces.h" -#include "DD4hep/Printout.h" -#include "DDRec/DetectorData.h" -#include "DDRec/Surface.h" -#include "GeometryHelpers.h" -#include "Math/Point2D.h" -#include "TMath.h" -#include "TString.h" -#include <XML/Helper.h> - -using namespace std; -using namespace dd4hep; -using namespace dd4hep::rec; - -// headers -void build_radiator(Detector& desc, Volume& env, xml::Component plm, const Position& offset); -void build_mirrors(Detector& desc, DetElement& sdet, Volume& env, xml::Component plm, const Position& offset); -void build_sensors(Detector& desc, Volume& env, xml::Component plm, const Position& offset, SensitiveDetector& sens); - -// helper function to get x, y, z if defined in a xml component -template <class XmlComp> -Position get_xml_xyz(XmlComp& comp, dd4hep::xml::Strng_t name) -{ - Position pos(0., 0., 0.); - if (comp.hasChild(name)) { - auto child = comp.child(name); - pos.SetX(dd4hep::getAttrOrDefault<double>(child, _Unicode(x), 0.)); - pos.SetY(dd4hep::getAttrOrDefault<double>(child, _Unicode(y), 0.)); - pos.SetZ(dd4hep::getAttrOrDefault<double>(child, _Unicode(z), 0.)); - } - return pos; -} - -// create the detector -static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) -{ - xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - - DetElement det(detName, detID); - xml::Component dims = detElem.dimensions(); - - // build a big envelope for all the components, filled with optical material to ensure transport of optical photons - double z0 = dims.z0(); - double length = dims.length(); - double rmin = dims.rmin(); - double rmax0 = dims.attr<double>(_Unicode(rmax0)); - double rmax1 = dims.attr<double>(_Unicode(rmax1)); - double rmax2 = dims.attr<double>(_Unicode(rmax2)); - double snout_length = dims.attr<double>(_Unicode(snout_length)); - // fill envelope with radiator materials (need optical property for optical photons) - auto gasMat = desc.material(dd4hep::getAttrOrDefault<std::string>(detElem, _Unicode(gas), "AirOptical")); - - Cone snout(snout_length / 2.0, rmin, rmax0, rmin, rmax1); - Tube tank(rmin, rmax2, (length - snout_length) / 2., 0., 2 * M_PI); - // shift the snout to the left side of tank - UnionSolid envShape(tank, snout, Position(0., 0., -length / 2.)); - // some reference points - auto snout_front = Position(0., 0., -(length + snout_length) / 2.); - // auto snout_end = Position(0., 0., -(length - snout_length)/2.); // tank_front - // auto tank_end = Position(0., 0., (length - snout_length)/2.); - - Volume envVol(detName + "_envelope", envShape, gasMat); - envVol.setVisAttributes(desc.visAttributes(detElem.visStr())); - - // sensitive detector type - sens.setType("tracker"); - - // @TODO: place a radiator - // build_radiator(desc, envVol, detElement.child(_Unicode(radiator)), snout_front); - - // place mirrors - build_mirrors(desc, det, envVol, detElem.child(_Unicode(mirrors)), snout_front); - - // place photo-sensors - build_sensors(desc, envVol, detElem.child(_Unicode(sensors)), snout_front, sens); - - Volume motherVol = desc.pickMotherVolume(det); - PlacedVolume envPV = motherVol.placeVolume(envVol, Position(0, 0, z0) - snout_front); - envPV.addPhysVolID("system", detID); - det.setPlacement(envPV); - - return det; -} - -// @TODO: implement a radiator, now the envelope serves as the radiator -void build_radiator(Detector& /* desc */, Volume& /* env */, xml::Component /* plm */, const Position& /* offset */) -{ - // place holder -} - -// place mirrors -void build_mirrors(Detector& desc, DetElement& sdet, Volume& env, xml::Component plm, const Position& offset) -{ - double thickness = dd4hep::getAttrOrDefault<double>(plm, _Unicode(dz), 1. * dd4hep::mm); - auto mat = desc.material(plm.attr<std::string>(_Unicode(material))); - auto vis = desc.visAttributes(plm.attr<std::string>(_Unicode(vis))); - - // optical surface - OpticalSurfaceManager surfMgr = desc.surfaceManager(); - auto surf = - surfMgr.opticalSurface(dd4hep::getAttrOrDefault<std::string>(plm, _Unicode(surface), "MirrorOpticalSurface")); - - // placements - auto gpos = get_xml_xyz(plm, _Unicode(position)) + offset; - auto grot = get_xml_xyz(plm, _Unicode(position)); - int imod = 1; - for (xml::Collection_t mir(plm, _Unicode(mirror)); mir; ++mir, ++imod) { - double rmin = mir.attr<double>(_Unicode(rmin)); - double rmax = mir.attr<double>(_Unicode(rmax)); - double phiw = dd4hep::getAttrOrDefault<double>(mir, _Unicode(phiw), 2. * M_PI); - double rotz = dd4hep::getAttrOrDefault<double>(mir, _Unicode(rotz), 0.); - double roty = dd4hep::getAttrOrDefault<double>(mir, _Unicode(roty), 0.); - double rotx = dd4hep::getAttrOrDefault<double>(mir, _Unicode(rotx), 0.); - - Volume vol(Form("mirror_v_dummy%d", imod)); - vol.setMaterial(mat); - vol.setVisAttributes(vis); - // mirror curvature - double curve = dd4hep::getAttrOrDefault<double>(mir, _Unicode(curve), 0.); - // spherical mirror - if (curve > 0.) { - double th1 = std::asin(rmin / curve); - double th2 = std::asin(rmax / curve); - vol.setSolid(Sphere(curve, curve + thickness, th1, th2, 0., phiw)); - // plane mirror - } else { - vol.setSolid(Tube(rmin, rmax, thickness / 2., 0., phiw)); - } - // transforms are in a reverse order - Transform3D tr = Translation3D(gpos.x(), gpos.y(), gpos.z()) * RotationZYX(grot.z(), grot.y(), grot.x()) * - RotationZ(rotz) // rotation of the piece - * RotationY(roty) // rotation of the piece - * RotationX(rotx) // rotation of the piece - * Translation3D(0., 0., -curve) // move spherical shell to origin (no move for planes) - * RotationZ(-phiw / 2.); // center phi angle to 0. (-phiw/2., phiw/2.) - auto pv = env.placeVolume(vol, tr); - DetElement de(sdet, Form("mirror_de%d", imod), imod); - de.setPlacement(pv); - SkinSurface skin(desc, de, Form("mirror_optical_surface%d", imod), surf, vol); - skin.isValid(); - } -} - -// place photo-sensors -void build_sensors(Detector& desc, Volume& env, xml::Component plm, const Position& offset, SensitiveDetector& sens) -{ - // build sensor unit geometry - auto mod = plm.child(_Unicode(module)); - double sx = mod.attr<double>(_Unicode(sx)); - double sy = mod.attr<double>(_Unicode(sy)); - double sz = mod.attr<double>(_Unicode(sz)); - double gap = mod.attr<double>(_Unicode(gap)); - auto mat = desc.material(mod.attr<std::string>(_Unicode(material))); - auto vis = desc.visAttributes(mod.attr<std::string>(_Unicode(vis))); - - Box sensor(sx / 2., sy / 2., sz / 2.); - Volume svol("sensor_v", sensor, mat); - svol.setVisAttributes(vis); - - // a thin layer of cherenkov gas for accepting optical photons - auto opt = plm.child(_Unicode(optical)); - double opthick = opt.attr<double>(_Unicode(thickness)); - auto opmat = desc.material(opt.attr<std::string>(_Unicode(material))); - - Box opshape(sx / 2., sy / 2., sz / 2. + opthick / 2.); - Volume opvol("sensor_v_optical", opshape, opmat); - opvol.placeVolume(svol, Position(0., 0., 0.)); - opvol.setSensitiveDetector(sens); - - // photo-detector plane envelope - auto gpos = get_xml_xyz(plm, _Unicode(position)) + offset; - auto grot = get_xml_xyz(plm, _Unicode(position)); - int isec = 1; - for (xml::Collection_t sec(plm, _Unicode(sector)); sec; ++sec, ++isec) { - double rmin = sec.attr<double>(_Unicode(rmin)); - double rmax = sec.attr<double>(_Unicode(rmax)); - double phiw = dd4hep::getAttrOrDefault<double>(sec, _Unicode(phiw), 2. * M_PI); - double rotz = dd4hep::getAttrOrDefault<double>(sec, _Unicode(rotz), 0.); - double roty = dd4hep::getAttrOrDefault<double>(sec, _Unicode(roty), 0.); - double rotx = dd4hep::getAttrOrDefault<double>(sec, _Unicode(rotx), 0.); - - // fill sensors to the piece - auto points = - epic::geo::fillRectangles({0., 0.}, sx + gap, sy + gap, rmin - gap, rmax + gap, -phiw / 2., phiw / 2.); - int imod = 1; - for (auto& p : points) { - // transofrms are in a reversed order - Transform3D tr = Translation3D(gpos.x(), gpos.y(), gpos.z()) * RotationZYX(grot.z(), grot.y(), grot.x()) * - RotationZ(rotz) // rotation of the sector - * RotationY(roty) // rotation of the sector - * RotationX(rotx) // rotation of the sector - * Translation3D(p.x(), p.y(), 0.); // place modules in each sector - auto pv = env.placeVolume(opvol, tr); - pv.addPhysVolID("sector", isec).addPhysVolID("module", imod++); - } - } -} - -//@} - -// clang-format off -DECLARE_DETELEMENT(epic_GaseousRICH, createDetector) diff --git a/src/ShashlikCalorimeter_geo.cpp b/src/ShashlikCalorimeter_geo.cpp deleted file mode 100644 index 4b42da901..000000000 --- a/src/ShashlikCalorimeter_geo.cpp +++ /dev/null @@ -1,188 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Chao Peng - -//========================================================================== -// Implementation for shashlik calorimeter modules -// it supports disk placements with (rmin, rmax), and (phimin, phimax) -//-------------------------------------------------------------------------- -// Author: Chao Peng (ANL) -// Date: 06/22/2021 -//========================================================================== - -#include "DD4hep/DetFactoryHelper.h" -#include "GeometryHelpers.h" -#include <XML/Helper.h> -#include <XML/Layering.h> -#include <algorithm> -#include <iostream> -#include <math.h> -#include <tuple> - -using namespace dd4hep; - -static void add_disk_shashlik(Detector& desc, Assembly& env, xml::Collection_t& plm, SensitiveDetector& sens, int id); - -// helper function to get x, y, z if defined in a xml component -template <class XmlComp> -Position get_xml_xyz(XmlComp& comp, dd4hep::xml::Strng_t name) -{ - Position pos(0., 0., 0.); - if (comp.hasChild(name)) { - auto child = comp.child(name); - pos.SetX(dd4hep::getAttrOrDefault<double>(child, _Unicode(x), 0.)); - pos.SetY(dd4hep::getAttrOrDefault<double>(child, _Unicode(y), 0.)); - pos.SetZ(dd4hep::getAttrOrDefault<double>(child, _Unicode(z), 0.)); - } - return pos; -} - -static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) -{ - static const std::string func = "ShashlikCalorimeter"; - xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); - sens.setType("calorimeter"); - // envelope - Assembly assembly(detName); - - // module placement - xml::Component plm = detElem.child(_Unicode(placements)); - int sector = 1; - for (xml::Collection_t mod(plm, _Unicode(disk)); mod; ++mod) { - add_disk_shashlik(desc, assembly, mod, sens, sector++); - } - - // detector position and rotation - auto pos = get_xml_xyz(detElem, _Unicode(position)); - auto rot = get_xml_xyz(detElem, _Unicode(rotation)); - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr = Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x()); - PlacedVolume envPV = motherVol.placeVolume(assembly, tr); - envPV.addPhysVolID("system", detID); - det.setPlacement(envPV); - return det; -} - -// helper function to build module with or w/o wrapper -std::tuple<Volume, int, double, double> build_shashlik(Detector& desc, xml::Collection_t& plm, SensitiveDetector& sens) -{ - auto mod = plm.child(_Unicode(module)); - // a modular volume - std::string shape = dd4hep::getAttrOrDefault<std::string>(mod, _Unicode(shape), "square"); - std::transform(shape.begin(), shape.end(), shape.begin(), [](char c) { return std::tolower(c); }); - int nsides = 4; - if (shape == "hexagon") { - nsides = 6; - } else if (shape != "square") { - std::cerr << "ShashlikCalorimeter Error: Unsupported shape of module " << shape - << ". Please choose from (square, hexagon). Proceed with square shape." << std::endl; - } - double slen = mod.attr<double>(_Unicode(side_length)); - double rmax = slen / 2. / std::sin(M_PI / nsides); - Layering layering(mod); - auto len = layering.totalThickness(); - - // wrapper info - PolyhedraRegular mpoly(nsides, 0., rmax, len); - Volume mvol("shashlik_module_vol", mpoly, desc.air()); - mvol.setVisAttributes(desc.visAttributes(dd4hep::getAttrOrDefault<std::string>(mod, _Unicode(vis), "GreenVis"))); - - double gap = 0.; - Volume wvol("shashlik_wrapper_vol"); - if (plm.hasChild(_Unicode(wrapper))) { - auto wrap = plm.child(_Unicode(wrapper)); - gap = wrap.attr<double>(_Unicode(thickness)); - if (gap > 1e-6 * mm) { - wvol.setSolid(PolyhedraRegular(nsides, 0., rmax + gap, len)); - wvol.setMaterial(desc.material(wrap.attr<std::string>(_Unicode(material)))); - wvol.setVisAttributes(desc.visAttributes(dd4hep::getAttrOrDefault<std::string>(wrap, _Unicode(vis), "WhiteVis"))); - wvol.placeVolume(mvol, Position{0., 0., 0.}); - } - } - - // layer start point - double lz = -len / 2.; - int lnum = 1; - // Loop over the sets of layer elements in the detector. - for (xml_coll_t li(mod, _U(layer)); li; ++li) { - int repeat = li.attr<int>(_Unicode(repeat)); - // Loop over number of repeats for this layer. - for (int j = 0; j < repeat; j++) { - std::string lname = Form("layer%d", lnum); - double lthick = layering.layer(lnum - 1)->thickness(); // Layer's thickness. - PolyhedraRegular lpoly(nsides, 0., rmax, lthick); - Volume lvol(lname, lpoly, desc.air()); - - // Loop over the sublayers or slices for this layer. - int snum = 1; - double sz = -lthick / 2.; - for (xml_coll_t si(li, _U(slice)); si; ++si) { - std::string sname = Form("slice%d", snum); - double sthick = si.attr<double>(_Unicode(thickness)); - PolyhedraRegular spoly(nsides, 0., rmax, sthick); - Volume svol(sname, spoly, desc.material(si.attr<std::string>(_Unicode(material)))); - - std::string issens = dd4hep::getAttrOrDefault<std::string>(si, _Unicode(sensitive), "no"); - std::transform(issens.begin(), issens.end(), issens.begin(), [](char c) { return std::tolower(c); }); - if ((issens == "yes") || (issens == "y") || (issens == "true")) { - svol.setSensitiveDetector(sens); - } - svol.setAttributes(desc, dd4hep::getAttrOrDefault<std::string>(si, _Unicode(region), ""), - dd4hep::getAttrOrDefault<std::string>(si, _Unicode(limits), ""), - dd4hep::getAttrOrDefault<std::string>(si, _Unicode(vis), "InvisibleNoDaughters")); - - // Slice placement. - auto slicePV = lvol.placeVolume(svol, Position(0, 0, sz + sthick / 2.)); - slicePV.addPhysVolID("slice", snum++); - // Increment Z position of slice. - sz += sthick; - } - - // Set region, limitset, and vis of layer. - lvol.setAttributes(desc, dd4hep::getAttrOrDefault<std::string>(li, _Unicode(region), ""), - dd4hep::getAttrOrDefault<std::string>(li, _Unicode(limits), ""), - dd4hep::getAttrOrDefault<std::string>(li, _Unicode(vis), "InvisibleNoDaughters")); - - auto layerPV = mvol.placeVolume(lvol, Position(0, 0, lz + lthick / 2)); - layerPV.addPhysVolID("layer", lnum++); - // Increment to next layer Z position. - lz += lthick; - } - } - - if (gap > 1e-6 * mm) { - return std::make_tuple(wvol, nsides, 2. * std::sin(M_PI / nsides) * (rmax + gap), len); - } else { - return std::make_tuple(mvol, nsides, slen, len); - } -} - -// place disk of modules -static void add_disk_shashlik(Detector& desc, Assembly& env, xml::Collection_t& plm, SensitiveDetector& sens, int sid) -{ - auto [mvol, nsides, sidelen, len] = build_shashlik(desc, plm, sens); - int sector_id = dd4hep::getAttrOrDefault<int>(plm, _Unicode(sector), sid); - int id_begin = dd4hep::getAttrOrDefault<int>(plm, _Unicode(id_begin), 1); - double rmin = plm.attr<double>(_Unicode(rmin)); - double rmax = plm.attr<double>(_Unicode(rmax)); - double phimin = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimin), 0.); - double phimax = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimax), 2. * M_PI); - - auto points = (nsides == 6) ? epic::geo::fillHexagons({0., 0.}, sidelen, rmin, rmax, phimin, phimax) - : epic::geo::fillSquares({0., 0.}, sidelen * 1.414, rmin, rmax, phimin, phimax); - // placement to mother - auto pos = get_xml_xyz(plm, _Unicode(position)); - auto rot = get_xml_xyz(plm, _Unicode(rotation)); - int mid = 0; - for (auto& p : points) { - Transform3D tr = RotationZYX(rot.z(), rot.y(), rot.x()) * - Translation3D(pos.x() + p.x(), pos.y() + p.y(), pos.z() + len / 2.) * - RotationZ((nsides == 4) ? 45 * degree : 0); - auto modPV = env.placeVolume(mvol, tr); - modPV.addPhysVolID("sector", sector_id).addPhysVolID("module", id_begin + mid++); - } -} - -DECLARE_DETELEMENT(epic_ShashlikCalorimeter, create_detector) From c37c373d83afe85adaa7deadcfe809e4b188c2d9 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Mon, 12 Feb 2024 13:40:48 -0500 Subject: [PATCH 018/113] definitions.xml: ECal -> Ecal, HCal -> Hcal for ID fields (#631) First step for #557 in which we provide Ecal* and Hcal* names. Next step would be to use those names in EICrecon. Final step is to remove the deprecated aliases. --- compact/definitions.xml | 35 ++++++++++++--------- compact/ecal/backward_PbWO4.xml | 2 +- compact/ecal/backward_hybrid.xml | 2 +- compact/ecal/barrel_interlayers.xml | 4 +-- compact/ecal/barrel_sciglass.xml | 2 +- compact/ecal/forward_homogeneous.xml | 2 +- compact/ecal/forward_insert_homogeneous.xml | 2 +- compact/ecal/forward_scfi.xml | 2 +- compact/hcal/backward.xml | 2 +- compact/hcal/barrel_gdml.xml | 2 +- compact/hcal/forward_insert.xml | 2 +- 11 files changed, 32 insertions(+), 25 deletions(-) diff --git a/compact/definitions.xml b/compact/definitions.xml index 9cca86c2f..290a7793b 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -166,7 +166,7 @@ The unused IDs below are saved for future use. <documentation> #### (100-109) Electromagnetic Calorimeter - ECal subsystem ID: 100 + Ecal subsystem ID: 100 Barrel subassembly ID: 101 EndcapP subassembly ID: 102 EndcapN subassembly ID: 103 @@ -176,30 +176,37 @@ The unused IDs below are saved for future use. Unused IDs: 107-109 </documentation> - <constant name="ECalSubAssembly_ID" value="100"/> - <constant name="ECalBarrel_ID" value="101"/> - <constant name="ECalEndcapP_ID" value="102"/> - <constant name="ECalEndcapN_ID" value="103"/> - <constant name="CrystalEndcap_ID" value="104"/> - <constant name="ECalBarrel2_ID" value="105"/> - <constant name="ECalEndcapPInsert_ID" value="106"/> + <constant name="ECalSubAssembly_ID" value="100"/><!-- UNUSED --> + <constant name="ECalBarrel_ID" value="101"/><!-- DEPRECATED --> + <constant name="EcalBarrel_ID" value="101"/> + <constant name="ECalEndcapP_ID" value="102"/><!-- DEPRECATED --> + <constant name="EcalEndcapP_ID" value="102"/> + <constant name="ECalEndcapN_ID" value="103"/><!-- DEPRECATED --> + <constant name="EcalEndcapN_ID" value="103"/> + <constant name="CrystalEndcap_ID" value="104"/><!-- UNUSED --> + <constant name="ECalBarrel2_ID" value="105"/><!-- DEPRECATED --> + <constant name="EcalBarrel2_ID" value="105"/> + <constant name="ECalEndcapPInsert_ID" value="106"/><!-- DEPRECATED --> + <constant name="EcalEndcapPInsert_ID" value="106"/> <documentation> #### (110-119) Hadronic Calorimeter - - HCal subsystem ID: 110 + - Hcal subsystem ID: 110 - Barrel subassembly ID: 111 - EndcapP subassembly ID: 112 - EndcapN subassembly ID: 113 - Unused IDs: 117-119 </documentation> - <constant name="HCalSubAssembly_ID" value="110"/> - <constant name="HCalBarrel_ID" value="111"/> - <constant name="HCalEndcapP_ID" value="112"/> - <constant name="HCalEndcapN_ID" value="113"/> + <constant name="HCalSubAssembly_ID" value="110"/><!-- UNUSED --> + <constant name="HCalBarrel_ID" value="111"/><!-- DEPRECATED --> + <constant name="HcalBarrel_ID" value="111"/> + <constant name="HCalEndcapN_ID" value="113"/><!-- DEPRECATED --> + <constant name="HcalEndcapN_ID" value="113"/> <constant name="PassiveSteelRingEndcapP_ID" value="114"/> - <constant name="HCalEndcapPInsert_ID" value="115"/> + <constant name="HCalEndcapPInsert_ID" value="115"/><!-- DEPRECATED --> + <constant name="HcalEndcapPInsert_ID" value="115"/> <constant name="LFHCAL_ID" value="116"/> <documentation> #### (120-129) (near) Forward reserved diff --git a/compact/ecal/backward_PbWO4.xml b/compact/ecal/backward_PbWO4.xml index fd17c2622..5db0b266b 100644 --- a/compact/ecal/backward_PbWO4.xml +++ b/compact/ecal/backward_PbWO4.xml @@ -64,7 +64,7 @@ #### Backwards Endcap EM Calorimeter </documentation> <detector - id="ECalEndcapN_ID" + id="EcalEndcapN_ID" name="EcalEndcapN" type="epic_HomogeneousCalorimeter" readout="EcalEndcapNHits"> diff --git a/compact/ecal/backward_hybrid.xml b/compact/ecal/backward_hybrid.xml index 8fe821296..bee40e905 100644 --- a/compact/ecal/backward_hybrid.xml +++ b/compact/ecal/backward_hybrid.xml @@ -58,7 +58,7 @@ Backwards Endcap EM Calorimeter, placements generated by script </documentation> - <detector id="ECalEndcapN_ID" name="EcalEndcapN" type="epic_HybridCalorimeter" readout="EcalEndcapNHits"> + <detector id="EcalEndcapN_ID" name="EcalEndcapN" type="epic_HybridCalorimeter" readout="EcalEndcapNHits"> <position x="0" y="0" z="EcalEndcapN_z0"/> <rotation x="0" y="0" z="0"/> </detector> diff --git a/compact/ecal/barrel_interlayers.xml b/compact/ecal/barrel_interlayers.xml index 037f24248..2c15693ef 100644 --- a/compact/ecal/barrel_interlayers.xml +++ b/compact/ecal/barrel_interlayers.xml @@ -118,7 +118,7 @@ Silicon (Astropix) readout layers for imaging 3d showers </comment> <detector - id="ECalBarrel_ID" + id="EcalBarrel_ID" name="EcalBarrelImaging" type="epic_EcalBarrelImaging" readout="EcalBarrelImagingHits" @@ -227,7 +227,7 @@ --------------------------------------- </comment> <detector - id="ECalBarrel2_ID" + id="EcalBarrel2_ID" name="EcalBarrelScFi" type="epic_EcalBarrelScFi" readout="EcalBarrelScFiHits" diff --git a/compact/ecal/barrel_sciglass.xml b/compact/ecal/barrel_sciglass.xml index d2adfb758..0e241f0e6 100644 --- a/compact/ecal/barrel_sciglass.xml +++ b/compact/ecal/barrel_sciglass.xml @@ -38,7 +38,7 @@ An EM calorimeter with SciGlass blocks </comment> - <detector id="ECalBarrel_ID" name="EcalBarrelSciGlass" type="epic_EcalBarrelSciGlass" readout="EcalBarrelSciGlassHits" vis="det_vis" calorimeterType="EM_BARREL"> + <detector id="EcalBarrel_ID" name="EcalBarrelSciGlass" type="epic_EcalBarrelSciGlass" readout="EcalBarrelSciGlassHits" vis="det_vis" calorimeterType="EM_BARREL"> <comment> Global detector dimensions from https://eic.jlab.org/Geometry/Detector/Detector-20220624102507.html </comment> diff --git a/compact/ecal/forward_homogeneous.xml b/compact/ecal/forward_homogeneous.xml index f5f47e0db..e19b8faa6 100644 --- a/compact/ecal/forward_homogeneous.xml +++ b/compact/ecal/forward_homogeneous.xml @@ -53,7 +53,7 @@ Insert shape is cut out from middle of detector </documentation> - <detector id="ECalEndcapP_ID" + <detector id="EcalEndcapP_ID" name="EcalEndcapP" type="epic_EndcapCalorimeterWithInsertCutout" readout="EcalEndcapPHits"> diff --git a/compact/ecal/forward_insert_homogeneous.xml b/compact/ecal/forward_insert_homogeneous.xml index 5faeba7a7..301030816 100644 --- a/compact/ecal/forward_insert_homogeneous.xml +++ b/compact/ecal/forward_insert_homogeneous.xml @@ -52,7 +52,7 @@ </documentation> <detector - id="ECalEndcapPInsert_ID" + id="EcalEndcapPInsert_ID" name="EcalEndcapPInsert" type="epic_InsertCalorimeter" vis="HcalEndcapInsertVis" diff --git a/compact/ecal/forward_scfi.xml b/compact/ecal/forward_scfi.xml index 7ba2a6db7..1a26aa97c 100644 --- a/compact/ecal/forward_scfi.xml +++ b/compact/ecal/forward_scfi.xml @@ -29,7 +29,7 @@ ------------------------------------------ An EM calorimeter with ScFi modules </comment> - <detector id="ECalEndcapP_ID" + <detector id="EcalEndcapP_ID" name="EcalEndcapP" type="epic_ScFiCalorimeter" vis="EcalEndcapVis" diff --git a/compact/hcal/backward.xml b/compact/hcal/backward.xml index 96d62d09c..2df2373cd 100644 --- a/compact/hcal/backward.xml +++ b/compact/hcal/backward.xml @@ -32,7 +32,7 @@ ### Backwards (Negative Z) Endcap Hadronic Calorimeter </documentation> <detector - id="HCalEndcapN_ID" + id="HcalEndcapN_ID" name="HcalEndcapN" type="epic_PolyhedraEndcapCalorimeter2" readout="HcalEndcapNHits" diff --git a/compact/hcal/barrel_gdml.xml b/compact/hcal/barrel_gdml.xml index be67327a6..26cb6b0a8 100644 --- a/compact/hcal/barrel_gdml.xml +++ b/compact/hcal/barrel_gdml.xml @@ -9,7 +9,7 @@ ### Barrel Hadronic Calorimeter </documentation> <detector - id="HCalBarrel_ID" + id="HcalBarrel_ID" name="HcalBarrel" type="epic_HcalBarrelGDML" readout="HcalBarrelHits" diff --git a/compact/hcal/forward_insert.xml b/compact/hcal/forward_insert.xml index ba6712ca8..1c8037d44 100644 --- a/compact/hcal/forward_insert.xml +++ b/compact/hcal/forward_insert.xml @@ -68,7 +68,7 @@ </documentation> <detector - id="HCalEndcapPInsert_ID" + id="HcalEndcapPInsert_ID" name="HcalEndcapPInsert" type="epic_InsertCalorimeter" vis="HcalEndcapInsertVis" From cff6f40bc4ab9d2e24c0179639dab28bb705fb5a Mon Sep 17 00:00:00 2001 From: John Lajoie <lajoiejg@ornl.gov> Date: Thu, 15 Feb 2024 15:30:30 -0500 Subject: [PATCH 019/113] Adding craterlake w/o barrel hcal to facilitate overlap checks (#633) ### Briefly, what does this PR introduce? This adds an ePIC craterlake configuration w/o the barrel HCAL in order to facilitate splitting the overlap checks. The barrel HCAL takes a very long time for overlap checks due to the tessellated geometry. so splitting it out should allow the overlpa checks to complete within the 6 hour time limit imposed by GitHub. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [X] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? None ### Does this PR change default behavior? No, it adds a new configuration. --- .github/workflows/linux-eic-shell.yml | 2 +- configurations/craterlake_no_bhcal.yml | 35 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 configurations/craterlake_no_bhcal.yml diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index be3a34d76..fede34061 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -401,7 +401,7 @@ jobs: - build strategy: matrix: - detector_config: [epic_craterlake] + detector_config: [epic_craterlake_no_bhcal, epic_bhcal] fail-fast: false steps: - uses: actions/checkout@v4 diff --git a/configurations/craterlake_no_bhcal.yml b/configurations/craterlake_no_bhcal.yml new file mode 100644 index 000000000..12fa99f03 --- /dev/null +++ b/configurations/craterlake_no_bhcal.yml @@ -0,0 +1,35 @@ +ebeam: 5 +pbeam: 41 +features: + beampipe: + tracking: + definitions_craterlake: + vertex_barrel: + silicon_barrel: + mpgd_barrel: + support_service_craterlake: + mpgd_outerbarrel: + mpgd_forward_endcap: + mpgd_backward_endcap: + silicon_disks: + tof_barrel: + tof_endcap: + pid: + dirc: + pfrich: + drich: + ecal: + forward_homogeneous: + forward_insert_homogeneous: + barrel_interlayers: + backward_PbWO4: + solenoid: + hcal: + lfhcal_with_space_for_insert: + forward_insert: + backward: + backward_endcap_flux: + far_forward: + far_forward: + far_backward: + far_backward: From 3a8a6b17dfcaf23cd63ce8d55872371fdeaea6ab Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sat, 17 Feb 2024 13:48:56 -0600 Subject: [PATCH 020/113] fix: cleanup test_ACTS and add visitSurfaces test (#635) ### Briefly, what does this PR introduce? I am seeing weird behavior with a conversion that works, but then a visitSurfaces call that fails. We might as well test this in CI. This PR cleans up the test by removing unused code, and adds the new test. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- scripts/test_ACTS.cxx | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/scripts/test_ACTS.cxx b/scripts/test_ACTS.cxx index a293da1ef..a949db76c 100644 --- a/scripts/test_ACTS.cxx +++ b/scripts/test_ACTS.cxx @@ -1,16 +1,7 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Whitney Armstrong +// Copyright (C) 2022 - 2024, Whitney Armstrong, Wouter Deconinck -#include "DD4hep/DetElement.h" #include "DD4hep/Detector.h" -#include "DD4hep/Objects.h" -#include "DDG4/Geant4Data.h" -#include "DDRec/CellIDPositionConverter.h" -#include "DDRec/Surface.h" -#include "DDRec/SurfaceManager.h" - -#include "TCanvas.h" -#include "TChain.h" #include "Acts/Geometry/TrackingGeometry.hpp" #include "Acts/Geometry/TrackingVolume.hpp" @@ -22,27 +13,16 @@ */ void test_ACTS(const char* compact = "epic.xml") { - - using namespace ROOT::Math; // ------------------------- // Get the DD4hep instance // Load the compact XML file // Initialize the position converter tool - dd4hep::Detector& detector = dd4hep::Detector::getInstance(); - detector.fromCompact(compact); - dd4hep::rec::CellIDPositionConverter cellid_converter(detector); + auto detector = dd4hep::Detector::make_unique(""); + detector->fromCompact(compact); auto logger = Acts::getDefaultLogger("Acts", Acts::Logging::Level::VERBOSE); - auto acts_tracking_geometry = Acts::convertDD4hepDetector(detector.world(), *logger); + auto acts_tracking_geometry = Acts::convertDD4hepDetector(detector->world(), *logger); - if (acts_tracking_geometry) { - std::cout << "success?\n"; - } - // if(acts_tracking_geometry->highestTrackingVolume()) { - // std::cout << " volume name \n "; - // std::cout << acts_tracking_geometry->highestTrackingVolume()->volumeName() << std::endl; - // } else { - // std::cout << "derp\n"; - // } - //} + // Visit all surfaces + acts_tracking_geometry->visitSurfaces([](const Acts::Surface *surface) { }); } From 1f68d5c70a5e1280795a016a172b744bce16e4b1 Mon Sep 17 00:00:00 2001 From: Sakib Rahman <rahmans@myumanitoba.ca> Date: Mon, 19 Feb 2024 01:52:45 +0400 Subject: [PATCH 021/113] Add 10x275 beam energy config (#636) ### Briefly, what does this PR introduce? Adds 10x275 beam energy config which picks up the right beamline magnetic field https://github.com/eic/epic/blob/main/compact/fields/beamline_10x275.xml ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [X] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --- configurations/craterlake_10x275.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 configurations/craterlake_10x275.yml diff --git a/configurations/craterlake_10x275.yml b/configurations/craterlake_10x275.yml new file mode 100644 index 000000000..e3a89ac96 --- /dev/null +++ b/configurations/craterlake_10x275.yml @@ -0,0 +1,36 @@ +ebeam: 10 +pbeam: 275 +features: + beampipe: + tracking: + definitions_craterlake: + vertex_barrel: + silicon_barrel: + mpgd_barrel: + support_service_craterlake: + mpgd_outerbarrel: + mpgd_forward_endcap: + mpgd_backward_endcap: + silicon_disks: + tof_barrel: + tof_endcap: + pid: + dirc: + pfrich: + drich: + ecal: + forward_homogeneous: + forward_insert_homogeneous: + barrel_interlayers: + backward_PbWO4: + solenoid: + hcal: + lfhcal_with_space_for_insert: + forward_insert: + barrel_gdml: + backward: + backward_endcap_flux: + far_forward: + far_forward: + far_backward: + far_backward: From 8f9b9a484cf2ba7f26913a8c0172bc4ef2d186c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 13:43:19 -0500 Subject: [PATCH 022/113] [pre-commit.ci] pre-commit autoupdate (#638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <!--pre-commit.ci start--> updates: - [github.com/Lucas-C/pre-commit-hooks: v1.5.4 → v1.5.5](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.5.4...v1.5.5) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f486cdded..c8a6affb0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: hooks: - id: clang-format - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.4 + rev: v1.5.5 hooks: - id: forbid-crlf - id: remove-crlf From 4045b9f56603629b91867911dd16f2a2c9e65011 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Thu, 22 Feb 2024 17:16:12 -0500 Subject: [PATCH 023/113] configurations/full.yml: switch to craterlake.xml (#641) Fixes the default to use craterlake configuration. ### Briefly, what does this PR introduce? ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? The current full.xml based on arches.xml serves no practical purpose in ePIC. ### Does this PR change default behavior? Yes. --- configurations/full.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configurations/full.yml b/configurations/full.yml index d99001e42..51a600e8d 100644 --- a/configurations/full.yml +++ b/configurations/full.yml @@ -1,13 +1,17 @@ +ebeam: 5 +pbeam: 41 features: beampipe: tracking: - definitions: + definitions_craterlake: vertex_barrel: silicon_barrel: mpgd_barrel: - mpgd_dirc: + support_service_craterlake: + mpgd_outerbarrel: + mpgd_forward_endcap: + mpgd_backward_endcap: silicon_disks: - support_service_assembly: tof_barrel: tof_endcap: pid: From 88db60fed31fe8332bc7577e45ead4b43b54a838 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Mon, 26 Feb 2024 14:13:32 -0600 Subject: [PATCH 024/113] feat: implement npsim-gun and npsim-dis capybara diffing (#642) ### Briefly, what does this PR introduce? This PR adds the npsim-gun and npsim-dis comparisons from EICrecon as capybara sources for diffs. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue: capybara in epic) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @veprbl ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/linux-eic-shell.yml | 129 ++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index fede34061..58a8d076e 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -582,6 +582,135 @@ jobs: pattern: ${{ matrix.detector_config }}_views_* delete-merged: true + npsim-gun: + runs-on: ubuntu-latest + needs: build + strategy: + matrix: + particle: [pi, e] + detector_config: [epic_craterlake] + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: build-gcc-full-eic-shell + path: install/ + - uses: cvmfs-contrib/github-action-cvmfs@v4 + - name: Produce simulation files + uses: eic/run-cvmfs-osg-eic-shell@main + with: + platform-release: "jug_xl:nightly" + setup: install/setup.sh + run: | + npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -G --random.seed 1 --gun.particle "${{ matrix.particle }}-" --gun.momentumMin "1*GeV" --gun.momentumMax "20*GeV" --gun.distribution "uniform" -N 100 --outputFile sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -v WARNING + - uses: actions/upload-artifact@v4 + with: + name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root + path: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root + if-no-files-found: error + - name: Download previous artifact + id: download_previous_artifact + uses: dawidd6/action-download-artifact@v3 + with: + branch: ${{ github.event.pull_request.base.ref || github.ref_name }} + path: ref/ + name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root + workflow_conclusion: "" + if_no_artifact_found: warn + - name: Compare to previous artifacts + uses: eic/run-cvmfs-osg-eic-shell@main + with: + platform-release: "jug_xl:nightly" + setup: install/setup.sh + run: | + export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH + mkdir capybara-reports + shopt -s nullglob + capybara bara ref/sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root* sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root + mv capybara-reports sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }} + touch .sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }} + - uses: actions/upload-artifact@v4 + with: + name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.capy + path: | + .sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }} + sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}/ + if-no-files-found: error + + npsim-dis: + runs-on: ubuntu-latest + needs: build + strategy: + matrix: + beam: [5x41, 10x100, 18x275] + minq2: [1, 1000] + detector_config: [epic_craterlake] + exclude: + - beam: 5x41 + minq2: 1000 + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: build-gcc-full-eic-shell + path: install/ + - uses: cvmfs-contrib/github-action-cvmfs@v4 + - name: Produce simulation files + uses: eic/run-cvmfs-osg-eic-shell@main + with: + platform-release: "jug_xl:nightly" + setup: install/setup.sh + run: | + url=root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/DIS/NC/${{matrix.beam}}/minQ2=${{matrix.minq2}}/pythia8NCDIS_${{matrix.beam}}_minQ2=${{matrix.minq2}}_beamEffects_xAngle=-0.025_hiDiv_1.hepmc3.tree.root + npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -N 100 --inputFiles ${url} --random.seed 1 --outputFile sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -v WARNING + - uses: actions/upload-artifact@v4 + with: + name: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root + path: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root + if-no-files-found: error + - name: Download previous artifact + id: download_previous_artifact + uses: dawidd6/action-download-artifact@v3 + with: + branch: ${{ github.event.pull_request.base.ref || github.ref_name }} + path: ref/ + name: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root + workflow_conclusion: "" + if_no_artifact_found: warn + - name: Compare to previous artifacts + uses: eic/run-cvmfs-osg-eic-shell@main + with: + platform-release: "jug_xl:nightly" + setup: install/setup.sh + run: | + pip install 'pygithub>=2' 'bokeh>=3' + export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH + mkdir capybara-reports + shopt -s nullglob + capybara bara ref/sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root* sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root + mv capybara-reports sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }} + touch .sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }} + - uses: actions/upload-artifact@v4 + with: + name: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.capy + path: | + .sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }} + sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}/ + if-no-files-found: error + + merge-npsim-capybara: + runs-on: ubuntu-latest + needs: + - npsim-gun + - npsim-dis + steps: + - uses: actions/upload-artifact/merge@v4 + with: + name: capybara-report + pattern: | + *.capy + delete-merged: true + build-artifacts-page: runs-on: ubuntu-latest needs: From cd28d2f7bc83129844fa9a9b48810add65dd9d0b Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Wed, 28 Feb 2024 15:00:49 -0600 Subject: [PATCH 025/113] feat: add the inter-MPGD/DIRC aluminum support rails (#521) ### Briefly, what does this PR introduce? This adds the inter-MPGD/DIRC aluminum support rails. These are solid aluminum (for now), and somewhat arbitrarily placed due to lack of info on their position relative to the DIRC or MPGD. They are somewhat arbitrarily added to the DIRC as opposed to the MPGD, but I assume ultimately both will need to be connected with another bracket (of minimal X0). The aluminum rails are approximated as a trapezoid that ignores the top 360/48 angle, and that extends to the bottom of the round rail (which isn't implemented here).    TODO: - [ ] fix the inevitable overlaps... ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @mariakzurek @sly2j ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- compact/pid/dirc.xml | 5 +++++ src/DIRC_geo.cpp | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/compact/pid/dirc.xml b/compact/pid/dirc.xml index 8ddaf3bd7..0e3242b5b 100644 --- a/compact/pid/dirc.xml +++ b/compact/pid/dirc.xml @@ -173,6 +173,11 @@ vis="DIRCMCP" /> </module> + <support> + <rail height="78.50*mm" width="46.17*mm" length="DIRCBar_count_z*DIRCBar_length" material="Aluminum"> + <position x="20*mm" y="0" z="0"/> + </rail> + </support> </detector> </detectors> diff --git a/src/DIRC_geo.cpp b/src/DIRC_geo.cpp index 29db0c2ad..d65bd9994 100644 --- a/src/DIRC_geo.cpp +++ b/src/DIRC_geo.cpp @@ -226,6 +226,42 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) det_volume.placeVolume(dirc_module, tr).addPhysVolID("module", i); } + // Construct support + xml_comp_t xml_support = xml_det.child(_U(support)); + Assembly dirc_support("DIRCSupport"); + dirc_support.setVisAttributes(desc.visAttributes(xml_support.visStr())); + + // Rail + xml_comp_t xml_rail = xml_support.child(_Unicode(rail)); + xml_dim_t rail_pos = xml_rail.position(); + double rail_height = xml_rail.height(); + double rail_width2 = xml_rail.width(); + double rail_distance_to_chord2 = rail_width2/2 / tan(dphi/2); + double rail_distance_to_chord1 = rail_distance_to_chord2 - rail_height; + double rail_width1 = 2*rail_distance_to_chord1 * tan(dphi/2); + double rail_length = xml_rail.length(); + Trap rail_trap("rail_trap", rail_length / 2, 0, 0, + rail_height / 2, rail_width1 / 2, rail_width2 / 2, 0, + rail_height / 2, rail_width1 / 2, rail_width2 / 2, 0); + Volume rail_vol("rail_vol", rail_trap, desc.material(xml_rail.materialStr())); + rail_vol.setVisAttributes(desc.visAttributes(xml_rail.visStr())); + + // Place rail + Position rail_position(rail_pos.x(), rail_pos.y(), rail_pos.z()); + RotationZ rail_rotation(-M_PI / 2.); + dirc_support.placeVolume(rail_vol, Transform3D(rail_rotation, rail_position)); + + // Place support + for (int i = 0; i < module_repeat; i++) { + double phi = dphi * i + dphi / 2; + double x = det_ravg * cos(phi); + double y = det_ravg * sin(phi); + + Transform3D tr(RotationZ(phi), Position(x, y, 0)); + det_volume.placeVolume(dirc_support, tr); + } + + return det; } From 0b7957f0b6df2741a4bcd64288c202ede3f6f0d5 Mon Sep 17 00:00:00 2001 From: Alex Jentsch <alexmichaeljentsch@gmail.com> Date: Thu, 29 Feb 2024 13:58:59 -0500 Subject: [PATCH 026/113] one of the FF dipoles had the wrong sign defined - fixed (#646) ### Briefly, what does this PR introduce? Fixes the sign on a FF dipole which was incorrectly set. ### What kind of change does this PR introduce? - [ x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No, it corrects the transport for 100 GeV FF protons. ### Does this PR change default behavior? Yes. --------- Co-authored-by: Alexander Jentsch <ajentsch@bnl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/fields/beamline_10x100.xml | 4 ++-- compact/fields/beamline_5x100.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compact/fields/beamline_10x100.xml b/compact/fields/beamline_10x100.xml index 548ca2ae2..8d9ce5c11 100644 --- a/compact/fields/beamline_10x100.xml +++ b/compact/fields/beamline_10x100.xml @@ -35,7 +35,7 @@ <constant name="B0PF_GradientMax" value="-8.12238283*tesla/m"/> <constant name="B0APF_GradientMax" value="0.0*tesla/m"/> <constant name="Q1APF_GradientMax" value="-44.08979*tesla/m"/> - <constant name="Q1BPF_GradientMax" value="0.0*tesla/m"/> <!-- need to check with Scott on this one --> + <constant name="Q1BPF_GradientMax" value="0.0*tesla/m"/> <constant name="Q2PF_GradientMax" value="12.7764668*tesla/m"/> <constant name="B1PF_GradientMax" value="0.0*tesla/m"/> <constant name="B1APF_GradientMax" value="0.0*tesla/m"/> @@ -44,7 +44,7 @@ <constant name="Q1EF_GradientMax" value="2.127596364*tesla/m"/> <constant name="B0PF_Bmax" value="1.1840539*tesla"/> - <constant name="B0APF_Bmax" value="1.1588921*tesla"/> <!-- need to check with Scott on this one --> + <constant name="B0APF_Bmax" value="-1.1588921*tesla"/> <constant name="Q1APF_Bmax" value="0.0*tesla"/> <constant name="Q1BPF_Bmax" value="0.0*tesla"/> <constant name="Q2PF_Bmax" value="0.0*tesla"/> diff --git a/compact/fields/beamline_5x100.xml b/compact/fields/beamline_5x100.xml index 5e9a18f80..9d8624b6e 100644 --- a/compact/fields/beamline_5x100.xml +++ b/compact/fields/beamline_5x100.xml @@ -35,7 +35,7 @@ <constant name="B0PF_GradientMax" value="-8.12238283*tesla/m"/> <constant name="B0APF_GradientMax" value="0.0*tesla/m"/> <constant name="Q1APF_GradientMax" value="-44.08979*tesla/m"/> - <constant name="Q1BPF_GradientMax" value="0.0*tesla/m"/> <!-- need to check with Scott on this one --> + <constant name="Q1BPF_GradientMax" value="0.0*tesla/m"/> <constant name="Q2PF_GradientMax" value="12.7764668*tesla/m"/> <constant name="B1PF_GradientMax" value="0.0*tesla/m"/> <constant name="B1APF_GradientMax" value="0.0*tesla/m"/> @@ -44,7 +44,7 @@ <constant name="Q1EF_GradientMax" value="2.127596364*tesla/m"/> <constant name="B0PF_Bmax" value="1.1840539*tesla"/> - <constant name="B0APF_Bmax" value="1.1588921*tesla"/> <!-- need to check with Scott on this one --> + <constant name="B0APF_Bmax" value="-1.1588921*tesla"/> <constant name="Q1APF_Bmax" value="0.0*tesla"/> <constant name="Q1BPF_Bmax" value="0.0*tesla"/> <constant name="Q2PF_Bmax" value="0.0*tesla"/> From c50fab778e5ff8fb72c93ad6f89c5b6fe75fbec0 Mon Sep 17 00:00:00 2001 From: John Lajoie <lajoiejg@ornl.gov> Date: Sun, 3 Mar 2024 18:24:06 -0500 Subject: [PATCH 027/113] Updated HCAL parameters and template for comparison with detector table (#588) ### Briefly, what does this PR introduce? ### What kind of change does this PR introduce? - [X] Bug fix (issue #562 ) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? None. The changes here are contained to the barrel HCAL geometry alone, and then only the size of the outer HCAL mother volume. The only actual effect is on the outer HCAL mother volume, which was reduced in size. ### Does this PR change default behavior? No. The actual outer HCAL detector geometry is unchanged. NOTE: This review found that some of the parameters in the Detector Table are incorrect. These changes will allow the proper values to be calculated from the simulation input, but they won't match the Detector Table until that table is updated. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Chao Peng <pengc2010@gmail.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/linux-eic-shell.yml | 2 +- compact/definitions.xml | 28 +- compact/hcal/barrel_gdml.xml | 1114 +------------------ compact/materials.xml | 6 + configurations/craterlake_no_bhcal.yml | 35 - src/BarrelHCalCalorimeter_geo.cpp | 681 +++++------- templates/DetectorParameterTable.csv.jinja2 | 8 +- 7 files changed, 364 insertions(+), 1510 deletions(-) delete mode 100644 configurations/craterlake_no_bhcal.yml diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 58a8d076e..95d847ebf 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -401,7 +401,7 @@ jobs: - build strategy: matrix: - detector_config: [epic_craterlake_no_bhcal, epic_bhcal] + detector_config: [epic_craterlake] fail-fast: false steps: - uses: actions/checkout@v4 diff --git a/compact/definitions.xml b/compact/definitions.xml index 290a7793b..b922d7507 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -608,14 +608,28 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <comment> HcalEndcapN needs to clear the straight beampipe with 1 * crossing angle + its radius of 22.25 mm </comment> <constant name="HcalEndcapN_rmin" value="max((HcalEndcapN_zmin + HcalEndcapN_length) * tan(abs(CrossingAngle)) + 22.25 * mm, 14.0 * cm)"/> - <constant name="HcalBarrel_thickness" value="93.0*cm"/> <!-- ref: as-built CAD, plus a little room for the longer half-plates --> - <constant name="HcalBarrel_rmin" value="Solenoid_rmax"/> - <constant name="HcalBarrel_rmax" value="HcalBarrel_rmin + HcalBarrel_thickness"/> - <constant name="HcalBarrelForward_zmax" value="ForwardServiceGap_zmin"/> - <constant name="HcalBarrelBackward_zmax" value="BackwardServiceGap_zmin"/> - <constant name="HcalBarrel_length" value="HcalBarrelForward_zmax + HcalBarrelBackward_zmax"/> - <constant name="HcalBarrel_offset" value="(HcalBarrelForward_zmax - HcalBarrelBackward_zmax)/2"/> + <documentation> + ## Barrel HCAL Parameters + + Hard-coded numbers are taken from the 3D model for the sPHENIX HCAL, see: + + https://github.com/eic/epic-data/tree/main/barrel_HCAL_gdml + + for 3D model files and FreeCAD projects. + </documentation> + + <constant name="HcalBarrel_thickness" value="86.18*cm"/> + <constant name="HcalBarrel_rmin1" value="183.85*cm"/> + <constant name="HcalBarrel_rmin2" value="HcalBarrel_rmin1 + 10.4*cm"/> + <constant name="HcalBarrel_rmax" value="HcalBarrel_rmin1 + HcalBarrel_thickness"/> + <constant name="HcalBarrelForward_zmax" value="319.625*cm"/> + <constant name="HcalBarrelBackward_zmax" value="HcalBarrelForward_zmax"/> + <constant name="HcalBarrel_length2" value="HcalBarrelForward_zmax + HcalBarrelBackward_zmax"/> + <constant name="HcalBarrel_length1" value="319.0*cm"/> + <constant name="HcalBarrel_offset" value="(HcalBarrelForward_zmax - HcalBarrelBackward_zmax)/2"/> + <constant name="HcalEndcapN_rmax" value="min(HcalBarrel_rmax, 267.0 * cm)"/> + <constant name="LFHCAL_rmax" value="HcalBarrel_rmax"/> <constant name="FluxEndcapN_collar_rmax" value="326.2*cm"/> diff --git a/compact/hcal/barrel_gdml.xml b/compact/hcal/barrel_gdml.xml index 26cb6b0a8..3713d4d5b 100644 --- a/compact/hcal/barrel_gdml.xml +++ b/compact/hcal/barrel_gdml.xml @@ -7,6 +7,7 @@ <detectors> <documentation> ### Barrel Hadronic Calorimeter + ### inner radius parameter to inner plate, -1.8cm to account for combs and outer plate </documentation> <detector id="HcalBarrel_ID" @@ -15,1106 +16,63 @@ readout="HcalBarrelHits" vis="HcalBarrelVis" env_vis="HcalBarrelEnvelopeVis" - rmin1="HcalBarrel_rmin" - rmin2="ForwardServiceGap_rmax - 5.0" + rmin1="HcalBarrel_rmin1" + rmin2="HcalBarrel_rmin2" rmax="HcalBarrel_rmax" - z1="SolenoidBarrel_length" - z2="HcalBarrel_length" + z1="HcalBarrel_length1" + z2="HcalBarrel_length2" calorimeterType="HAD_BARREL"> + <sec_gdmlfile file="gdml/barrel_hcal_steel_sector_nocombs.gdml" url="https://github.com/eic/epic-data/raw/c1ef9dca1781047fe9485eec6c0f986ec7d27f41/barrel_HCAL_gdml/barrel_hcal_steel_sector_nocombs.gdml" cache="$DETECTOR_PATH:/opt/detector" material="Steel1020"/> + <csec_gdmlfile file="gdml/barrel_hcal_steel_chimneysector_nocombs.gdml" url="https://github.com/eic/epic-data/raw/c1ef9dca1781047fe9485eec6c0f986ec7d27f41/barrel_HCAL_gdml/barrel_hcal_steel_chimneysector_nocombs.gdml" cache="$DETECTOR_PATH:/opt/detector" material="Steel1020"/> + <er_gdmlfile file="gdml/barrel_hcal_steel_endring.gdml" url="https://github.com/eic/epic-data/raw/c1ef9dca1781047fe9485eec6c0f986ec7d27f41/barrel_HCAL_gdml/barrel_hcal_steel_endring.gdml" cache="$DETECTOR_PATH:/opt/detector" material="Steel1020"/> + <tile1_gdmlfile file="gdml/Tile01_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile01_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile2_gdmlfile file="gdml/Tile02_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile02_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile3_gdmlfile file="gdml/Tile03_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile03_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile4_gdmlfile file="gdml/Tile04_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile04_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile5_gdmlfile file="gdml/Tile05_Reduced.gdml" url="https://github.com/eic/epic-data/raw/557595947d6423b8925a917c09461654e9df2d45/barrel_HCAL_gdml/tiles/Tile05_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile6_gdmlfile file="gdml/Tile06_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile06_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile7_gdmlfile file="gdml/Tile07_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile07_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile8_gdmlfile file="gdml/Tile08_Reduced.gdml" url="https://github.com/eic/epic-data/raw/582c777d1f17886da4619b1a2b047c507db43672/barrel_HCAL_gdml/tiles/Tile08_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile9_gdmlfile file="gdml/Tile09_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile09_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile10_gdmlfile file="gdml/Tile10_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile10_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile11_gdmlfile file="gdml/Tile11_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile11_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <tile12_gdmlfile file="gdml/Tile12_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/Tile12_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <ctile9_gdmlfile file="gdml/CTile09_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/CTile09_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <ctile10_gdmlfile file="gdml/CTile10_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/CTile10_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <ctile11_gdmlfile file="gdml/CTile11_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/CTile11_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> + <ctile12_gdmlfile file="gdml/CTile12_Reduced.gdml" url="https://github.com/eic/epic-data/raw/2edf54d71b069acb81d969a75717427a0bf77217/barrel_HCAL_gdml/tiles/CTile12_Reduced.gdml" cache="$DETECTOR_PATH:/opt/detector" material="PlasticScint"/> <define> - <matrix name="xposOuter" unit="mm" coldim="1" values="23.6005"/> - <matrix name="yposOuter" unit="mm" coldim="1" values="1802.84"/> + <documentation> + Tile locations and reference locations in the barrel HCAL. + These values adjust the 3D tile models to the correct position, orientation and angle + so they can be placed programmatically within the GDML structure for the HCAL steel. + </documentation> - <matrix name="xposTileS" unit="mm" coldim="1" values="102.707 310.850 520.610 732.802 952.594 1180.725 1418.405 1668.665 1980.199 2267.609 2530.727 2785.926"/> - <matrix name="yposTileS" unit="mm" coldim="1" values="426.850 426.422 427.080 426.818 426.866 426.919 426.976 426.824 482.037 481.908 470.159 432.797"/> - <matrix name="zposTileS" unit="mm" coldim="1" values="-5.4212 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/> + <matrix name="xposOuter" unit="mm" coldim="1" values="18.400271"/> + <matrix name="yposOuter" unit="mm" coldim="1" values="1833.4834"/> - <matrix name="xposTileN" unit="mm" coldim="1" values="-102.707 -310.850 -520.610 -732.802 -952.594 -1180.725 -1418.405 -1668.665 -1980.199 -2267.609 -2530.727 -2785.926"/> - <matrix name="yposTileN" unit="mm" coldim="1" values="426.850 426.422 427.080 426.818 426.866 426.919 426.976 426.824 482.037 481.908 470.159 432.797"/> - <matrix name="zposTileN" unit="mm" coldim="1" values="5.4212 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/> + <matrix name="xposTile" unit="mm" coldim="1" values="102.707 310.850 520.610 732.802 952.594 1180.725 1418.405 1668.665 1977.699 2265.109 2528.227 2783.426"/> + <matrix name="yposTile" unit="mm" coldim="1" values="426.850 426.422 427.080 426.818 426.866 426.919 426.976 426.824 482.037 481.908 470.159 432.797"/> + <matrix name="zposTile" unit="mm" coldim="1" values="-5.4212 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/> <matrix name="xposChimneyTileS" unit="mm" coldim="1" values="2118.192 2425.895 2711.635 2957.924"/> <matrix name="yposChimneyTileS" unit="mm" coldim="1" values="645.634 645.645 642.964 607.790"/> <matrix name="zposChimneyTileS" unit="mm" coldim="1" values="0.0 0.0 0.0 0.0"/> - <constant name="ctilePlaneRotate" unit="deg" value="-14.355"/> <constant name="tilePlaneRotate" unit="deg" value="-14.355"/> - <constant name="csectorRotate" unit="deg" value="6.086"/> - <constant name="sectorRotate" unit="deg" value="6.100"/> - <matrix name="plates_x" unit="mm" coldim="1" values="161.935 118.175 -741.606 -771.303"/> - <matrix name="plates_y" unit="mm" coldim="1" values="2295.048 2267.198 2160.230 2119.176"/> - <matrix name="plates_z" unit="mm" coldim="1" values="235.587 253.54 0.0 0.0"/> - - <!--These offsets are used to tweak the tower and sector positions by ~100um to avoid numerical issues when looking for overlaps--> - <matrix name="tweak_tiles" unit="rad" values="0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/> - <matrix name="tweak_chimney_tiles" unit="rad" values="0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/> - <matrix name="tweak_sectors" unit="rad" values="0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.00008 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.000008"/> - - </define> - - <solids> - - <solid name="HCAL_Chimney_Sector_Half_Plate" material="Steel235" unit="mm" x="-161.935" y="6295.048" z="-235.587"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="-159.6141815185547" y="6253.822265625" z="3158.10009765625"/> - <position name="Mesh2Tess_1" unit="mm" x="-263.16046142578125" y="6641.623046875" z="-3158.10009765625"/> - <position name="Mesh2Tess_2" unit="mm" x="-33.956092834472656" y="5783.20849609375" z="-1493.47998046875"/> - <position name="Mesh2Tess_3" unit="mm" x="-142.97047424316406" y="6254.9873046875" z="1863.727294921875"/> - <position name="Mesh2Tess_4" unit="mm" x="-22.012544631958008" y="5783.45068359375" z="-1493.47998046875"/> - <position name="Mesh2Tess_5" unit="mm" x="-142.97047424316406" y="6254.9873046875" z="3158.10009765625"/> - <position name="Mesh2Tess_6" unit="mm" x="-22.012544631958008" y="5783.45068359375" z="1493.47998046875"/> - <position name="Mesh2Tess_7" unit="mm" x="-263.16046142578125" y="6641.623046875" z="3158.10009765625"/> - <position name="Mesh2Tess_8" unit="mm" x="-33.956092834472656" y="5783.20849609375" z="1493.47998046875"/> - <position name="Mesh2Tess_9" unit="mm" x="-67.99297332763672" y="5910.68310546875" z="-1593.593505859375"/> - <position name="Mesh2Tess_10" unit="mm" x="-67.99297332763672" y="5910.68310546875" z="-3158.10009765625"/> - <position name="Mesh2Tess_11" unit="mm" x="-54.76995086669922" y="5911.15087890625" z="-1593.7491455078125"/> - <position name="Mesh2Tess_12" unit="mm" x="-54.76995086669922" y="5911.15087890625" z="-3158.10009765625"/> - <position name="Mesh2Tess_13" unit="mm" x="-242.1497344970703" y="6641.623046875" z="3158.10009765625"/> - <position name="Mesh2Tess_14" unit="mm" x="-242.1497344970703" y="6641.623046875" z="-3158.10009765625"/> - <position name="Mesh2Tess_15" unit="mm" x="-159.6141815185547" y="6253.822265625" z="1863.0811767578125"/> - </define> - <tessellated name="HCAL_Chimney_Sector_Half_Plate"> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_0" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_7" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_9" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_2" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_9" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_2" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_5" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_12" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_3" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_14" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_12" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_3" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_7" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_5" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_0" type="ABSOLUTE"/> - </tessellated> - </solid> - - <solid name="HCAL_Chimney_Sector_Plate" material="Steel235" unit="mm" x="-118.175" y="6267.198" z="-253.54"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="-45.00990295410156" y="5911.400390625" z="-3120.0"/> - <position name="Mesh2Tess_1" unit="mm" x="-45.00990295410156" y="5911.400390625" z="-1593.4134521484375"/> - <position name="Mesh2Tess_2" unit="mm" x="-178.73770141601562" y="6600.45068359375" z="3120.0"/> - <position name="Mesh2Tess_3" unit="mm" x="-133.2957763671875" y="6255.56982421875" z="3120.0"/> - <position name="Mesh2Tess_4" unit="mm" x="11.838549613952637" y="5791.87548828125" z="1500.0"/> - <position name="Mesh2Tess_5" unit="mm" x="-219.31109619140625" y="6590.8876953125" z="3120.0"/> - <position name="Mesh2Tess_6" unit="mm" x="-16.438724517822266" y="5911.85009765625" z="-1593.74951171875"/> - <position name="Mesh2Tess_7" unit="mm" x="-178.73770141601562" y="6600.45068359375" z="-3120.0"/> - <position name="Mesh2Tess_8" unit="mm" x="-16.438724517822266" y="5911.85009765625" z="-3120.0"/> - <position name="Mesh2Tess_9" unit="mm" x="-219.31109619140625" y="6590.8876953125" z="-3120.0"/> - <position name="Mesh2Tess_10" unit="mm" x="-133.2957763671875" y="6255.56982421875" z="1862.3551025390625"/> - <position name="Mesh2Tess_11" unit="mm" x="-97.87144470214844" y="6257.35205078125" z="1863.7286376953125"/> - <position name="Mesh2Tess_12" unit="mm" x="-14.344938278198242" y="5791.857421875" z="1500.0"/> - <position name="Mesh2Tess_13" unit="mm" x="-97.87144470214844" y="6257.35205078125" z="3120.0"/> - <position name="Mesh2Tess_14" unit="mm" x="11.838549613952637" y="5791.87548828125" z="-1500.0"/> - <position name="Mesh2Tess_15" unit="mm" x="-14.344938278198242" y="5791.857421875" z="-1500.0"/> - </define> - <tessellated name="HCAL_Chimney_Sector_Plate"> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_3" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_13" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_3" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_13" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_14" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_14" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_7" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_12" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_5" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_12" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_5" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_9" type="ABSOLUTE"/> - </tessellated> - </solid> - - <solid name="HCAL_Sector_Half_Plate" material="Steel235" unit="mm" x="741.606" y="6160.230" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="666.5825805664062" y="5657.37109375" z="-1493.47998046875"/> - <position name="Mesh2Tess_1" unit="mm" x="683.9190063476562" y="5788.16796875" z="3158.10009765625"/> - <position name="Mesh2Tess_2" unit="mm" x="802.7377319335938" y="6530.115234375" z="-3158.10009765625"/> - <position name="Mesh2Tess_3" unit="mm" x="677.7097778320312" y="5653.02490234375" z="1493.47998046875"/> - <position name="Mesh2Tess_4" unit="mm" x="677.7097778320312" y="5653.02490234375" z="-1493.47998046875"/> - <position name="Mesh2Tess_5" unit="mm" x="802.7377319335938" y="6530.115234375" z="3158.10009765625"/> - <position name="Mesh2Tess_6" unit="mm" x="683.9190063476562" y="5788.16796875" z="-1593.593505859375"/> - <position name="Mesh2Tess_7" unit="mm" x="783.3263549804688" y="6538.15576171875" z="3158.10009765625"/> - <position name="Mesh2Tess_8" unit="mm" x="696.3145141601562" y="5783.53955078125" z="1593.7491455078125"/> - <position name="Mesh2Tess_9" unit="mm" x="696.3145141601562" y="5783.53955078125" z="3158.10009765625"/> - <position name="Mesh2Tess_10" unit="mm" x="696.3145141601562" y="5783.53955078125" z="-3158.10009765625"/> - <position name="Mesh2Tess_11" unit="mm" x="683.9190063476562" y="5788.16796875" z="1593.593505859375"/> - <position name="Mesh2Tess_12" unit="mm" x="696.3145141601562" y="5783.53955078125" z="-1593.7491455078125"/> - <position name="Mesh2Tess_13" unit="mm" x="783.3263549804688" y="6538.15576171875" z="-3158.10009765625"/> - <position name="Mesh2Tess_14" unit="mm" x="683.9190063476562" y="5788.16796875" z="-3158.10009765625"/> - <position name="Mesh2Tess_15" unit="mm" x="666.5825805664062" y="5657.37109375" z="1493.47998046875"/> </define> - <tessellated name="HCAL_Sector_Half_Plate"> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_0" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_14" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_0" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_9" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_3" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_12" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_2" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_7" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_7" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_13" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_9" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - </tessellated> - </solid> - - <solid name="HCAL_Sector_Plate" material="Steel235" unit="mm" x="771.303" y="6119.176" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="688.0108642578125" y="5657.857421875" z="1500.0"/> - <position name="Mesh2Tess_1" unit="mm" x="731.9955444335938" y="5769.51708984375" z="3120.0"/> - <position name="Mesh2Tess_2" unit="mm" x="845.56689453125" y="6467.81005859375" z="3120.0"/> - <position name="Mesh2Tess_3" unit="mm" x="804.42236328125" y="6474.501953125" z="-3120.0"/> - <position name="Mesh2Tess_4" unit="mm" x="731.9955444335938" y="5769.51708984375" z="1593.74951171875"/> - <position name="Mesh2Tess_5" unit="mm" x="688.0108642578125" y="5657.857421875" z="-1500.0"/> - <position name="Mesh2Tess_6" unit="mm" x="712.2080688476562" y="5647.85400390625" z="-1500.0"/> - <position name="Mesh2Tess_7" unit="mm" x="845.56689453125" y="6467.81005859375" z="-3120.0"/> - <position name="Mesh2Tess_8" unit="mm" x="731.9955444335938" y="5769.51708984375" z="-1593.74951171875"/> - <position name="Mesh2Tess_9" unit="mm" x="705.4271850585938" y="5780.03564453125" z="3120.0"/> - <position name="Mesh2Tess_10" unit="mm" x="731.9955444335938" y="5769.51708984375" z="-3120.0"/> - <position name="Mesh2Tess_11" unit="mm" x="705.4271850585938" y="5780.03564453125" z="1593.4134521484375"/> - <position name="Mesh2Tess_12" unit="mm" x="705.4271850585938" y="5780.03564453125" z="-3120.0"/> - <position name="Mesh2Tess_13" unit="mm" x="705.4271850585938" y="5780.03564453125" z="-1593.4134521484375"/> - <position name="Mesh2Tess_14" unit="mm" x="804.42236328125" y="6474.501953125" z="3120.0"/> - <position name="Mesh2Tess_15" unit="mm" x="712.2080688476562" y="5647.85400390625" z="1500.0"/> - </define> - <tessellated name="HCAL_Sector_Plate"> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_13" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_5" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_6" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_8" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_7" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_10" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_4" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_15" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_0" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_14" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_0" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_13" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_13" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_11" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_14" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_3" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_1" type="ABSOLUTE"/> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_9" type="ABSOLUTE"/> - </tessellated> - </solid> - - <solid name="OuterHCalTile01" material="PlasticScint" unit="mm" x="102.707" y="426.850" z="-5.4212"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="0.5" y="0.0" z="3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="238.98008728027344" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="0.5" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="67.038330078125" y="799.6744995117188" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="166.52439880371094" y="6.134781810156198e-15" z="-3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="67.038330078125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="67.038330078125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="166.52439880371094" y="6.134781810156198e-15" z="3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="138.50833129882812" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="138.50833129882812" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="238.98008728027344" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="138.50833129882812" y="799.6744995117188" z="-3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="138.50833129882812" y="799.6744995117188" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="0.5" y="0.0" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="0.5" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="67.038330078125" y="799.6744995117188" z="-3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile01_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile02" material="PlasticScint" unit="mm" x="310.850" y="426.422" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="484.6166687011719" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="167.52841186523438" y="3.469446951953614e-17" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="484.6166687011719" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="303.5716247558594" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="303.5716247558594" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="338.91033935546875" y="0.0" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="375.0416259765625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="338.91033935546875" y="0.0" z="3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="375.0416259765625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="239.98410034179688" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="375.0416259765625" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="239.98410034179688" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="375.0416259765625" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="167.52841186523438" y="3.469446951953614e-17" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="303.5716247558594" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="303.5716247558594" y="808.344482421875" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile02_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile03" material="PlasticScint" unit="mm" x="520.610" y="427.08" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="339.92645263671875" y="-4.683753385137379e-16" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="543.5171508789062" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="339.92645263671875" y="-4.683753385137379e-16" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="614.9871826171875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="727.8602905273438" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="543.5171508789062" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="507.87432861328125" y="-5.030698080332741e-16" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="543.5171508789062" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="507.87432861328125" y="-5.030698080332741e-16" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="485.6327819824219" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="543.5171508789062" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="614.9871826171875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="614.9871826171875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="485.6327819824219" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="614.9871826171875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="727.8602905273438" y="808.344482421875" z="-3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile03_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile04" material="PlasticScint" unit="mm" x="732.802" y="426.818" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="856.9021606445312" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="856.9021606445312" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="856.9021606445312" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="785.43212890625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="728.8966674804688" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="785.43212890625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="728.8966674804688" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="980.078369140625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="785.43212890625" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="980.078369140625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="508.9106750488281" y="3.5561831257524545e-15" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="785.43212890625" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="683.914306640625" y="3.5214886562329184e-15" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="683.914306640625" y="3.5214886562329184e-15" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="508.9106750488281" y="3.5561831257524545e-15" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="856.9021606445312" y="799.2944946289062" z="-3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile04_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile05" material="PlasticScint" unit="mm" x="952.594" y="426.866" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="1171.66064453125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="1100.1905517578125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="866.001220703125" y="0.0" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="1171.66064453125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="684.9793090820312" y="1.734723475976807e-17" z="-3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="866.001220703125" y="0.0" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="1100.1905517578125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="1100.1905517578125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="1100.1905517578125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="981.1433715820312" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="1240.965087890625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="1240.965087890625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="981.1433715820312" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="1171.66064453125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="1171.66064453125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="684.9793090820312" y="1.734723475976807e-17" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile05_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile06" material="PlasticScint" unit="mm" x="1180.725" y="426.919" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="1511.50146484375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="867.1035766601562" y="4.128641872824801e-15" z="-3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="1511.50146484375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="1295.924560546875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="1242.0673828125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="1054.8138427734375" y="4.128641872824801e-15" z="3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="1054.8138427734375" y="4.128641872824801e-15" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="867.1035766601562" y="4.128641872824801e-15" z="3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="1367.39453125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="1367.39453125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="1242.0673828125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="1295.924560546875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="1367.39453125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="1295.924560546875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="1295.924560546875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="1367.39453125" y="808.344482421875" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile06_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile07" material="PlasticScint" unit="mm" x="1418.405" y="426.976" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="1638.95751953125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="1795.1790771484375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="1795.1790771484375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="1567.487548828125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="1638.95751953125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="1055.96240234375" y="1.0321604682062002e-15" z="3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="1512.6500244140625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="1567.487548828125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="1638.95751953125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="1055.96240234375" y="1.0321604682062002e-15" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="1512.6500244140625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="1567.487548828125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="1638.95751953125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="1252.8128662109375" y="2.048137313163923e-15" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="1252.8128662109375" y="2.048137313163923e-15" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="1567.487548828125" y="799.2944946289062" z="-3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile07_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile08" material="PlasticScint" unit="mm" x="1668.665" y="426.824" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="1852.807861328125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="1852.807861328125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="1462.767822265625" y="0.0" z="-3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="1852.807861328125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="1462.767822265625" y="0.0" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="1254.01708984375" y="3.469446951953614e-17" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="1254.01708984375" y="3.469446951953614e-17" z="3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="1924.27783203125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="1852.807861328125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="1924.27783203125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="1796.38330078125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="1796.38330078125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="1924.27783203125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="2094.974853515625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="2094.974853515625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="1924.27783203125" y="799.2944946289062" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile08_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile09" material="PlasticScint" unit="mm" x="-1980.199" y="482.037" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="-2413.33154296875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="-1560.988525390625" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="-2149.891845703125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="-2096.244384765625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="-2096.244384765625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="-2413.33154296875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="-1795.8123779296875" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="-1795.8123779296875" y="123.9625015258789" z="3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="-1560.988525390625" y="123.9625015258789" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="-2221.36181640625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="-2221.36181640625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="-2221.36181640625" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="-2149.891845703125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="-2149.891845703125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="-2221.36181640625" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="-2149.891845703125" y="808.344482421875" z="-3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile09_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile10" material="PlasticScint" unit="mm" x="-2267.609" y="481.906" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="-2537.161865234375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="-2537.161865234375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="-2414.678466796875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="-2414.678466796875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="-2046.523193359375" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="-2537.161865234375" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="-2046.523193359375" y="123.9625015258789" z="3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="-2537.161865234375" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="-1797.1593017578125" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="-2465.69189453125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="-2750.239501953125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="-2750.239501953125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="-1797.1593017578125" y="123.9625015258789" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="-2465.69189453125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="-2465.69189453125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="-2465.69189453125" y="808.344482421875" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile10_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile11" material="PlasticScint" unit="mm" x="-2530.727" y="470.159" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="-3016.282958984375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="-2774.454833984375" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="-2845.9248046875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="-2774.454833984375" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="-2845.9248046875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="-2289.19580078125" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="-2047.95751953125" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="-2047.95751953125" y="123.9625015258789" z="3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="-2845.9248046875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="-2751.673828125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="-2751.673828125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="-2289.19580078125" y="123.9625015258789" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="-2845.9248046875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="-2774.454833984375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="-2774.454833984375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="-3016.282958984375" y="808.344482421875" z="-3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile11_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalTile12" material="PlasticScint" unit="mm" x="-2785.926" y="432.797" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="-3116.512451171875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="-3116.512451171875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="-3039.54248046875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="-3111.012451171875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="-2290.65478515625" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="-2290.65478515625" y="123.9625015258789" z="3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="-3111.012451171875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="-3116.512451171875" y="519.7784423828125" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="-3116.512451171875" y="519.7784423828125" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="-3111.012451171875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="-3039.54248046875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="-3017.741943359375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="-3039.54248046875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="-3039.54248046875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="-3017.741943359375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="-3111.012451171875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_16" unit="mm" x="-2600.395263671875" y="123.9625015258789" z="-3.5" /> - <position name="Mesh2Tess_17" unit="mm" x="-2600.395263671875" y="123.9625015258789" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalTile12_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_16" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_16" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_17" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_17" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_17" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_16" vertex3="Mesh2Tess_17" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_16" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_17" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_16" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalChimneyTile09" material="PlasticScint" unit="mm" x="2118.192" y="645.632" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="2149.891845703125" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="2221.36181640625" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="2114.95849609375" y="477.66448974609375" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="1837.6192626953125" y="477.66448974609375" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="1837.6192626953125" y="477.66448974609375" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="2413.33154296875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="2096.244384765625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="2096.244384765625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="2149.891845703125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="2413.33154296875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="2221.36181640625" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="2221.36181640625" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="2221.36181640625" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="2149.891845703125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="2114.95849609375" y="477.66448974609375" z="-3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="2149.891845703125" y="799.2944946289062" z="-3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalChimneyTile09_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalChimneyTile10" material="PlasticScint" unit="mm" x="2425.895" y="645.645" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="2414.678466796875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="2414.678466796875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="2537.161865234375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="2537.161865234375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="2116.287353515625" y="477.6445007324219" z="-3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="2410.197021484375" y="477.6445007324219" z="3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="2750.239501953125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="2537.161865234375" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="2465.69189453125" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="2465.69189453125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="2410.197021484375" y="477.6445007324219" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="2750.239501953125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="2465.69189453125" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="2116.287353515625" y="477.6445007324219" z="3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="2537.161865234375" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="2465.69189453125" y="799.2944946289062" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalChimneyTile10_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_15" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_12" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalChimneyTile11" material="PlasticScint" unit="mm" x="2711.635" y="642.964" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="2845.9248046875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="2774.454833984375" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="2774.454833984375" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="2774.454833984375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="2845.9248046875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="3016.282958984375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="3016.282958984375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="2845.9248046875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="2845.9248046875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="2664.947509765625" y="477.6445007324219" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="2411.63134765625" y="477.6445007324219" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="2411.63134765625" y="477.6445007324219" z="3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="2774.454833984375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="2664.947509765625" y="477.6445007324219" z="3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="2751.673828125" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="2751.673828125" y="808.344482421875" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalChimneyTile11_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_4" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_9" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_10" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_13" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - </tessellated> - </solid> - - <solid name="OuterHCalChimneyTile12" material="PlasticScint" unit="mm" x="2957.924" y="607.790" z="0.0"> - <define> - <position name="Mesh2Tess_0" unit="mm" x="3039.54248046875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_1" unit="mm" x="3039.54248046875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_2" unit="mm" x="3116.512451171875" y="519.7784423828125" z="3.5" /> - <position name="Mesh2Tess_3" unit="mm" x="3116.512451171875" y="519.7784423828125" z="-3.5" /> - <position name="Mesh2Tess_4" unit="mm" x="3116.512451171875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_5" unit="mm" x="3111.012451171875" y="799.2944946289062" z="-3.5" /> - <position name="Mesh2Tess_6" unit="mm" x="3111.012451171875" y="799.2944946289062" z="3.5" /> - <position name="Mesh2Tess_7" unit="mm" x="3017.741943359375" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_8" unit="mm" x="3111.012451171875" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_9" unit="mm" x="3111.012451171875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_10" unit="mm" x="3061.598876953125" y="477.66448974609375" z="-3.5" /> - <position name="Mesh2Tess_11" unit="mm" x="2666.427734375" y="477.66448974609375" z="-3.5" /> - <position name="Mesh2Tess_12" unit="mm" x="3116.512451171875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_13" unit="mm" x="3039.54248046875" y="808.344482421875" z="-3.5" /> - <position name="Mesh2Tess_14" unit="mm" x="3061.598876953125" y="477.66448974609375" z="3.5" /> - <position name="Mesh2Tess_15" unit="mm" x="2666.427734375" y="477.66448974609375" z="3.5" /> - <position name="Mesh2Tess_16" unit="mm" x="3017.741943359375" y="808.344482421875" z="3.5" /> - <position name="Mesh2Tess_17" unit="mm" x="3039.54248046875" y="808.344482421875" z="3.5" /> - </define> - - <tessellated aunit="deg" lunit="mm" name="OuterHCalChimneyTile12_EJ200-SOL"> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_16" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_16" vertex3="Mesh2Tess_14" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_17" vertex2="Mesh2Tess_16" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_6" vertex2="Mesh2Tess_1" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_8" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_6" vertex3="Mesh2Tess_2" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_1" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_1" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_17" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_11" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_10" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_0" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_7" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_0" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_0" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_5" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_5" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_9" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_8" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_5" vertex3="Mesh2Tess_6" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_3" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_4" vertex2="Mesh2Tess_2" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_3" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_2" vertex2="Mesh2Tess_14" vertex3="Mesh2Tess_3" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_11" vertex3="Mesh2Tess_10" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_14" vertex2="Mesh2Tess_15" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_7" vertex3="Mesh2Tess_11" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_15" vertex2="Mesh2Tess_16" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_16" vertex2="Mesh2Tess_17" vertex3="Mesh2Tess_13" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_16" vertex2="Mesh2Tess_13" vertex3="Mesh2Tess_7" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_4" vertex3="Mesh2Tess_12" type="ABSOLUTE" /> - <triangular vertex1="Mesh2Tess_8" vertex2="Mesh2Tess_12" vertex3="Mesh2Tess_9" type="ABSOLUTE" /> - </tessellated> - </solid> - - </solids> - </detector> + </detector> </detectors> <!-- Definition of the readout segmentation/definition --> <readouts> <readout name="HcalBarrelHits"> <segmentation type="NoSegmentation"/> - <id>system:8,sector:5,tower:6,tile:3</id> + <id>system:8,eta:5,phi:9</id> </readout> </readouts> diff --git a/compact/materials.xml b/compact/materials.xml index 5424131ac..e8e04d034 100644 --- a/compact/materials.xml +++ b/compact/materials.xml @@ -68,6 +68,12 @@ <fraction n="0.998" ref="Fe"/> <fraction n=".002" ref="C"/> </material> + <material name="Steel1020"> + <D value="7.86" unit="g/cm3"/> + <fraction n="0.993" ref="Fe"/> + <fraction n=".002" ref="C"/> + <fraction n=".005" ref="Mn"/> + </material> <material name="Aluminum5083"> <D value="2.650" unit="g/cm3"/> <fraction n="0.94" ref="Al"/> diff --git a/configurations/craterlake_no_bhcal.yml b/configurations/craterlake_no_bhcal.yml deleted file mode 100644 index 12fa99f03..000000000 --- a/configurations/craterlake_no_bhcal.yml +++ /dev/null @@ -1,35 +0,0 @@ -ebeam: 5 -pbeam: 41 -features: - beampipe: - tracking: - definitions_craterlake: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - support_service_craterlake: - mpgd_outerbarrel: - mpgd_forward_endcap: - mpgd_backward_endcap: - silicon_disks: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - backward: - backward_endcap_flux: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/src/BarrelHCalCalorimeter_geo.cpp b/src/BarrelHCalCalorimeter_geo.cpp index 242db2713..3f53b5374 100644 --- a/src/BarrelHCalCalorimeter_geo.cpp +++ b/src/BarrelHCalCalorimeter_geo.cpp @@ -22,6 +22,8 @@ #include "XML/Layering.h" #include "TVector3.h" +#include "TGDMLParse.h" +#include "FileLoaderHelper.h" using namespace std; using namespace dd4hep; @@ -37,9 +39,6 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s string det_name = x_det.nameStr(); Material air = description.air(); - // get the solids section for this detector - xml_comp_t x_solids = x_det.child("solids"); - DetElement sdet(det_name, det_id); Volume motherVol = description.pickMotherVolume(sdet); @@ -51,86 +50,76 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s double length1 = x_det.z1(); double length2 = x_det.z2(); - std::vector<double> rmins = {rmin2, rmin2, rmin1, rmin1, rmin2, rmin2}; - std::vector<double> rmaxs = {rmax, rmax, rmax, rmax, rmax, rmax}; - std::vector<double> zs = {-length2 / 2., -length1 / 2., -length1 / 2., length1 / 2., length1 / 2., length2 / 2.}; + // 5mm buffer on inner radius to acount for comb angle/tilt + // (allows the combs to be added in later) + std::vector<double> rmins = {rmin2-0.5*cm, rmin2-0.5*cm, rmin1-1.5*cm, rmin1-1.5*cm, rmin2-0.5*cm, rmin2-0.5*cm}; + // 1cm buffer on outer radius to acount for comb angle/tilt + // (allows the combs to be added in later) + std::vector<double> rmaxs = {rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm}; + // leave room for dogbones at the ends (not part of det table) + std::vector<double> zs = {-length2 / 2. - 8.2*cm, -length1 / 2., -length1 / 2., length1 / 2., length1 / 2., length2 / 2. + 8.2*cm}; // printout(WARNING, "BarrelHCalCalorimeter", "%f %f %f %f %f", rmin1, rmin2, rmax, length1/2., length2/2.); Polycone ptube(0.0, 2.0 * M_PI, rmins, rmaxs, zs); - // Tube ptube(rmin1,rmax,length2); Volume envelope(det_name, ptube, air); PlacedVolume env_phv = motherVol.placeVolume(envelope); env_phv.addPhysVolID("system", det_id); sdet.setPlacement(env_phv); - // Storage for sectors and tile assemblies - Assembly ChimneySector("ChimneySector"); - Assembly Sector("Sector"); - Assembly ChimneyTower[4]; - Assembly Tower[24]; - xml_comp_t det_define = x_det.child("define"); // Pick up the constants - double ctilePlaneRotate = 0.0; double tilePlaneRotate = 0.0; - double csectorRotate = 0.0; - double sectorRotate = 0.0; - double tile_tolerance = 0.2; // Tile tolerance in mm to avoid overlaps - // Tile rotation starting points to align with sector plates - double ctileRotateStart = 5.4420 * (360.0 / 320.0) * dd4hep::deg; - double octileRotateStart = 5.4420 * (360.0 / 320.0) * dd4hep::deg; - // double tileRotateStart = 20.38875*(360.0/320.0)*dd4hep::deg + ctileRotateStart; - double tileRotateStart = 20.38675 * (360.0 / 320.0) * dd4hep::deg + ctileRotateStart; + // Sector steel tessellated shape gdml file info + xml_comp_t x_det_sec_gdmlfile = x_det.child("sec_gdmlfile"); + std::string sec_gdml_file = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(file), " ");; + std::string sec_gdml_material = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(material), " "); + std::string sec_gdml_url = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(url), " "); + std::string sec_gdml_cache = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(cache), " "); + + xml_comp_t x_det_csec_gdmlfile = x_det.child("csec_gdmlfile"); + std::string csec_gdml_file = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(file), " ");; + std::string csec_gdml_material = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(material), " "); + std::string csec_gdml_url = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(url), " "); + std::string csec_gdml_cache = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(cache), " "); + + xml_comp_t x_det_er_gdmlfile = x_det.child("er_gdmlfile"); + std::string er_gdml_file = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(file), " ");; + std::string er_gdml_material = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(material), " "); + std::string er_gdml_url = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(url), " "); + std::string er_gdml_cache = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(cache), " "); + + // Loop over the defines section and pick up the tile offsets, ref location and angles for (xml_coll_t i(det_define, _Unicode(constant)); i; ++i) { xml_comp_t x_const = i; std::string const_name = getAttrOrDefault<std::string>(x_const, _Unicode(name), " "); - std::string const_value = getAttrOrDefault<std::string>(x_const, _Unicode(value), " "); - if (const_name == "ctilePlaneRotate") - ctilePlaneRotate = atof(const_value.c_str()); - else if (const_name == "tilePlaneRotate") + if (const_name == "tilePlaneRotate"){ + std::string const_value = getAttrOrDefault<std::string>(x_const, _Unicode(value), " "); tilePlaneRotate = atof(const_value.c_str()); - else if (const_name == "csectorRotate") - csectorRotate = atof(const_value.c_str()); - else if (const_name == "sectorRotate") - sectorRotate = atof(const_value.c_str()); + } else printout(WARNING, "BarrelHCalCalorimeter", "unrecognized <constant> data!"); } - // Loop over the defines section and pick up the tile offsets - std::vector<double> xposOuter; std::vector<double> yposOuter; - std::vector<double> xposTileS; - std::vector<double> yposTileS; - std::vector<double> zposTileS; - - std::vector<double> xposTileN; - std::vector<double> yposTileN; - std::vector<double> zposTileN; + std::vector<double> xposTile; + std::vector<double> yposTile; + std::vector<double> zposTile; std::vector<double> xposChimneyTileS; std::vector<double> yposChimneyTileS; std::vector<double> zposChimneyTileS; - std::vector<double> plates_x; - std::vector<double> plates_y; - std::vector<double> plates_z; - - std::vector<double> tweak_tiles; - std::vector<double> tweak_chimney_tiles; - std::vector<double> tweak_sectors; - for (xml_coll_t i(det_define, _Unicode(matrix)); i; ++i) { xml_comp_t x_mtrx = i; @@ -143,36 +132,18 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s aptr = &xposOuter; else if (mtrx_name == "yposOuter") aptr = &yposOuter; - else if (mtrx_name == "xposTileS") - aptr = &xposTileS; - else if (mtrx_name == "yposTileS") - aptr = &yposTileS; - else if (mtrx_name == "zposTileS") - aptr = &zposTileS; - else if (mtrx_name == "xposTileN") - aptr = &xposTileN; - else if (mtrx_name == "yposTileN") - aptr = &yposTileN; - else if (mtrx_name == "zposTileN") - aptr = &zposTileN; + else if (mtrx_name == "xposTile") + aptr = &xposTile; + else if (mtrx_name == "yposTile") + aptr = &yposTile; + else if (mtrx_name == "zposTile") + aptr = &zposTile; else if (mtrx_name == "xposChimneyTileS") aptr = &xposChimneyTileS; else if (mtrx_name == "yposChimneyTileS") aptr = &yposChimneyTileS; else if (mtrx_name == "zposChimneyTileS") aptr = &zposChimneyTileS; - else if (mtrx_name == "plates_x") - aptr = &plates_x; - else if (mtrx_name == "plates_y") - aptr = &plates_y; - else if (mtrx_name == "plates_z") - aptr = &plates_z; - else if (mtrx_name == "tweak_tiles") - aptr = &tweak_tiles; - else if (mtrx_name == "tweak_chimney_tiles") - aptr = &tweak_chimney_tiles; - else if (mtrx_name == "tweak_sectors") - aptr = &tweak_sectors; else { printout(WARNING, "BarrelHCalCalorimeter", "unknown <matrix> data!"); continue; @@ -189,364 +160,304 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s aptr->push_back(atof(mtrx_values.c_str())); } - // Loop over the solids, create them and add them to the detector volume + // Read in the barrel structure GDML file + // three structures - normal sector, chimney sector, and end rings + Assembly BarrelHCAL("BarrelHCAL"); + TGDMLParse parser; + + // sector + EnsureFileFromURLExists(sec_gdml_url, sec_gdml_file, sec_gdml_cache); + if (!fs::exists(fs::path(sec_gdml_file))) { + printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + sec_gdml_file + " does not exist"); + printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + std::_Exit(EXIT_FAILURE); + } - for (xml_coll_t k(x_solids, _Unicode(solid)); k; ++k) { + Volume barrel_sector_vol = parser.GDMLReadFile(sec_gdml_file.c_str()); + if(!barrel_sector_vol.isValid()){ + printout(WARNING, "BarrelHCalCalorimeter", "%s", sec_gdml_file.c_str()); + printout(WARNING, "BarrelHCalCalorimeter", "barrel_sector_vol invalid, GDML parser failed!"); + std::_Exit(EXIT_FAILURE); + } + barrel_sector_vol.import(); + barrel_sector_vol.setVisAttributes(description, x_det.visStr()); + TessellatedSolid barrel_sector_solid = barrel_sector_vol.solid(); + barrel_sector_solid->CloseShape(true, true, true); // tesselated solid not closed by import! + Material sector_material = description.material(sec_gdml_material.c_str()); + barrel_sector_vol.setMaterial(sector_material); + + // chimney sector + EnsureFileFromURLExists(csec_gdml_url, csec_gdml_file, csec_gdml_cache); + if (!fs::exists(fs::path(csec_gdml_file))) { + printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + csec_gdml_file + " does not exist"); + printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + std::_Exit(EXIT_FAILURE); + } - xml_comp_t x_solid = k; + Volume barrel_csector_vol = parser.GDMLReadFile(csec_gdml_file.c_str()); + if(!barrel_csector_vol.isValid()){ + printout(WARNING, "BarrelHCalCalorimeter", "%s", csec_gdml_file.c_str()); + printout(WARNING, "BarrelHCalCalorimeter", "barrel_csector_vol invalid, GDML parser failed!"); + std::_Exit(EXIT_FAILURE); + } + barrel_csector_vol.import(); + barrel_csector_vol.setVisAttributes(description, x_det.visStr()); + TessellatedSolid barrel_csector_solid = barrel_csector_vol.solid(); + barrel_csector_solid->CloseShape(true, true, true); // tesselated solid not closed by import! + Material csector_material = description.material(csec_gdml_material.c_str()); + barrel_csector_vol.setMaterial(csector_material); + + // end ring + EnsureFileFromURLExists(er_gdml_url, er_gdml_file, er_gdml_cache); + if (!fs::exists(fs::path(er_gdml_file))) { + printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + er_gdml_file + " does not exist"); + printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + std::_Exit(EXIT_FAILURE); + } - // get the sector solid definitions - xml_comp_t define = x_solid.child("define"); - xml_comp_t tessellated = x_solid.child("tessellated"); + Volume barrel_er_vol = parser.GDMLReadFile(er_gdml_file.c_str()); + if(!barrel_er_vol.isValid()){ + printout(WARNING, "BarrelHCalCalorimeter", "%s", er_gdml_file.c_str()); + printout(WARNING, "BarrelHCalCalorimeter", "barrel_er_vol invalid, GDML parser failed!"); + std::_Exit(EXIT_FAILURE); + } + barrel_er_vol.import(); + barrel_er_vol.setVisAttributes(description, x_det.visStr()); + TessellatedSolid barrel_er_solid = barrel_er_vol.solid(); + barrel_er_solid->CloseShape(true, true, true); // tesselated solid not closed by import! + Material er_material = description.material(er_gdml_material.c_str()); + barrel_er_vol.setMaterial(er_material); - std::string solid_name = getAttrOrDefault<std::string>(x_solid, _Unicode(name), " "); - std::string solidMatString = getAttrOrDefault<std::string>(x_solid, _Unicode(material), " "); - Material solid_material = description.material(solidMatString); + // Place steel in envelope - double offset_x = atof(getAttrOrDefault<std::string>(x_solid, _Unicode(x), "0").c_str()) * dd4hep::mm; - double offset_y = atof(getAttrOrDefault<std::string>(x_solid, _Unicode(y), "0").c_str()) * dd4hep::mm; - double offset_z = atof(getAttrOrDefault<std::string>(x_solid, _Unicode(z), "0").c_str()) * dd4hep::mm; + double sec_rot_angle = 360.0/32.0; - // Get the vertices - std::vector<Tessellated::Vertex_t> vertices; - for (xml_coll_t j(define, _Unicode(position)); j; ++j) { - xml_comp_t pos = j; + for(int k=0; k<29; k++){ + BarrelHCAL.placeVolume(barrel_sector_vol, k, Transform3D(RotationZ(-k*sec_rot_angle*dd4hep::deg)*RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); + } + BarrelHCAL.placeVolume(barrel_csector_vol, 0, Transform3D(RotationZ(sec_rot_angle*dd4hep::deg)*RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume(barrel_csector_vol, 1, Transform3D(RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume(barrel_csector_vol, 2, Transform3D(RotationZ(-sec_rot_angle*dd4hep::deg)*RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume(barrel_er_vol, 0, Transform3D(RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume(barrel_er_vol, 1, Transform3D(RotationY(0.0* dd4hep::deg),Translation3D(0, 0, 0))); - // create the vertex point + // Loop over the tile solids, create them and add them to the detector volume - double xp = atof(getAttrOrDefault<std::string>(pos, _Unicode(x), "0").c_str()) * dd4hep::mm - offset_x; - double yp = atof(getAttrOrDefault<std::string>(pos, _Unicode(y), "0").c_str()) * dd4hep::mm - offset_y; - double zp = atof(getAttrOrDefault<std::string>(pos, _Unicode(z), "0").c_str()) * dd4hep::mm - offset_z; + Volume Tile[12]; + Volume ChimneyTile[4]; - // for the sector plates we perform a rotation around y - the chimney cutout should be in the - // electron arm + for(int j=1; j<17; j++){ - if ((solid_name == "HCAL_Chimney_Sector_Half_Plate") || (solid_name == "HCAL_Chimney_Sector_Plate") || - (solid_name == "HCAL_Sector_Half_Plate") || (solid_name == "HCAL_Sector_Plate")) { - xp = -xp; - zp = -zp; - } + std::string gdmlname; + std::string solid_name; - Tessellated::Vertex_t thisPoint(xp, yp, zp); + if(j<13){ - vertices.push_back(thisPoint); - } + // standard tiles - TessellatedSolid solid(solid_name.c_str(), vertices); + gdmlname = _toString(j,"tile%d_gdmlfile"); + solid_name = _toString(j,"OuterHCalTile%02d"); - for (xml_coll_t i(tessellated, _Unicode(triangular)); i; ++i) { - xml_comp_t triang = i; + } + else{ - int vtx1 = -1; - int vtx2 = -1; - int vtx3 = -1; + // chimney tiles - std::string facetName1 = getAttrOrDefault<std::string>(triang, _Unicode(vertex1), " "); - std::string facetName2 = getAttrOrDefault<std::string>(triang, _Unicode(vertex2), " "); - std::string facetName3 = getAttrOrDefault<std::string>(triang, _Unicode(vertex3), " "); + gdmlname = _toString(j-4,"ctile%d_gdmlfile"); + solid_name = _toString(j-4,"OuterHCalChimneyTile%02d"); - // Search the define collection to match things up - int idx = 0; - for (xml_coll_t j(define, _Unicode(position)); j; ++j) { - xml_comp_t pos = j; - std::string posName = getAttrOrDefault<std::string>(pos, _Unicode(name), " "); + } - if (posName == facetName1) - vtx1 = idx; - if (posName == facetName2) - vtx2 = idx; - if (posName == facetName3) - vtx3 = idx; + // tile shape gdml file info + xml_comp_t x_det_tgdmlfile = x_det.child(gdmlname); - if ((vtx1 >= 0) && (vtx2 >= 0) && (vtx3 >= 0)) - break; + std::string tgdml_file = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(file), " ");; + std::string tgdml_material = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(material), " "); + std::string tgdml_url = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(url), " "); + std::string tgdml_cache = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(cache), " "); - idx++; - } + EnsureFileFromURLExists(tgdml_url, tgdml_file, tgdml_cache); + if (!fs::exists(fs::path(tgdml_file))) { + printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + tgdml_file + " does not exist"); + printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + std::_Exit(EXIT_FAILURE); + } - // Add the facet to the solid + Volume solidVolume = parser.GDMLReadFile(tgdml_file.c_str()); + if(!solidVolume.isValid()){ + printout(WARNING, "BarrelHCalCalorimeter_geo", "%s", tgdml_file.c_str()); + printout(WARNING, "BarrelHCalCalorimeter_geo", "solidVolume invalid, GDML parser failed!"); + std::_Exit(EXIT_FAILURE); + } + solidVolume.import(); + solidVolume.setVisAttributes(description, x_det.visStr()); + TessellatedSolid volume_solid = solidVolume.solid(); + volume_solid->CloseShape(true, true, true); // tesselated solid not closed by import! + Material tile_material = description.material(tgdml_material.c_str()); + solidVolume.setMaterial(tile_material); - if ((vtx1 >= 0) && (vtx2 >= 0) && (vtx3 >= 0) && (vtx1 != vtx2) && (vtx1 != vtx3) && (vtx2 != vtx3)) { + solidVolume.setSensitiveDetector(sens); - solid->AddFacet(vtx1, vtx2, vtx3); + // For tiles we build an assembly to get the full array of tiles + // Offsets and rotation are to properly orient the tiles in the assembly. - } else - printout(WARNING, "BarrelHCalCalorimeter", "bad facet! %d %d %d", vtx1, vtx2, vtx3); - } + if (solid_name.size() > 0) { - // Complete the shape - solid->CloseShape(true, true, true); + std::string type = solid_name.substr(0, solid_name.size() - 2); - Volume solidVolume(solid_name, solid, solid_material); - solidVolume.setVisAttributes(description, x_det.visStr()); + if (type == "OuterHCalTile" || type == "OuterHCalChimneyTile") { - // printout(WARNING, "BarrelHCalCalorimeter", "tesselated solid name %s", solid_name.c_str()); + std::string stnum = solid_name.substr(solid_name.size() - 2, solid_name.size()); + int tnum = atoi(stnum.c_str()) - 1; - if (solid_name == "HCAL_Chimney_Sector_Half_Plate") { + // Tile numbers are indexed by the center (eta=0) out, we want them starting zero at one end. - ChimneySector.placeVolume( - solidVolume, 0, - RotationZ(csectorRotate * dd4hep::deg) * - Transform3D(RotationZ(0.0), - Translation3D(plates_x[0] * dd4hep::mm, plates_y[0] * dd4hep::mm, plates_z[0] * dd4hep::mm))); + if (type == "OuterHCalTile") { - ChimneySector.placeVolume( - solidVolume, 1, - RotationZ((9.60 * 2 * M_PI / 320) + csectorRotate * dd4hep::deg) * - Transform3D(RotationZ(0.0), - Translation3D(plates_x[0] * dd4hep::mm, plates_y[0] * dd4hep::mm, plates_z[0] * dd4hep::mm))); + Tile[11-tnum] = solidVolume; - } else if (solid_name == "HCAL_Chimney_Sector_Plate") { + } + else if ((tnum > 7) && (type == "OuterHCalChimneyTile")) { - for (int i = 0; i < 9; i++) - ChimneySector.placeVolume( - solidVolume, i, - RotationZ((i * 2 * M_PI / 320) + csectorRotate * dd4hep::deg) * - Transform3D(RotationZ(0.0), Translation3D(plates_x[1] * dd4hep::mm, plates_y[1] * dd4hep::mm, - plates_z[1] * dd4hep::mm))); + ChimneyTile[11-tnum] = solidVolume; - } else if (solid_name == "HCAL_Sector_Half_Plate") { - - Sector.placeVolume( - solidVolume, 0, - RotationZ(sectorRotate * dd4hep::deg) * - Transform3D(RotationZ(0.4 * dd4hep::deg), - Translation3D(plates_x[2] * dd4hep::mm, plates_y[2] * dd4hep::mm, plates_z[2] * dd4hep::mm))); - - Sector.placeVolume( - solidVolume, 1, - RotationZ((9.60 * 2 * M_PI / 320) + sectorRotate * dd4hep::deg) * - Transform3D(RotationZ(0.4 * dd4hep::deg), - Translation3D(plates_x[2] * dd4hep::mm, plates_y[2] * dd4hep::mm, plates_z[2] * dd4hep::mm))); - - } else if (solid_name == "HCAL_Sector_Plate") { - - for (int i = 0; i < 9; i++) - Sector.placeVolume(solidVolume, i, - RotationZ((i * 2 * M_PI / 320) + sectorRotate * dd4hep::deg) * - Transform3D(RotationZ(0.4 * dd4hep::deg), - Translation3D(plates_x[3] * dd4hep::mm, plates_y[3] * dd4hep::mm, - plates_z[3] * dd4hep::mm))); - - } else { - - // If it's not sectors then it's a tile - for these we build an assembly to get the full array of tiles - // Offsets and rotation are to properly orient the tiles in the assembly. - - if (solid_name.size() > 0) { - - std::string type = solid_name.substr(0, solid_name.size() - 2); - - if (type == "OuterHCalTile" || type == "OuterHCalChimneyTile") { - - std::string stnum = solid_name.substr(solid_name.size() - 2, solid_name.size()); - int tnum = atoi(stnum.c_str()) - 1; - - Assembly TempTower1(_toString(11 - tnum, "Tower%i")); - Assembly TempTower2(_toString(12 + tnum, "Tower%i")); - - solidVolume.setSensitiveDetector(sens); - - DetElement tile_det("tile0", det_id); - - if (type == "OuterHCalTile") { - - Tower[11 - tnum] = TempTower1; - Tower[12 + tnum] = TempTower2; - - for (int i = 0; i < 5; i++) { - - if (tnum < 8) { - - PlacedVolume phv0 = Tower[11 - tnum].placeVolume( - solidVolume, i, - RotationZ(octileRotateStart + i * (360.0 / 320.0) * dd4hep::deg) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Transform3D(RotationY(0.0), - Translation3D((xposTileS[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTileS[tnum] * dd4hep::mm, zposTileS[tnum] * dd4hep::mm))); - - phv0.addPhysVolID("tile", i); - DetElement sd0 = tile_det.clone(_toString(i + (11 - tnum) * 10, "tile%d")); - sd0.setPlacement(phv0); - sdet.add(sd0); - - PlacedVolume phv1 = Tower[12 + tnum].placeVolume( - solidVolume, i + 5, - RotationZ(octileRotateStart + i * (360.0 / 320.0) * dd4hep::deg) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Transform3D(RotationY(180.0 * dd4hep::deg), - Translation3D((xposTileN[tnum] - (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTileN[tnum] * dd4hep::mm, zposTileN[tnum] * dd4hep::mm))); - phv1.addPhysVolID("tile", i); - DetElement sd1 = tile_det.clone(_toString(i + 5 + (12 + tnum) * 10, "tile%d")); - sd1.setPlacement(phv1); - sdet.add(sd1); - - } else { - - PlacedVolume phv0 = Tower[11 - tnum].placeVolume( - solidVolume, i, - RotationZ(octileRotateStart + i * (360.0 / 320.0) * dd4hep::deg) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Transform3D(RotationY(180.0 * dd4hep::deg), - Translation3D((xposTileS[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTileS[tnum] * dd4hep::mm, zposTileS[tnum] * dd4hep::mm))); - - phv0.addPhysVolID("tile", i); - DetElement sd0 = tile_det.clone(_toString(i + (11 - tnum) * 10, "tile%d")); - sd0.setPlacement(phv0); - sdet.add(sd0); - - PlacedVolume phv1 = Tower[12 + tnum].placeVolume( - solidVolume, i + 5, - RotationZ(octileRotateStart + i * (360.0 / 320.0) * dd4hep::deg) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Transform3D(RotationY(0.0), - Translation3D((xposTileN[tnum] - (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTileN[tnum] * dd4hep::mm, zposTileN[tnum] * dd4hep::mm))); - phv1.addPhysVolID("tile", i); - DetElement sd1 = tile_det.clone(_toString(i + 5 + (12 + tnum) * 10, "tile%d")); - sd1.setPlacement(phv1); - sdet.add(sd1); - } - } - } - - if ((tnum > 7) && (type == "OuterHCalChimneyTile")) { - - Assembly TempChimneyTower1(_toString(11 - tnum, "ChimneyTower%i")); - ChimneyTower[11 - tnum] = TempChimneyTower1; - - for (int i = 0; i < 5; i++) { - - PlacedVolume phv = ChimneyTower[11 - tnum].placeVolume( - solidVolume, i, - RotationZ(ctileRotateStart + i * (360.0 / 320.0) * dd4hep::deg) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-ctilePlaneRotate * dd4hep::deg) * - Transform3D(RotationY(0.0), - Translation3D((xposChimneyTileS[tnum - 8] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposChimneyTileS[tnum - 8] * dd4hep::mm, - zposChimneyTileS[tnum - 8] * dd4hep::mm))); - phv.addPhysVolID("tile", i); - DetElement sd = tile_det.clone(_toString(i + (11 - tnum) * 10 + 480, "tile%d")); - sd.setPlacement(phv); - sdet.add(sd); - } - } - - } else - printout(WARNING, "BarrelHCalCalorimeter", "invalid solid_name, not a tile type?"); + } } else - printout(WARNING, "BarrelHCalCalorimeter", "solid_name.size() invalid! "); - } - } + printout(WARNING, "BarrelHCalCalorimeter", "invalid solid_name, not a tile type?"); - // Place the sector tile assemblies into the sectors - - sens.setType("calorimeter"); - - DetElement tower_det("tower0", det_id); - - // special chimney sector towers - for (int i = 0; i < 4; i++) { - - PlacedVolume tower_phv0 = ChimneySector.placeVolume( - ChimneyTower[i], i, Transform3D(RotationZ(tweak_chimney_tiles[i]), Translation3D(0.0, 0.0, 0.0))); - tower_phv0.addPhysVolID("tower", i); // lower phi - DetElement sd0 = tower_det.clone(_toString(i, "tower%d")); - sd0.setPlacement(tower_phv0); - sdet.add(sd0); - - PlacedVolume tower_phv1 = - ChimneySector.placeVolume(ChimneyTower[i], i + 24, - Transform3D(RotationZ(5 * (360.0 / 320.0) * dd4hep::deg + tweak_chimney_tiles[i]), - Translation3D(0.0, 0.0, 0.0))); - tower_phv1.addPhysVolID("tower", i+24); // upper phi - DetElement sd1 = tower_det.clone(_toString(i + 24, "tower%d")); - sd1.setPlacement(tower_phv1); - sdet.add(sd1); + } else + printout(WARNING, "BarrelHCalCalorimeter", "solid_name.size() invalid! "); } - // ordinary towers in chimney sectors - for (int i = 4; i < 24; i++) { - - PlacedVolume tower_phv0 = ChimneySector.placeVolume( - Tower[i], i, Transform3D(RotationZ(tweak_chimney_tiles[i]), Translation3D(0.0, 0.0, 0.0))); - tower_phv0.addPhysVolID("tower", i); // lower phi - DetElement sd0 = tower_det.clone(_toString(i, "tower%d")); - sd0.setPlacement(tower_phv0); - sdet.add(sd0); - - PlacedVolume tower_phv1 = - ChimneySector.placeVolume(Tower[i], i + 24, - Transform3D(RotationZ(5 * (360.0 / 320.0) * dd4hep::deg + tweak_chimney_tiles[i]), - Translation3D(0.0, 0.0, 0.0))); - tower_phv1.addPhysVolID("tower", i+24); // upper phi - DetElement sd1 = tower_det.clone(_toString(i + 24, "tower%d")); - sd1.setPlacement(tower_phv1); - sdet.add(sd1); - } + // Place the tiles into the calorimeter volume - // ordinary sectors - for (int i = 0; i < 24; i++) { - - PlacedVolume tower_phv0 = Sector.placeVolume( - Tower[i], i + 24, - Transform3D(RotationZ(tileRotateStart - octileRotateStart + tweak_tiles[i]), Translation3D(0.0, 0.0, 0.0))); - tower_phv0.addPhysVolID("tower", i); // lower phi - DetElement sd0 = tower_det.clone(_toString(i + 48, "tower%d")); - sd0.setPlacement(tower_phv0); - sdet.add(sd0); - - PlacedVolume tower_phv1 = Sector.placeVolume( - Tower[i], i + 48, - Transform3D(RotationZ(tileRotateStart - octileRotateStart + 5 * (360.0 / 320.0) * dd4hep::deg + tweak_tiles[i]), - Translation3D(0.0, 0.0, 0.0))); - tower_phv1.addPhysVolID("tower", i+24); // upper phi - DetElement sd1 = tower_det.clone(_toString(i + 72, "tower%d")); - sd1.setPlacement(tower_phv1); - sdet.add(sd1); - } + double increment_angle = (360.0/320.0)*dd4hep::deg; + double increment_offset = -10.01*increment_angle; - // Place the sectors into the envelope + DetElement tile_det("eta0 phi0", det_id); + sens.setType("calorimeter"); - DetElement sector_det("sector0", det_id); + for (int i_eta = 0; i_eta < 12; i_eta++) { // eta ring + + int tnum = 11 - i_eta; + + for (int i_phi = 0; i_phi < 320; i_phi++) { // phi index + + if (i_eta > 3) { + + // ordinary sector tiles + + PlacedVolume phv1 = BarrelHCAL.placeVolume( + Tile[i_eta], i_phi + i_eta * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D(RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Transform3D(RotationY(180.0 * dd4hep::deg), + Translation3D(-(xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, -zposTile[tnum] * dd4hep::mm))); + + phv1.addPhysVolID("eta",i_eta).addPhysVolID("phi",i_phi); + DetElement sd1 = tile_det.clone(_toString(i_eta, "eta%d ")+_toString(i_phi, "phi%d")); + sd1.setPlacement(phv1); + sdet.add(sd1); + + PlacedVolume phv0 = BarrelHCAL.placeVolume( + Tile[i_eta], i_phi + (12 + tnum) * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D(RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); + + phv0.addPhysVolID("eta",(12+tnum)).addPhysVolID("phi", i_phi); + DetElement sd0 = tile_det.clone(_toString((12+tnum), "eta%d ")+_toString(i_phi, "phi%d")); + sd0.setPlacement(phv0); + sdet.add(sd0); + + + } else { + + // first three sectors are chimney sectors + + if(i_phi>29){ + + // ordinary sector tiles + + PlacedVolume phv1 = BarrelHCAL.placeVolume( + Tile[i_eta], i_phi + i_eta * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D(RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); + + phv1.addPhysVolID("eta", i_eta).addPhysVolID("phi", i_phi); + DetElement sd1 = tile_det.clone(_toString(i_eta, "eta%d ")+_toString(i_phi, "phi%d")); + sd1.setPlacement(phv1); + sdet.add(sd1); + + PlacedVolume phv0 = BarrelHCAL.placeVolume( + Tile[i_eta], i_phi + (12 + tnum) * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D(RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Transform3D(RotationY(180.0 * dd4hep::deg), + Translation3D(-(xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, -zposTile[tnum] * dd4hep::mm))); + + phv0.addPhysVolID("eta", (12 + tnum)).addPhysVolID("phi", i_phi); + DetElement sd0 = tile_det.clone(_toString((12+tnum), "eta%d ")+_toString(i_phi, "phi%d")); + sd0.setPlacement(phv0); + sdet.add(sd0); + + } + else{ + + // chimney sector tile + + PlacedVolume phv1 = BarrelHCAL.placeVolume( + ChimneyTile[i_eta], i_phi + (12 + tnum) * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D(RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposChimneyTileS[tnum-8] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposChimneyTileS[tnum-8] * dd4hep::mm, zposChimneyTileS[tnum-8] * dd4hep::mm)); + + + phv1.addPhysVolID("eta", (12 + tnum)).addPhysVolID("phi", i_phi); + DetElement sd1 = tile_det.clone(_toString((12+tnum), "eta%d ")+_toString(i_phi, "phi%d")); + sd1.setPlacement(phv1); + sdet.add(sd1); + + PlacedVolume phv0 = BarrelHCAL.placeVolume( + Tile[i_eta], i_phi + i_eta * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D(RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); + + phv0.addPhysVolID("eta", i_eta).addPhysVolID("phi", i_phi); + DetElement sd0 = tile_det.clone(_toString(i_eta, "eta%d ")+_toString(i_phi, "phi%d")); + sd0.setPlacement(phv0); + sdet.add(sd0); + + } - // Chimney sectors - for (int i = -1; i < 2; i++) { - PlacedVolume sect_phv = envelope.placeVolume( - ChimneySector, i + 1, - Transform3D(RotationZ(((i - 1) * 2 * M_PI / 32) + tweak_sectors[i + 1]), Translation3D(0, 0, 0))); - sect_phv.addPhysVolID("sector", i + 1); - DetElement sd = sector_det.clone(_toString(i + 1, "sector%d")); - sd.setPlacement(sect_phv); - sdet.add(sd); + } + } } - // Normal sectors - - for (int i = 3; i < 32; i++) { - PlacedVolume sect_phv = - envelope.placeVolume(Sector, i, - Transform3D(RotationZ((-2.075 * M_PI / 32) + (i - 3) * (2 * M_PI / 32) + tweak_sectors[i]), - Translation3D(0, 0, 0))); - sect_phv.addPhysVolID("sector", i); - DetElement sd = sector_det.clone(_toString(i, "sector%d")); - sd.setPlacement(sect_phv); - sdet.add(sd); - } + // Place the detector into the envelope + + envelope.placeVolume(BarrelHCAL, 0, Transform3D(RotationZ(0.0),Translation3D(0, 0, 0))); std::string env_vis = getAttrOrDefault<std::string>(x_det, _Unicode(env_vis), "HcalBarrelEnvelopeVis"); envelope.setAttributes(description, x_det.regionStr(), x_det.limitsStr(), env_vis); diff --git a/templates/DetectorParameterTable.csv.jinja2 b/templates/DetectorParameterTable.csv.jinja2 index 43720830f..a247fb06d 100644 --- a/templates/DetectorParameterTable.csv.jinja2 +++ b/templates/DetectorParameterTable.csv.jinja2 @@ -9,10 +9,10 @@ CENTRAL DETECTOR,Dual RICH,Detector Section,,{{DRICH_rmin0}},,,, CENTRAL DETECTOR,Dual RICH,Aerogel Section,,{{DRICH_rmin0}},,,, CENTRAL DETECTOR,HD Time of Flight/Tracker,,,,,,, CENTRAL DETECTOR,Barrel Flux Return,,,,,,, -CENTRAL DETECTOR,Barrel Hadron Calorimeter,,{{HcalBarrel_length}},{{HcalBarrel_rmin}},{{HcalBarrel_rmax}},,-{{HcalBarrelBackward_zmax}},{{HcalBarrelForward_zmax}} -CENTRAL DETECTOR,Barrel Hadron Calorimeter,HD Section,,,,,, -CENTRAL DETECTOR,Barrel Hadron Calorimeter,Central Section,,,,,, -CENTRAL DETECTOR,Barrel Hadron Calorimeter,LD Section,,,,,, +CENTRAL DETECTOR,Barrel Hadron Calorimeter,,{{HcalBarrel_length2}},{{HcalBarrel_rmin1}},{{HcalBarrel_rmax}},{{HcalBarrel_offset}},-{{HcalBarrelBackward_zmax-HcalBarrel_offset}},{{HcalBarrelForward_zmax+HcalBarrel_offset}} +CENTRAL DETECTOR,Barrel Hadron Calorimeter,HD Section,,{{HcalBarrel_length2-HcalBarrel_length1}},{{HcalBarrel_rmin2}},{{HcalBarrel_rmax}},{{HcalBarrel_length1/4+HcalBarrel_offset}},{{HcalBarrel_length1/2+HcalBarrel_offset}},{{HcalBarrelForward_zmax+HcalBarrel_offset}} +CENTRAL DETECTOR,Barrel Hadron Calorimeter,Central Section,,{{HcalBarrel_length1}},{{HcalBarrel_rmin1}},{{HcalBarrel_rmax}},{{HcalBarrel_offset}},-{{HcalBarrel_length1/2-HcalBarrel_offset}},{{HcalBarrel_length1/2+HcalBarrel_offset}} +CENTRAL DETECTOR,Barrel Hadron Calorimeter,LD Section,,{{HcalBarrel_length2-HcalBarrel_length1}},{{HcalBarrel_rmin2}},{{HcalBarrel_rmax}},-{{HcalBarrel_length1/4-HcalBarrel_offset}},-{{HcalBarrel_length1/2-HcalBarrel_offset}},-{{HcalBarrelBackward_zmax-HcalBarrel_offset}} CENTRAL DETECTOR,Solenoid Magnet,,{{Solenoid_length}},{{Solenoid_rmin}},{{Solenoid_rmax}},,-{{SolenoidBackward_zmax}},{{SolenoidForward_zmax}} CENTRAL DETECTOR,Barrel HD EMCal Support,,,,,,, CENTRAL DETECTOR,Barrel HD EMCal Support,Exterior Plate,,,,,, From c43dd30451204cf86e6643a9ffddfe58505cc386 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 3 Mar 2024 23:09:47 -0500 Subject: [PATCH 028/113] Delete configurations/hcal_gdml.yml (#634) ### Briefly, what does this PR introduce? Removes configuration that was used when hcal_gdml was introduced and was not the default option. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? Only to users who somehow rely on hcal_gdml configuration. ### Does this PR change default behavior? No --- configurations/hcal_gdml.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 configurations/hcal_gdml.yml diff --git a/configurations/hcal_gdml.yml b/configurations/hcal_gdml.yml deleted file mode 100644 index be6b29100..000000000 --- a/configurations/hcal_gdml.yml +++ /dev/null @@ -1,28 +0,0 @@ -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - barrel_gdml: - far_forward: - far_forward: - far_backward: - far_backward: From c228cbf01c5ad4f931ef01a92f58d47ccf26a175 Mon Sep 17 00:00:00 2001 From: Maria Zurek <33816222+mariakzurek@users.noreply.github.com> Date: Sun, 3 Mar 2024 22:09:56 -0600 Subject: [PATCH 029/113] Adjust the length of BIC according to the newest baseline (#648) ### Briefly, what does this PR introduce? Updated dimensions of the Barrel ECal: Length w/o EoSB (end of sector box): 436.5 cm Total length w/ EoSB: 466.5 cm Length in h-going direction: 215 cm (Sector) + 15 cm (EoSB) Length in e-going direction: 221.5 cm + 15 cm (EoSB) Center offset: -38.75 cm h-going: +176.25 cm h-going + box: +191.25 cm e-going: -260.25 cm e-going + box: -275.25 cm ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @wdconinc @veprbl ### Does this PR introduce breaking changes? What changes might users need to make to their code? no ### Does this PR change default behavior? yes --------- Co-authored-by: Maria <zurek@anl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/ecal/barrel_interlayers.xml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compact/ecal/barrel_interlayers.xml b/compact/ecal/barrel_interlayers.xml index 2c15693ef..d245976bf 100644 --- a/compact/ecal/barrel_interlayers.xml +++ b/compact/ecal/barrel_interlayers.xml @@ -19,12 +19,18 @@ </comment> <!-- Number of imaging layer slots --> <constant name="EcalBarrelImagingLayers_nMax" value="6"/> + <comment> + Active part of the calorimeter is + 215 cm long in e-going + 221.5 cm long in p-going + -42 cm offset + </comment> <constant name="EcalBarrel_Calorimeter_zmin" - value="min(258.75*cm, EcalBarrelBackward_zmax)"/> + value="min(260.25*cm, EcalBarrelBackward_zmax)"/> <constant name="EcalBarrel_Calorimeter_zmax" - value="min(181.25*cm, EcalBarrelForward_zmax)"/> - <constant name="EcalBarrel_Readout_zmin" value="273.75*cm"/> - <constant name="EcalBarrel_Readout_zmax" value="196.25*cm"/> + value="min(176.25*cm, EcalBarrelForward_zmax)"/> + <constant name="EcalBarrel_Readout_zmin" value="275.25*cm"/> + <constant name="EcalBarrel_Readout_zmax" value="191.25*cm"/> <constant name="EcalBarrel_Calorimeter_length" value="EcalBarrel_Calorimeter_zmax + EcalBarrel_Calorimeter_zmin"/> <constant name="EcalBarrel_Calorimeter_offset" From d98adce9bb8ee2d07a99a153dc2372b5598a676e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Tue, 5 Mar 2024 12:53:45 -0500 Subject: [PATCH 030/113] Delete .gitlab-ci.yml (#651) Not maintained --- .gitlab-ci.yml | 278 ------------------------------------------------- 1 file changed, 278 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 9c327953f..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,278 +0,0 @@ -image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:latest - -workflow: - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - - if: '$CI_PIPELINE_SOURCE == "web"' - - if: '$CI_PIPELINE_SOURCE == "webide"' - - if: '$CI_COMMIT_BRANCH == "main"' - - if: '$CI_COMMIT_TAG' - -default: - before_script: - - source .local/bin/env.sh - artifacts: - expire_in: 1 week - paths: - - .local/detector - - .local/lib - - .local/bin - - .local/include - - .local/share - - results - - config - - images - - doc - - juggler.env - - geo - reports: - dotenv: juggler.env - -stages: - - config - - build - - test - - docs - - collect - - finalize - - deploy - -common:setup: - stage: config - rules: - - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' - before_script: - - git clone https://eicweb.phy.anl.gov/EIC/benchmarks/common_bench.git setup - script: - - | - # if [[ "x${CI_PIPELINE_SOURCE}" == "xmerge_request_event" || "$CI_COMMIT_BRANCH" == "main" ]]; then - export JUGGLER_DETECTOR_VERSION="${CI_COMMIT_REF_NAME}" - echo "BEAMLINE_CONFIG = ${BEAMLINE_CONFIG}" - echo "BEAMLINE_CONFIG_VERSION = ${BEAMLINE_CONFIG_VERSION}" - echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}" - echo "JUGGLER_DETECTOR_VERSION = ${CI_COMMIT_REF_NAME}" - echo "JUGGLER_DETECTOR_VERSION=$CI_COMMIT_REF_NAME" >> juggler.env - echo "JUGGLER_DETECTOR=$JUGGLER_DETECTOR" >> juggler.env - # as long as this repo is private, we need to use a deploy token to git clone it in CI - echo "JUGGLER_DETECTOR_DEPLOY_TOKEN_USERNAME=${DEPLOY_TOKEN_USERNAME}" >> juggler.env - echo "JUGGLER_DETECTOR_DEPLOY_TOKEN_PASSWORD=${DEPLOY_TOKEN_PASSWORD}" >> juggler.env - #fi - - source setup/bin/env.sh && ./setup/bin/install_common.sh - -common:detector: - stage: build - needs: - - common:setup - script: - - build_detector.sh - - mkdir -p results - - mkdir -p config - - mkdir -p doc - - mkdir -p geo - - print_env.sh - -build:simple: - stage: build - script: - - mkdir -p build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install && cd .. - - echo "Build successful." - - -.views: - stage: docs - tags: - - phy-scratch - before_script: - - source .local/bin/env.sh - - env - - pip3 install psutil - needs: - - ["common:detector"] - -include: - - local: 'views/generate_prim_files.yml' - - local: 'views/view1.yml' - - local: 'views/view2.yml' - - local: 'views/view3.yml' - - local: 'views/view6.yml' - - local: 'views/view7.yml' - - local: 'views/view11.yml' - - local: 'views/view12.yml' - - local: 'views/view13.yml' - - local: 'views/view14.yml' - - local: 'views/view15.yml' - - local: 'views/view20.yml' - -check_prefix: - stage: test - needs: - - common:detector - script: - - | - echo "checking detector type prefix equals ${JUGGLER_DETECTOR}" - declares=`grep -r DECLARE_ src/ | grep -v ${JUGGLER_DETECTOR} || true` - if [[ ! -z "${declares}" ]] ; then - echo "${declares}" && false - fi - -dump_geometry: - stage: test - needs: - - common:detector - script: - - mkdir -p geo - - | - geo_base_file="geo/detector_geo" - dd_web_display --output ${geo_base_file}.root ${DETECTOR_PATH}/${CI_PROJECT_NAME}.xml - for yml in ${DETECTOR_PATH}/configurations/*.yml; do - name=`basename $yml .yml` - xml_file=${CI_PROJECT_NAME}_${name}.xml - geo_file=${geo_base_file}_${name}.root - dd_web_display --output ${geo_file} ${DETECTOR_PATH}/${xml_file} - done - - | - geoviewer="https://eic.phy.anl.gov/geoviewer/index.htm" - geo_base_url="${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/${geo_base_file}" - geo_suffix="?job=${CI_JOB_NAME}&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all" - echo " - Default subsystem view at:" - echo " ${geoviewer}?file=${geo_base_url}.root${geo_suffix}" - for yml in ${DETECTOR_PATH}/configurations/*.yml; do - name=`basename $yml .yml` - xml_file=${CI_PROJECT_NAME}_${name}.xml - geo_url=${geo_base_url}_${name}.root - echo " - Subsystem view for ${xml_file} at:" - echo " ${geoviewer}?file=${geo_url}${geo_suffix}" - done - -detector_documentation: - stage: docs - needs: - - common:detector - script: - - mkdir -p doc - - bash bin/build_documentation | tee doc/detector.md - #- | - # xmllint --format --xpath '//comment/text()' ${DETECTOR_PATH}/epic.xml | sed -re 's/<\/?\w+>//g' | sed 's/^[[:space:]]*#/#/' | tee doc/detector.md - # xmllint --format --xpath '//comment/text()' ${DETECTOR_PATH}/ip6/definitions.xml | sed -re 's/<\/?\w+>//g' | sed 's/^[[:space:]]*#/#/' | tee -a doc/detector.md || true - # for afile in ${DETECTOR_PATH}/compact/*.xml ; do - # xmllint --format --xpath '//comment/text()' ${afile} | sed -re 's/<\/?\w+>//g' | sed 's/^[[:space:]]*#/#/' | tee -a doc/detector.md || true - # done - -report: - stage: finalize - needs: - - view_01 - - view_02 - - view_03 - - view_06 - - view_07 - - view_11 - - view_12 - - view_13 - - view_14 - - view_15 - - view_20 - - dump_constants - - dump_geometry - - dump_parameter_table - - convert_to_gdml - script: - - pip3 install jinja2 && ls -lrth - - ./bin/make_images > doc/dawn_views.md - - echo "Geometry viewer at https://eic.phy.anl.gov/geoviewer/index.htm?file=https://eicweb.phy.anl.gov/EIC/detectors/ecce/-/jobs/${CI_JOB_ID}/artifacts/raw/geo/detector_geo_full.root?job=finalize&item=default;1&opt=clipxyz;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all&" - -dump_constants: - stage: test - needs: - - ["common:detector"] - script: - - npdet_info dump ${DETECTOR_PATH}/epic.xml | tee doc/constants.out - -dump_parameter_table: - stage: test - needs: - - ["common:detector"] - script: - - npdet_info dump ${DETECTOR_PATH}/epic.xml | grep -v '^\s' | grep '=' | cut -d= -f1-2 | tee doc/constants.toml - - python bin/make_detector_parameter_table - -overlap_check_tgeo: - stage: test - needs: - - ["common:detector"] - script: - ## disable fibers in ECAL for normal overlap check - - sed -i '/<fiber/,+6d' ${DETECTOR_PATH}/compact/ecal_barrel_interlayers.xml - - sed -i '/<fiber/,+4d' ${DETECTOR_PATH}/ip6/far_forward/ZDC_Ecal_WSciFi.xml - - checkOverlaps -c ${DETECTOR_PATH}/epic.xml | tee doc/overlap_check_tgeo.out - - echo "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l) overlaps..." - - if [[ "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi - -overlap_check_geant4:full_fast: - stage: test - needs: - - ["common:detector"] - script: - ## disable fibers in ECAL for normal overlap check - - sed -i '/<fiber/,+6d' ${DETECTOR_PATH}/compact/ecal_barrel_interlayers.xml - - sed -i '/<fiber/,+4d' ${DETECTOR_PATH}/ip6/far_forward/ZDC_Ecal_WSciFi.xml - ## reduce the number of fibers in Hadron EMCal for overlap check - ## not needed, as we are running with a different setup now - #- sed -i 's/radius="EcalEndcapP_FiberRadius"/radius="EcalEndcapP_FiberRadius*10"/' ${DETECTOR_PATH}/compact/ci_ecal_scfi.xml - - python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/epic.xml | tee doc/overlap_check_geant4.out - - echo "$(cat doc/overlap_check_geant4.out | grep GeomVol1002 | wc -l) overlaps..." - - if [[ "$(cat doc/overlap_check_geant4.out | grep GeomVol1002 | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi - -## TODO: add real full overlap check as child pipeline to run on branches only - -overlap_check_geant4:inner_detector: - stage: test - needs: - - ["common:detector"] - script: - - python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/epic_inner_detector.xml | tee doc/overlap_check_geant4.out - - echo "$(cat doc/overlap_check_geant4.out | grep GeomVol1002 | wc -l) overlaps..." - - if [[ "$(cat doc/overlap_check_geant4.out | grep GeomVol1002 | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi - -convert_to_gdml: - stage: test - needs: - - ["common:detector"] - script: - - mkdir -p geo - - python scripts/convert_to_gdml.py --compact ${DETECTOR_PATH}/epic.xml --output geo/epic.gdml - -tracking_geometry_debug: - stage: test - needs: - - ["common:detector"] - script: - - root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/epic.xml\")" | tee geo/tracking_geometry_debug.out - - ./bin/acts_geo_check geo/tracking_geometry_debug.out - -detector:config_testing: - stage: test - needs: - - ["common:detector"] - script: - - checkOverlaps -o 's' -c ${DETECTOR_PATH}/epic.xml | tee doc/overlap_check.out | wc -l - - cat doc/overlap_check.out - -benchmarks:detector: - stage: deploy - variables: - JUGGLER_DETECTOR: "$JUGGLER_DETECTOR" - JUGGLER_DETECTOR_VERSION: "$JUGGLER_DETECTOR_VERSION" - JUGGLER_DETECTOR_DEPLOY_TOKEN_USERNAME: "$DEPLOY_TOKEN_USERNAME" - JUGGLER_DETECTOR_DEPLOY_TOKEN_PASSWORD: "$DEPLOY_TOKEN_PASSWORD" - trigger: - project: EIC/benchmarks/detector_benchmarks - strategy: depend - needs: - - overlap_check_geant4:full_fast - - common:detector - parallel: - matrix: - - JUGGLER_DETECTOR_CONFIG: - - "${JUGGLER_DETECTOR}" - - "${JUGGLER_DETECTOR}_imaging" From d902f5aa3c01cee03a90b00dce8ac5e640558b68 Mon Sep 17 00:00:00 2001 From: Nicolas Schmidt <nicolas.schmidt@cern.ch> Date: Thu, 7 Mar 2024 15:33:12 -0500 Subject: [PATCH 031/113] fixed tof endcap y-resolution to correct value (#653) ### Briefly, what does this PR introduce? fix for tof endcap reso, as requested by the TOF group ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? ### Does this PR change default behavior? --- compact/tracking/tof_endcap.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact/tracking/tof_endcap.xml b/compact/tracking/tof_endcap.xml index d0bb207fe..8bb2a63fd 100644 --- a/compact/tracking/tof_endcap.xml +++ b/compact/tracking/tof_endcap.xml @@ -280,7 +280,7 @@ <readouts> <readout name="TOFEndcapHits"> - <segmentation type="CartesianGridXY" grid_size_x="0.1*mm" grid_size_y="0.1*cm" /> + <segmentation type="CartesianGridXY" grid_size_x="0.1*mm" grid_size_y="0.1*mm" /> <id>system:8,layer:4,module:8,idx:7,idy:5,x:32:-16,y:-16</id> </readout> </readouts> From 9083b7ec26dcf679ca9fbf577297aa56b91749c1 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sat, 9 Mar 2024 22:27:53 -0500 Subject: [PATCH 032/113] HOTFIX: add back HcalBarrel_rmin (#656) I believe, the #588 breaks the CalorimeterTrackProjections by removing `HcalBarrel_rmin` which is referenced in https://github.com/eic/EICrecon/blob/fcd8c84b14a9f0e5e486329bd9d7b42938ea4f46/src/global/tracking/tracking.cc#L164 I think, the `rmin1`/`rmin2` naming is a bit confusing, would be nice to know what the `10.4*cm` offset stands for, and get some better names. --- compact/definitions.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/compact/definitions.xml b/compact/definitions.xml index b922d7507..5afcc588c 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -620,6 +620,7 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <constant name="HcalBarrel_thickness" value="86.18*cm"/> <constant name="HcalBarrel_rmin1" value="183.85*cm"/> + <constant name="HcalBarrel_rmin" value="HcalBarrel_rmin1"/><!--DEPRECATED--> <constant name="HcalBarrel_rmin2" value="HcalBarrel_rmin1 + 10.4*cm"/> <constant name="HcalBarrel_rmax" value="HcalBarrel_rmin1 + HcalBarrel_thickness"/> <constant name="HcalBarrelForward_zmax" value="319.625*cm"/> From 9e7566a2136d0063bb4728bb5d6aa03e9f6a42e8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sun, 10 Mar 2024 11:41:34 -0500 Subject: [PATCH 033/113] fix: re-enable optical materials in hpDIRC (#652) ### Briefly, what does this PR introduce? This PR re-enable optical materials in hpDIRC in anticipation of better control over optical photon propagation in the hpDIRC in npsim itself. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, optical photons enabled by default (but disabled by default in ddsim, and will in npsim). --- compact/pid/dirc.xml | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/compact/pid/dirc.xml b/compact/pid/dirc.xml index 0e3242b5b..cfeaf0e32 100644 --- a/compact/pid/dirc.xml +++ b/compact/pid/dirc.xml @@ -69,22 +69,6 @@ </define> <materials> - <comment> - Only non optical material variants are here. - See optical_materials.xml for optical ones - - - </comment> - <material name="Epotek"> - <D type="density" value="1.2" unit="g/cm3"/> - <composite n="5" ref="H"/> - <composite n="3" ref="C"/> - <composite n="2" ref="O"/> - </material> - <material name="Nlak33a"> - <D type="density" value="4.220" unit="g/cm3"/> - <composite n="1" ref="Si"/> - <composite n="2" ref="O"/> - </material> </materials> <limits> @@ -129,13 +113,13 @@ repeat_y="DIRCBar_count_y" repeat_z="DIRCBar_count_z" gap="DIRCBar_gap" - material="Quartz" + material="QuartzOptical" vis="DIRCBar" /> <glue thickness="DIRCGlue_thickness" - material="Epotek" + material="EpotekOptical" vis="DIRCGlue" /> @@ -147,9 +131,9 @@ thickness="DIRCLens_thickness" r1="DIRCLens_r1" r2="DIRCLens_r2" - material1="Quartz" - material2="Sapphire" - material3="Quartz" + material1="QuartzOptical" + material2="SapphireOptical" + material3="QuartzOptical" vis1="DIRCLens1" vis2="DIRCLens2" vis3="DIRCLens3" @@ -161,7 +145,7 @@ angle="DIRCPrism_angle" long_edge="DIRCPrism_long_edge" short_edge="DIRCPrism_short_edge" - material="Quartz" + material="QuartzOptical" vis="DIRCPrism" /> @@ -169,7 +153,7 @@ height="DIRCMCP_height" width="DIRCMCP_width" thickness="DIRCMCP_thickness" - material="Quartz" + material="QuartzOptical" vis="DIRCMCP" /> </module> From 8b961fb831cd5996ed91acdf96320de258152f61 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 10 Mar 2024 15:16:16 -0400 Subject: [PATCH 034/113] Remove arches configurations (#650) ### Briefly, what does this PR introduce? Remove epic_arches and derived configurations ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --------- Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> --- README.md | 1 - _layouts/geoviewer.html | 2 +- calibrations/calo_digi_default.json | 8 - compact/definitions.xml | 5 +- compact/ecal/barrel_sciglass.xml | 148 --------- compact/tracking/definitions.xml | 4 - compact/tracking/definitions_arches.xml | 188 ----------- compact/tracking/mpgd_dirc.xml | 198 ----------- configurations/10x100.yml | 33 -- configurations/10x275.yml | 33 -- configurations/18x275.yml | 33 -- configurations/5x100.yml | 33 -- configurations/5x41.yml | 33 -- configurations/arches.yml | 32 -- configurations/arches_mrich_gdml.yml | 31 -- configurations/central.yml | 28 -- configurations/imaging.yml | 31 -- configurations/sciglass_only.yml | 5 - configurations/tracking_only.yml | 13 - doc/sciglass_tower_front_view.svg | 383 ---------------------- doc/sciglass_tower_stacking.svg | 307 ----------------- src/BarrelCalorimeterSciGlass_geo.cpp | 417 ------------------------ src/BarrelPlanarMPGDTracker_geo.cpp | 1 - 23 files changed, 3 insertions(+), 1964 deletions(-) delete mode 100644 compact/ecal/barrel_sciglass.xml delete mode 100644 compact/tracking/definitions_arches.xml delete mode 100644 compact/tracking/mpgd_dirc.xml delete mode 100644 configurations/10x100.yml delete mode 100644 configurations/10x275.yml delete mode 100644 configurations/18x275.yml delete mode 100644 configurations/5x100.yml delete mode 100644 configurations/5x41.yml delete mode 100644 configurations/arches.yml delete mode 100644 configurations/arches_mrich_gdml.yml delete mode 100644 configurations/central.yml delete mode 100644 configurations/imaging.yml delete mode 100644 configurations/sciglass_only.yml delete mode 100644 configurations/tracking_only.yml delete mode 100644 doc/sciglass_tower_front_view.svg delete mode 100644 doc/sciglass_tower_stacking.svg delete mode 100644 src/BarrelCalorimeterSciGlass_geo.cpp diff --git a/README.md b/README.md index 5db8f2276..1e68ea854 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Overview **Detector geometry viewer:** - [Viewer only](https://eic.github.io/epic/geoviewer) - Main configurations: - - [Arches](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_arches.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - [Brycecanyon](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_brycecanyon.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - [CraterLake](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_craterlake.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - Additional viewers: diff --git a/_layouts/geoviewer.html b/_layouts/geoviewer.html index bfccc0c92..59d82a743 100644 --- a/_layouts/geoviewer.html +++ b/_layouts/geoviewer.html @@ -6,7 +6,7 @@ <link rel="shortcut icon" href="https://root.cern/js/latest/img/RootIcon.ico"/> </head> <body> - <div id="simpleGUI" path="./artifacts/tgeo" files="epic_arches.root;epic_brycecanyon.root;epic_craterlake.root;epic_inner_detector.root"> + <div id="simpleGUI" path="./artifacts/tgeo" files="epic_brycecanyon.root;epic_craterlake.root;epic_inner_detector.root"> loading scripts ... </div> <script type="module"> diff --git a/calibrations/calo_digi_default.json b/calibrations/calo_digi_default.json index a07941320..387f1a18e 100644 --- a/calibrations/calo_digi_default.json +++ b/calibrations/calo_digi_default.json @@ -39,14 +39,6 @@ "pedestalSigma": 10, "thresholdValue": 0 }, - "ecal_barrel_sciglass": { - "readout": "module", - "dynamicRange": "20*GeV", - "capacityBitsADC": 14, - "pedestalMean": 100, - "pedestalSigma": 1, - "thresholdValue": 3 - }, "ecal_barrel_imaging": { "readout": "pixel", "dynamicRange": "3*MeV", diff --git a/compact/definitions.xml b/compact/definitions.xml index 5afcc588c..ae480895e 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -142,12 +142,11 @@ The unused IDs below are saved for future use. <constant name="TrackerEndcapP_6_ID" value="83"/> <constant name="TrackerSupport_0_ID" value="84"/> <constant name="TrackerSupport_1_ID" value="85"/> - <constant name="MPGDDIRC_0_ID" value="86"/> <documentation> - #### (87-99) Reserved IDs + #### (86-99) Reserved IDs - - Unused IDs: 87-89 + - Unused IDs: 86-89 TBD </documentation> <documentation> diff --git a/compact/ecal/barrel_sciglass.xml b/compact/ecal/barrel_sciglass.xml deleted file mode 100644 index 0e241f0e6..000000000 --- a/compact/ecal/barrel_sciglass.xml +++ /dev/null @@ -1,148 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Dmitry Kalinkin, Wouter Deconinck --> - -<lccdd> - <comment> - Implementation of the barrel SciGlass calorimeter - </comment> - - <define> - <documentation> - The EcalBarrel eta limits cut into the barrel shape. - </documentation> - <comment> - The current numbers are not based on any design in particular, but - provide some extra space for other detectors. - </comment> - <constant name="EcalBarrel_etamin" value="-1.87"/> - <constant name="EcalBarrel_etamax" value="+1.4"/> - </define> - - <display> - <vis name="det_vis" alpha="1.0" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="false" /> - <vis name="becal_wedge" alpha="1.0" r="0.82" g="0.84" b="0.86" showDaughters="true" visible="true" /> - <vis name="outer_support_aluminum" alpha="1.0" r="0.82" g="0.84" b="0.86" showDaughters="true" visible="true" /> - <vis name="outer_support_steel" alpha="1.0" r="0.55" g="0.25" b="0.00" showDaughters="true" visible="true" /> - <vis name="carbon_fiber" alpha="0.9" r="0.1" g="0.1" b="0.1" showDaughters="true" visible="true" /> - <vis name="family1" alpha="1.0" r="0.22" g="0.54" b="0.71" showDaughters="true" visible="true" /> - <vis name="family2" alpha="1.0" r="0.90" g="0.48" b="0.47" showDaughters="true" visible="true" /> - <vis name="family3" alpha="1.0" r="0.87" g="0.49" b="0.09" showDaughters="true" visible="true" /> - <vis name="family4" alpha="1.0" r="0.94" g="0.48" b="0.73" showDaughters="true" visible="true" /> - <vis name="family5" alpha="1.0" r="0.44" g="0.63" b="0.44" showDaughters="true" visible="true" /> - <vis name="family6" alpha="1.0" r="0.50" g="0.35" b="0.76" showDaughters="true" visible="true" /> - <vis name="family7" alpha="1.0" r="0.76" g="0.35" b="0.50" showDaughters="true" visible="true" /> - </display> - - <detectors> - <comment> - An EM calorimeter with SciGlass blocks - </comment> - - <detector id="EcalBarrel_ID" name="EcalBarrelSciGlass" type="epic_EcalBarrelSciGlass" readout="EcalBarrelSciGlassHits" vis="det_vis" calorimeterType="EM_BARREL"> - <comment> - Global detector dimensions from https://eic.jlab.org/Geometry/Detector/Detector-20220624102507.html - </comment> - - <dimensions rmin="EcalBarrel_rmin" rmax="EcalBarrel_rmax" - zmax="EcalBarrelForward_zmax" zmin="-EcalBarrelBackward_zmax" - etamin="EcalBarrel_etamin" etamax="EcalBarrel_etamax"/> - - <documentation> - Pick the material for the towers - </documentation> - <material name="SciGlass" /> - - <comment> - The current implementation of the wedge box approximates flat inner - surfaces of individual wedge boxes with a single shared tube at a fixed - `inner_r`, which allows for ~17 mm air gap before the towers. - </comment> - <wedge_box inner_r="78.55 * cm" thickness="3 * mm" gap="6 * mm" vis="becal_wedge" material="Aluminum5083" /> - - <sectors number="24" phi0="0." deltaphi="pi / 12"> - <comment> - Rows within a sector are supposed to have smaller gaps than edge rows of two adjacent sectors - </comment> - - <rows number="5" deltaphi="2.811 * degree"> - <dimensions inner_r="EcalBarrel_rmin + EcalBarrel_inner_margin" gap="1 * mm" /> - - <comment> - Families in each row are constructed in two directions `dir_sign` - negative and positive rapidity - starting from the center. - The towers have the shape of truncated pyramids that have an opening angle in theta `flare_angle_polar`. - The towers are stacked in a row with their edges parallel to the edges of their neighbors, `gap` distance apart. - Families of towers are groups of towers having identical shape, i.e. the same tower is repeated `number` amount of times. - The front and rear faces are similar isosceles trapezoids only slightly deviating from a rectangular shape by an amount parametrized with `flare_angle_at_face`. - </comment> - - <family dir_sign="+1" x1="1.925 * cm" y1="2 * cm" z_length="40.0 * cm" number="10" flare_angle_azimuthal="pyramidal" flare_angle_polar="1.16 * degree" flare_angle_at_face="0.3059 * degree" vis="family1" /> - <family dir_sign="+1" x1="1.925 * cm" y1="2 * cm" z_length="40.0 * cm" number="6" flare_angle_azimuthal="pyramidal" flare_angle_polar="1.045 * degree" flare_angle_at_face="0.7058 * degree" vis="family2" /> - <family dir_sign="+1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="5" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.929 * degree" flare_angle_at_face="0.8892 * degree" vis="family3" /> - <family dir_sign="+1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="5" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.82 * degree" flare_angle_at_face="1.0258 * degree" vis="family4" /> - <family dir_sign="+1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="3" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.70 * degree" flare_angle_at_face="1.126 * degree" vis="family5" /> - <family dir_sign="-1" x1="1.925 * cm" y1="2 * cm" z_length="40.0 * cm" number="10" flare_angle_azimuthal="pyramidal" flare_angle_polar="1.16 * degree" flare_angle_at_face="0.3059 * degree" vis="family1" /> - <family dir_sign="-1" x1="1.925 * cm" y1="2 * cm" z_length="40.0 * cm" number="6" flare_angle_azimuthal="pyramidal" flare_angle_polar="1.045 * degree" flare_angle_at_face="0.7058 * degree" vis="family2" /> - <family dir_sign="-1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="5" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.929 * degree" flare_angle_at_face="0.8892 * degree" vis="family3" /> - <family dir_sign="-1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="5" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.82 * degree" flare_angle_at_face="1.0258 * degree" vis="family4" /> - <family dir_sign="-1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="5" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.70 * degree" flare_angle_at_face="1.126 * degree" vis="family5" /> - <family dir_sign="-1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="6" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.586 * degree" flare_angle_at_face="1.1914 * degree" vis="family6" /> - <comment> - Family 7 is not based on any design in particular. The polar - flaring angle was adjusted according to the trend to avoid overlaps - and provide gaps needed to place the supports. - </comment> - <family dir_sign="-1" x1="1.925 * cm" y1="2 * cm" z_length="45.5 * cm" number="2" flare_angle_azimuthal="pyramidal" flare_angle_polar="0.46 * degree" flare_angle_at_face="1.1914 * degree" vis="family7" /> - </rows> - - <documentation> - This describes the carbon fiber supports that are placed in the gaps between the towers. - </documentation> - <comment> - In current geometry, the supports are represented by double-thickness layers shared between towers. - As Air-gapped towers are preferred, cut outs are implemented with margins that were roughly estimated from a preliminary CAD drawing. - </comment> - - <carbon_fiber_support - thickness="0.5 * mm" - overhang_top="2 * cm" - overhang_bottom="0.2 * cm" - vis="carbon_fiber" - material="CarbonFiber" - > - <cut_out - margin_horizontal="1 * cm" - margin_top="5 * cm" - margin_bottom="1.6 * cm" - /> - </carbon_fiber_support> - </sectors> - - <outer_supports> - <comment> - "EMCal Outer Surface" from the menagerie and tower support before it. - Extra 1.5 cm is supposed to represent the aluminum tower support, - which is supposed to have a more complicated shape. - </comment> - <layer inner_r="129.0 * cm" thickness="(1 * cm) + (1.5 * cm)" material="Aluminum5083" vis="outer_support_aluminum" /> - <documentation> - This implements material for the outer support (rails, etc.) of the - calorimeter - </documentation> - <comment> - According to the curernt manegerie, - https://eic.jlab.org/Geometry/Detector/Detector-20221013164359.html, - the "EMCal Outer Support" should be only 20% steel density of 9 cm - volume, but that's an outdated information. - </comment> - <layer inner_r="132.0 * cm" thickness="8 * cm" material="StainlessSteel" vis="outer_support_steel" /> - </outer_supports> - </detector> - </detectors> - - <readouts> - <readout name="EcalBarrelSciGlassHits"> - <segmentation type="NoSegmentation"/> - <id>system:8,sector:8,row:8,tower:-8</id> - </readout> - </readouts> -</lccdd> diff --git a/compact/tracking/definitions.xml b/compact/tracking/definitions.xml index 15578dcdb..bc532c152 100644 --- a/compact/tracking/definitions.xml +++ b/compact/tracking/definitions.xml @@ -34,10 +34,6 @@ <constant name="InnerMPGDBarrel_zoffset" value="InnerMPGDBarrel_zmax - InnerMPGDBarrel_zmin"/> <comment> barrel length: 2R/tan(angle) - dz </comment> - <comment> Position in center of space behind DIRC </comment> - <constant name="MPGDDIRC_rmin" value="DIRC_rmin + DIRC_thickness"/> - <comment> barrel asymmetryc between forward and backward lengths </comment> - <comment> Main parameters for Barrel TOF layers </comment> <comment> Barrel TOF region </comment> <constant name="BarrelTOF_zmin" value="120.0*cm"/> diff --git a/compact/tracking/definitions_arches.xml b/compact/tracking/definitions_arches.xml deleted file mode 100644 index 5feea6784..000000000 --- a/compact/tracking/definitions_arches.xml +++ /dev/null @@ -1,188 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Sylvester Joosten, Shujie Li --> - -<lccdd> - - <display> - </display> - <define> - <comment> Primary directions for the tracker </comment> - <comment> TODO: use actual design angles rather than calculated projective directions </comment> - <comment> projective cone at 45 degree </comment> - <constant name="TrackerPrimaryAngle" value="atan(1)" /> - <constant name="TrackerForwardAngle" value="2*atan(exp(-1.6472))" /> - <constant name="TrackerBackwardAngle" value="2*atan(exp(-1.5166))" /> - - <comment> Main parameters for the vertex tracker </comment> - <constant name="VertexBarrel_length" value="270.0*mm"/> - <constant name="VertexBarrel_rmin" value="3.6*cm"/> - <constant name="VertexBarrel_rmax" value="12.6*cm"/> - - <comment> Main parameters for the SiBarrel layer geometry </comment> - <constant name="SiBarrel1_rmin" value="27.0*cm"/> - <constant name="SiBarrel2_rmin" value="42.0*cm"/> - <constant name="SiBarrel_angle" value="TrackerPrimaryAngle"/> - <constant name="SiBarrel_dz" value="2*cm"/> - <comment> barrel length: 2R/tan(angle) - dz </comment> - - <comment> Main parameters for the MPGD layer geometries </comment> - <constant name="InnerMPGDBarrel_rmin" value="55.0*cm"/> - <constant name="InnerMPGDBarrel_dz" value="8.0*cm"/> - <constant name="InnerMPGDBarrel_length" value="2*InnerMPGDBarrel_rmin / tan(TrackerBackwardAngle) - InnerMPGDBarrel_dz"/> - <constant name="InnerMPGDBarrel_zmin" value="InnerMPGDBarrel_length/2"/> <comment> -z </comment> - <constant name="InnerMPGDBarrel_zmax" value="InnerMPGDBarrel_length/2"/> <comment> +z </comment> - <constant name="InnerMPGDBarrel_zoffset" value="InnerMPGDBarrel_zmax - InnerMPGDBarrel_zmin"/> - <comment> barrel length: 2R/tan(angle) - dz </comment> - - <comment> Position in center of space behind DIRC </comment> - <constant name="MPGDDIRC_rmin" value="DIRC_rmin + DIRC_thickness"/> - <comment> barrel asymmetryc between forward and backward lengths </comment> - - <comment> Main parameters for Barrel TOF layers </comment> - <comment> Barrel TOF region </comment> - <constant name="BarrelTOF_zmin" value="120.0*cm"/> - <constant name="BarrelTOF_zmax" value="120.0*cm"/> - <constant name="BarrelTOF_radius_design" value="64.6*cm"/> - - <comment> Forward TOF region </comment> - <constant name="ForwardTOFRegion_zmin" value="ForwardPIDRegion_zmin" /> - <constant name="ForwardTOFRegion_tan" value="CentralTrackingRegionP_tan" /> - <constant name="ForwardTOFRegion_minR" value="8*cm" /> - <constant name="ForwardTOFRegion_maxR" value="67*cm" /> - <constant name="ForwardTOF_xOffset" value="-2.75*cm" /> - <constant name="ForwardTOF_det_height" value="2.0*cm" /> - <constant name="ForwardTOF_length" value="min(ForwardTOFRegion_length, 2.*cm)"/> - <constant name="ForwardTOF_zmin" value="ForwardTOFRegion_zmin + ForwardTOFRegion_length - ForwardTOF_length - 1*cm"/> - - <comment> Service/Support setup </comment> - <constant name="VertexSupportCyl2_thickness" value="0.3*cm"/> - <constant name="VertexSupportCylCF_thickness" value="100.0*um" /> - <constant name="TrackerSupportCyl_rmin" value="44.0*cm"/> - <comment> These may belong in definitions.xml </comment> - <constant name="InnerTrackerEndcapP_zmax" value="CentralTrackingRegionP_zmax"/> - <constant name="InnerTrackerEndcapN_zmax" value="CentralTrackingRegionN_zmax"/> - <comment> Endcap structures </comment> - <comment> The forward outer cone is projective from the starting rmin1 </comment> - <constant name="ForwardEndcapSupportCone_rmin1" value="85*cm" /> - <constant name="ForwardEndcapSupportCone_zmax" value="190*cm" /> - <comment> Discontinuity for the cone to the cylinder to avoid overlaps FIXME </comment> - <constant name="BackwardEndcapSupportCyl_rmin" value="65*cm" /> - <constant name="BackwardEndcapSupportCyl_zmin" value="BackwardPIDRegion_zmin + 5*cm" /> - <constant name="BackwardEndcapSupportCyl_zmax" value="BackwardPIDRegion_zmax" /> - - <comment> Main parameters for the positive silicon disks </comment> - <comment> assume the disk are centered along z. The inner radii are larger than designed to account for the beampipe offset. Need to be fixed later </comment> - <constant name="Beampipe_bakeout_buffer" value="5*mm" /> - - <constant name="InnerTrackerEndcapP_zmin" value="25.0*cm" /> - <constant name="InnerTrackerEndcapP_rmin" value="Beampipe_rmax + Beampipe_bakeout_buffer" /> - <constant name="InnerTrackerEndcapP_rmax" value="24.0*cm" /> - <constant name="TrackerEndcapPDisk1_zmin" value="45.0*cm" /> - <constant name="TrackerEndcapPDisk1_rmin" value="Beampipe_rmax + Beampipe_bakeout_buffer" /> - <constant name="TrackerEndcapPDisk1_rmax" value="TrackerSupportCyl_rmin - 15*mm" /> - <constant name="TrackerEndcapPDisk2_zmin" value="70.0*cm" /> - <constant name="TrackerEndcapPDisk2_rmin" value="32.86*mm + Beampipe_bakeout_buffer + 0.6*mm" /> - <constant name="TrackerEndcapPDisk2_rmax" value="TrackerSupportCyl_rmin * .98" /> - <constant name="TrackerEndcapPDisk3_zmin" value="100.0*cm" /> - <constant name="TrackerEndcapPDisk3_rmin" value="40.58*mm + Beampipe_bakeout_buffer + 7.85*mm" /> - <constant name="TrackerEndcapPDisk3_rmax" value="TrackerSupportCyl_rmin * .98" /> - <constant name="TrackerEndcapPDisk4_zmin" value="135.0*cm" /> - <constant name="TrackerEndcapPDisk4_rmin" value="49.12*mm + Beampipe_bakeout_buffer + 16.02*mm" /> - <constant name="TrackerEndcapPDisk4_rmax" value="TrackerSupportCyl_rmin * .98" /> - - <comment> Main parameters for the negative silicon disks (will be reflected, so positive z-values here) - </comment> - <constant name="InnerTrackerEndcapN_zmin" value="InnerTrackerEndcapP_zmin" /> - <constant name="InnerTrackerEndcapN_rmin" value="InnerTrackerEndcapP_rmin" /> - <constant name="InnerTrackerEndcapN_rmax" value="InnerTrackerEndcapP_rmax" /> - <constant name="TrackerEndcapNDisk1_zmin" value="TrackerEndcapPDisk1_zmin" /> - <constant name="TrackerEndcapNDisk1_rmin" value="TrackerEndcapPDisk1_rmin" /> - <constant name="TrackerEndcapNDisk1_rmax" value="TrackerEndcapPDisk1_rmax" /> - <constant name="TrackerEndcapNDisk2_zmin" value="65*cm" /> - <constant name="TrackerEndcapNDisk2_rmin" value="Beampipe_rmax + Beampipe_bakeout_buffer" /> - <constant name="TrackerEndcapNDisk2_rmax" value="TrackerEndcapPDisk2_rmax" /> - <constant name="TrackerEndcapNDisk3_zmin" value="90*cm" /> - <constant name="TrackerEndcapNDisk3_rmin" value="34.244*mm + Beampipe_bakeout_buffer + 0.817*mm" /> - <constant name="TrackerEndcapNDisk3_rmax" value="TrackerEndcapPDisk3_rmax" /> - <constant name="TrackerEndcapNDisk4_zmin" value="115*cm" /> - <constant name="TrackerEndcapNDisk4_rmin" value="38.043*mm + Beampipe_bakeout_buffer + 3.310*mm" /> - <constant name="TrackerEndcapNDisk4_rmax" value="TrackerEndcapPDisk4_rmax" /> - </define> - <detectors> - <detector id="VertexSubAssembly_0_ID" - name="VertexBarrelSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="VertexBarrel" /> - </detector> - <detector id="TrackerSubAssembly_0_ID" - name="InnerSiTrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="InnerTrackerEndcapN"/> - <composite name="InnerTrackerEndcapP"/> - </detector> - <detector id="TrackerSubAssembly_1_ID" - name="MiddleSiTrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="MiddleTrackerEndcapN"/> - <composite name="SagittaSiBarrel"/> - <composite name="MiddleTrackerEndcapP"/> - </detector> - <detector id="TrackerSubAssembly_2_ID" - name="OuterSiTrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="OuterTrackerEndcapN"/> - <composite name="OuterSiBarrel"/> - <composite name="OuterTrackerEndcapP"/> - </detector> - <comment>the following two could probably be merged, but we are keeping space for the TOF to be integrated (hence the skip over one ID number) </comment> - <detector id="TrackerSubAssembly_3_ID" - name="InnerMPGDSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="InnerMPGDBarrel"/> - </detector> - <detector id="TrackerSubAssembly_4_ID" - name="BarrelTOFSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="BarrelTOF"/> - </detector> - <detector id="TrackerSubAssembly_5_ID" - name="OuterMPGDSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="MPGDDIRC_0"/> - </detector> - <detector id="TrackerSubAssembly_6_ID" - name="EndcapTOFSubSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="ForwardTOF"/> - <composite name="BackwardTOF"/> - </detector> - <detector id="B0TrackerSubAssembly_ID" - name="B0TrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="B0Tracker"/> - <composite name="B0TrackerCompanion"/> - </detector> - </detectors> - - <documentation> - ### Material map for ACTS - https://eicweb.phy.anl.gov/EIC/detectors/athena/-/issues/127 - </documentation> - <plugins> - <plugin name="epic_FileLoader"> - <arg value="cache:$DETECTOR_PATH:/opt/detector"/> - <arg value="file:calibrations/materials-map.cbor"/> - <arg value="url:https://eicweb.phy.anl.gov/EIC/detectors/athena/uploads/77bd16bef5d811f31256279a3601c9d5/material-maps.cbor"/> - </plugin> - </plugins> - -</lccdd> diff --git a/compact/tracking/mpgd_dirc.xml b/compact/tracking/mpgd_dirc.xml deleted file mode 100644 index d6bace71a..000000000 --- a/compact/tracking/mpgd_dirc.xml +++ /dev/null @@ -1,198 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Matt Posik, Wouter Deconinck --> - -<lccdd> -<info name="mrwell_dirc.xml" - title="Micro-Pattern Gas Detector for aiding DIRC PID" - author="mposik1983" - url="https://github.com/mposik1983" - status="development" - version="1.0" -><comment/> -</info> - -<define> - <comment> frames </comment> - <constant name="MPGDDIRCFrame_width" value="20*mm"/> - <constant name="MPGDDIRCFrame_thickness" value="7*mm"/> - - <comment> module constants </comment> - <constant name="MPGDDIRCModule_count" value="12" /> - <constant name="MPGDDIRCModule_allowed_space" value="2*cm"/> - <constant name="MPGDDIRCModule_rmin" value="MPGDDIRC_rmin"/> - <constant name="MPGDDIRCModule_rmax" value="MPGDDIRCModule_rmin + MPGDDIRCModule_allowed_space" /> - <constant name="MPGDDIRCModule_zmin1" value="145.0*cm"/> - <constant name="MPGDDIRCModule_zmin2" value="197.0*cm"/> - <constant name="MPGDDIRCModule_width" value="36.2*cm"/> - <constant name="MPGDDIRCModule_length" value="0.5*(MPGDDIRCModule_zmin1 + MPGDDIRCModule_zmin2)"/> - <constant name="MPGDDIRCModule_offset" value="(MPGDDIRCModule_zmin1 - MPGDDIRCModule_zmin2)/2.0"/> - - - - <comment> layer parameters </comment> - <constant name="MPGDDIRCWindow_thickness" value="50*um"/> - <constant name="MPGDDIRCWindowGap_thickness" value="2*mm"/> - <constant name="MPGDDIRCDriftGap_thickness" value="3*mm"/> - <constant name="MPGDDIRCFoilCu_thickness" value="5*um"/> - <constant name="MPGDDIRCReadOutElectrode_thickness" value="10*um"/> - <constant name="MPGDDIRCFoilKapton_thickness" value="50*um"/> - <constant name="MPGDDIRCReadOutNomex_thickness" value="50*um"/> - <constant name="MPGDDIRCReadOutKapton_thickness" value="50*um"/> - <constant name="MPGDDIRCPCB_thickness" value="3*mm"/> - - <comment> Thickness values </comment> - <constant name="MPGDDIRCCathode_thickness" value="MPGDDIRCFoilKapton_thickness + MPGDDIRCFoilCu_thickness"/> - <constant name="MPGDDIRCFoil_thickness" value="MPGDDIRCFoilKapton_thickness + MPGDDIRCFoilCu_thickness"/> - <constant name="MPGDDIRCReadOut_thickness" value="MPGDDIRCReadOutNomex_thickness + MPGDDIRCReadOutElectrode_thickness + MPGDDIRCReadOutKapton_thickness"/> - <constant name="MPGDDIRCModule_thickness" value="MPGDDIRCWindow_thickness + MPGDDIRCCathode_thickness + - MPGDDIRCFoil_thickness + MPGDDIRCReadOut_thickness + - MPGDDIRCPCB_thickness + MPGDDIRCFrame_thickness" /> - </define> - - - <materials> - </materials> - - <limits> - </limits> - - <regions> - </regions> - - <display> - </display> - - <detectors> - <detector id="MPGDDIRC_0_ID" name="MPGDDIRC_0" type="epic_MPGDDIRC" readout="MPGDDIRCHits" vis="TrackerVis"> - <type_flags type="DetType_TRACKER + DetType_BARREL"/> - <dimensions width="MPGDDIRCModule_width" length="MPGDDIRCModule_length" height="MPGDDIRCModule_allowed_space" /> - <position x="0" y="0" z="MPGDDIRCModule_offset" /> - - <comment> MPGD DIRC module components</comment> - <module name="MPGDDIRCModule" vis="TrackerVis"> - - <module_component name="DriftGap" - material="Ar" - sensitive="true" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCDriftGap_thickness" - vis="TrackerMPGDGasVis" - length="MPGDDIRCModule_length"/> - - <module_component name="WindowGasGap" - material="Ar" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCWindowGap_thickness" - vis="TrackerMPGDGasVis" - length="MPGDDIRCModule_length" /> - - <module_component name="Window" - material="Kapton" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCWindow_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="Cathode_Kapton" - material="Kapton" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCFoilKapton_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="Cathode_Cu" - material="Copper" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCFoilCu_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="RWELL_Cu" - material="Copper" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCFoilCu_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="RWELL_Kapton" - material="Kapton" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCFoilKapton_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="Nomex" - material="Nomex" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCReadOutNomex_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="ReadOutElectrodes" - material="Copper" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCReadOutElectrode_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="ReadOutKapton" - material="Kapton" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCReadOutKapton_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - <module_component name="PCB" - material="Fr4" - sensitive="false" - width="MPGDDIRCModule_width" - thickness="MPGDDIRCPCB_thickness" - vis="TrackerVis" - length="MPGDDIRCModule_length" /> - - <comment> Frame width gets subtracted from the gas module volumes - see src/MPGDDIRC_geo.cpp - </comment> - - <frame material="Fr4" - width="MPGDDIRCFrame_width" - vis="TrackerSupportVis" - thickness="MPGDDIRCFrame_thickness"/> - -</module> -<comment> Layout for MPGD DIRC layers </comment> - <layer module="MPGDDIRCModule" id="0" vis="TrackerSupportVis"> - <envelope_tolerance r_min="-50*mm" r_max="0*mm" z_min="0*mm" z_max="0*mm"/> - <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDDIRCModule_count" bins1="100" /> - <rphi_layout - phi_tilt="0" - nphi="MPGDDIRCModule_count" - phi0="0" - rc="MPGDDIRCModule_rmin" - dr="0" /> - <z_layout - dr = "0.0 * cm" - z0 = "0.0 * cm" - nz = "2"/> - </layer> -</detector> -</detectors> - - <readouts> - <readout name="MPGDDIRCHits"> - <segmentation type="CartesianGridXY" grid_size_x="0.150*mm*sqrt(12)" grid_size_y="0.150*mm*sqrt(12)" /> - <id>system:8,layer:4,module:12,sensor:2,x:32:-14,y:-18</id> - </readout> - </readouts> - - <plugins> - <plugin name="DD4hep_ParametersPlugin"> - <argument value="MPGDDIRC_0"/> - <argument value="layer_pattern: str=MPGDDIRC_0_layer\d"/> - </plugin> - </plugins> - - <fields> - </fields> -</lccdd> diff --git a/configurations/10x100.yml b/configurations/10x100.yml deleted file mode 100644 index ed897aed3..000000000 --- a/configurations/10x100.yml +++ /dev/null @@ -1,33 +0,0 @@ -ebeam: 10 -pbeam: 100 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/10x275.yml b/configurations/10x275.yml deleted file mode 100644 index 019cdf7f9..000000000 --- a/configurations/10x275.yml +++ /dev/null @@ -1,33 +0,0 @@ -ebeam: 10 -pbeam: 275 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/18x275.yml b/configurations/18x275.yml deleted file mode 100644 index e74750908..000000000 --- a/configurations/18x275.yml +++ /dev/null @@ -1,33 +0,0 @@ -ebeam: 18 -pbeam: 275 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/5x100.yml b/configurations/5x100.yml deleted file mode 100644 index 1604a0204..000000000 --- a/configurations/5x100.yml +++ /dev/null @@ -1,33 +0,0 @@ -ebeam: 5 -pbeam: 100 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/5x41.yml b/configurations/5x41.yml deleted file mode 100644 index 5c3183d16..000000000 --- a/configurations/5x41.yml +++ /dev/null @@ -1,33 +0,0 @@ -ebeam: 5 -pbeam: 41 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/arches.yml b/configurations/arches.yml deleted file mode 100644 index 004e43f65..000000000 --- a/configurations/arches.yml +++ /dev/null @@ -1,32 +0,0 @@ -ebeam: 18 -pbeam: 275 -features: - beampipe: - tracking: - definitions_arches: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - lfhcal_without_space_for_insert: - barrel_gdml: - backward: - backward_endcap_flux: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/arches_mrich_gdml.yml b/configurations/arches_mrich_gdml.yml deleted file mode 100644 index bd199e32b..000000000 --- a/configurations/arches_mrich_gdml.yml +++ /dev/null @@ -1,31 +0,0 @@ -ebeam: 18 -pbeam: 275 -features: - beampipe: - tracking: - definitions_arches: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich_gdml: - drich: - ecal: - forward_homogeneous: - barrel_sciglass: - backward_PbWO4: - solenoid: - hcal: - lfhcal_without_space_for_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/central.yml b/configurations/central.yml deleted file mode 100644 index b7f997e53..000000000 --- a/configurations/central.yml +++ /dev/null @@ -1,28 +0,0 @@ -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - backward_endcap_flux: diff --git a/configurations/imaging.yml b/configurations/imaging.yml deleted file mode 100644 index 093f72e32..000000000 --- a/configurations/imaging.yml +++ /dev/null @@ -1,31 +0,0 @@ -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - mrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/sciglass_only.yml b/configurations/sciglass_only.yml deleted file mode 100644 index 7ff6eca2e..000000000 --- a/configurations/sciglass_only.yml +++ /dev/null @@ -1,5 +0,0 @@ -features: - fields: - marco: - ecal: - barrel_sciglass: diff --git a/configurations/tracking_only.yml b/configurations/tracking_only.yml deleted file mode 100644 index 92ebb7614..000000000 --- a/configurations/tracking_only.yml +++ /dev/null @@ -1,13 +0,0 @@ -features: - fields: - marco: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - mpgd_dirc: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: diff --git a/doc/sciglass_tower_front_view.svg b/doc/sciglass_tower_front_view.svg deleted file mode 100644 index b3834e11b..000000000 --- a/doc/sciglass_tower_front_view.svg +++ /dev/null @@ -1,383 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - width="58.162678mm" - height="44.769291mm" - viewBox="0 0 58.162678 44.769291" - version="1.1" - id="svg5" - inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" - sodipodi:docname="sciglass_tower_front_view.svg" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"> - <sodipodi:namedview - id="namedview7" - pagecolor="#ffffff" - bordercolor="#000000" - borderopacity="0.25" - inkscape:showpageshadow="2" - inkscape:pageopacity="0.0" - inkscape:pagecheckerboard="0" - inkscape:deskcolor="#d1d1d1" - inkscape:document-units="mm" - showgrid="true" - showguides="false" - inkscape:lockguides="false" - inkscape:zoom="2.8241405" - inkscape:cx="91.355228" - inkscape:cy="80.555482" - inkscape:window-width="1309" - inkscape:window-height="845" - inkscape:window-x="77" - inkscape:window-y="25" - inkscape:window-maximized="0" - inkscape:current-layer="layer5" /> - <defs - id="defs2" /> - <g - inkscape:label="shapes" - inkscape:groupmode="layer" - id="layer1" - transform="translate(-57.156783,-86.766816)"> - <path - style="fill:none;stroke:#000000;stroke-width:0.254;stroke-dasharray:none" - d="M 57.322404,89.783599 67.731176,128.62967 H 100.69518 L 111.06993,89.910599 Z" - id="path1361" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.254;stroke-dasharray:none" - d="M 65.748753,95.873742 72.89382,122.53948 H 95.521845 L 102.64356,95.960921 Z" - id="path1361-1" /> - </g> - <g - inkscape:groupmode="layer" - id="layer3" - inkscape:label="grid" - transform="translate(-57.156783,-86.766816)"> - <path - style="stroke:#999999;stroke-width:0.1524;stroke-dasharray:0.1524, 0.3048;stroke-dashoffset:0" - d="m 57.156788,109.13041 57.193672,-0.004" - id="path1610" - sodipodi:nodetypes="cc" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:0.1524, 0.3048;stroke-dashoffset:0" - d="M 84.28933,130.72618 V 87.558035" - id="path1819" /> - <path - style="stroke:#4d4d4d;stroke-width:0.155188;stroke-dasharray:0.155188, 0.310377;stroke-dashoffset:0" - d="M 72.897809,130.72618 V 111.42985" - id="path1819-0" - sodipodi:nodetypes="cc" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:0.1524, 0.3048;stroke-dashoffset:0" - d="m 65.748753,99.575135 -0.121901,-12.0171" - id="path1819-6" - sodipodi:nodetypes="cc" /> - <path - style="stroke:#999999;stroke-width:0.1524;stroke-dasharray:0.1524, 0.3048;stroke-dashoffset:0" - d="m 84.272371,95.997531 30.078089,-0.0802 v 0 0" - id="path1610-6" - sodipodi:nodetypes="cccc" /> - <path - style="stroke:#999999;stroke-width:0.1524;stroke-dasharray:0.1524, 0.3048;stroke-dashoffset:0" - d="m 84.272369,128.65853 25.066641,0.0981 v 0 0" - id="path1610-6-1" - sodipodi:nodetypes="cccc" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:0.1524, 0.3048;stroke-dashoffset:0" - d="m 111.29629,92.981016 -0.1219,-5.422981" - id="path1819-6-2" - sodipodi:nodetypes="cc" /> - <path - style="stroke:#4d4d4d;stroke-width:0.155188;stroke-dasharray:0.155188, 0.310377;stroke-dashoffset:0" - d="m 100.61533,130.72618 v -6.25202" - id="path2693" - sodipodi:nodetypes="cc" /> - </g> - <g - inkscape:groupmode="layer" - id="layer5" - inkscape:label="distances" - transform="translate(-57.156783,-86.766816)"> - <path - style="fill:none;stroke:#4d4d4d;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="M 65.848739,88.616369 H 84.079504" - id="path2140" - sodipodi:nodetypes="cc" /> - <text - xml:space="preserve" - style="font-size:2.82223px;fill:none;stroke:#4d4d4d;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - x="71.944923" - y="87.557259" - id="text2146"><tspan - sodipodi:role="line" - id="tspan2144" - style="stroke-width:0.0762" - x="71.944923" - y="87.557259" /></text> - <text - xml:space="preserve" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - x="73.573662" - y="87.92437" - id="text2150"><tspan - sodipodi:role="line" - id="tspan2148" - style="font-size:2.11667px;stroke:none;stroke-width:0.0762" - x="73.573662" - y="87.92437">x<tspan - style="font-size:65%;baseline-shift:sub;stroke:none" - id="tspan2154">2</tspan></tspan></text> - <path - style="fill:#000000;stroke:#4d4d4d;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="M 73.113048,129.66784 H 84.075714" - id="path2156" - sodipodi:nodetypes="cc" /> - <text - xml:space="preserve" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - x="77.563271" - y="131.09329" - id="text2150-6"><tspan - sodipodi:role="line" - id="tspan2148-8" - style="font-size:2.11667px;stroke:none;stroke-width:0.0762" - x="77.563271" - y="131.09329">x<tspan - style="font-size:65%;baseline-shift:sub;stroke:none" - id="tspan2190">1</tspan></tspan></text> - <path - style="fill:none;stroke:#4d4d4d;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="M 113.12774,96.130476 V 108.91216" - id="path2267" - sodipodi:nodetypes="cc" /> - <text - xml:space="preserve" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - x="113.31844" - y="102.92061" - id="text2150-6-3"><tspan - sodipodi:role="line" - id="tspan2148-8-2" - style="font-size:2.11667px;stroke:none;stroke-width:0.0762" - x="113.31844" - y="102.92061">y<tspan - style="font-size:65%;baseline-shift:sub;stroke:none" - id="tspan2190-2">1</tspan></tspan></text> - <path - style="fill:none;stroke:#4d4d4d;stroke-width:0.077485;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 107.6733,109.34162 v 19.1987" - id="path2323" - sodipodi:nodetypes="cc" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 107.94714,128.47186 -0.27385,0.27382 -0.27382,-0.27382 z" - id="path3509-33-2" /> - <text - xml:space="preserve" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - x="107.88313" - y="119.25311" - id="text2150-6-3-6"><tspan - sodipodi:role="line" - id="tspan2148-8-2-5" - style="font-size:2.11667px;stroke:none;stroke-width:0.0762" - x="107.88313" - y="119.25311">y<tspan - style="font-size:65%;baseline-shift:sub;stroke:none" - id="tspan2190-2-0">2</tspan></tspan></text> - <path - style="fill:none;stroke:#4d4d4d;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="M 84.499156,88.616369 H 110.98614" - id="path2572" - sodipodi:nodetypes="cc" /> - <text - xml:space="preserve" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - x="96.706253" - y="87.92437" - id="text2578"><tspan - sodipodi:role="line" - id="tspan2576" - style="font-size:2.11667px;stroke:none;stroke-width:0.0762" - x="96.706253" - y="87.92437">x<tspan - style="font-size:65%;baseline-shift:sub;stroke:none" - id="tspan2574">4</tspan></tspan></text> - <path - style="fill:#000000;stroke:#4d4d4d;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 84.50295,129.66784 h 15.89788" - id="path2704" - sodipodi:nodetypes="cc" /> - <text - xml:space="preserve" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.0762;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - x="91.420631" - y="131.09329" - id="text2710"><tspan - sodipodi:role="line" - id="tspan2708" - style="font-size:2.11667px;stroke:none;stroke-width:0.0762" - x="91.420631" - y="131.09329">x<tspan - style="font-size:65%;baseline-shift:sub;stroke:none" - id="tspan2706">3</tspan></tspan></text> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 65.917196,88.890197 -0.273828,-0.273828 0.273828,-0.273828 z" - id="path3509" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 84.567613,88.890197 -0.273828,-0.273828 0.273828,-0.273828 z" - id="path3509-0" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 84.011047,88.342541 0.273828,0.273828 -0.273828,0.273828 z" - id="path3509-8" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 110.91769,88.342539 0.27382,0.27384 -0.27382,0.27382 z" - id="path3509-7" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 73.181505,129.94167 -0.273828,-0.27382 0.273828,-0.27384 z" - id="path3509-6" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 84.571407,129.94167 -0.273828,-0.27382 0.273828,-0.27382 z" - id="path3509-3" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 84.007259,129.39401 0.27382,0.27384 -0.27382,0.27382 z" - id="path3509-1" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 100.33238,129.39401 0.27382,0.27382 -0.27382,0.27384 z" - id="path3509-2" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 112.8539,96.198931 0.27384,-0.27382 0.27382,0.27382 z" - id="path3509-33" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 113.40157,108.8437 -0.27384,0.27382 -0.27382,-0.27382 z" - id="path3509-33-0" /> - <path - style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 107.39947,109.41008 0.27385,-0.27382 0.27382,0.27382 z" - id="path3509-33-9" /> - </g> - <g - inkscape:groupmode="layer" - id="layer4" - inkscape:label="angles" - transform="translate(-57.156783,-86.766816)"> - <text - xml:space="preserve" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.1524;stroke-dasharray:0.1524, 0.3048;stroke-dashoffset:0" - x="70.634277" - y="114.13088" - id="text1977"><tspan - sodipodi:role="line" - id="tspan1975" - style="font-size:2.11667px;fill:#000000;stroke:none;stroke-width:0.1524" - x="70.634277" - y="114.13088">α<tspan - style="font-size:65%;baseline-shift:sub;fill:#000000;stroke:none" - id="tspan2038">f</tspan></tspan></text> - <path - style="fill:none;stroke:#4d4d4d;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 71.032843,115.59423 c 0.66103,-0.34956 1.287638,-0.48748 1.85838,-0.49795" - id="path2046" - sodipodi:nodetypes="cc" /> - <path - style="fill:none;stroke:#4d4d4d;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 73.890932,126.26076 c -0.310947,0.12892 -0.702844,0.25115 -1.071915,0.25115" - id="path2046-2" - sodipodi:nodetypes="cc" /> - <path - style="fill:none;stroke:#4d4d4d;stroke-width:0.1524;stroke-linecap:butt;stroke-dasharray:none;stroke-dashoffset:0" - d="m 64.546465,91.472944 c 0.310947,-0.128919 0.702844,-0.251149 1.071916,-0.251149" - id="path2046-2-6" - sodipodi:nodetypes="cc" /> - </g> - <g - inkscape:groupmode="layer" - id="layer2" - inkscape:label="measures" - style="stroke:#4d4d4d" - transform="translate(-57.156783,-86.766816)"> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 72.893819,109.07456 v 19.55511" - id="path1389" - sodipodi:nodetypes="cc" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 72.893819,122.53948 1.63186,6.09019" - id="path1393" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="M 72.893819,122.53948 H 66.099313" - id="path1397" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 84.20783,122.53948 0.0053,6.09019" - id="path1401" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 69.321285,109.20661 -6.794495,2e-5" - id="path1403" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 83.762126,125.58458 h 0.896708 v 0 0" - id="path1405-8" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 65.670038,108.75827 v 0.8967 0 0" - id="path1405-7" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 66.178038,108.75827 v 0.8967 0 0" - id="path1405-7-4" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 69.242567,122.09113 v 0.8967 0 0" - id="path1405-7-8" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 69.750567,122.09113 v 0.8967 0 0" - id="path1405-7-4-0" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="M 65.748751,95.873741 65.583138,89.803118" - id="path1387" - sodipodi:nodetypes="cc" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="M 65.748751,95.873741 64.121206,89.799662" - id="path1391" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 65.748751,95.873741 h -6.7945" - id="path1395" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 84.196154,95.917331 1.1e-5,-6.070232" - id="path1399" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 83.747806,92.882215 h 0.896708 v 0 0" - id="path1405" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 62.097502,95.425391 v 0.8967 0 0" - id="path1405-7-5" /> - <path - style="stroke:#4d4d4d;stroke-width:0.1524;stroke-dasharray:none" - d="m 62.605502,95.425391 v 0.8967 0 0" - id="path1405-7-4-8" /> - </g> -</svg> diff --git a/doc/sciglass_tower_stacking.svg b/doc/sciglass_tower_stacking.svg deleted file mode 100644 index 19cbaee53..000000000 --- a/doc/sciglass_tower_stacking.svg +++ /dev/null @@ -1,307 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="113.35196mm" - height="91.197235mm" - viewBox="0 0 113.35196 91.197235" - version="1.1" - id="svg8" - inkscape:version="0.91 r13725" - sodipodi:docname="sciglass_tower_stacking.svg"> - <defs - id="defs2" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="202.24027" - inkscape:cy="170.56017" - inkscape:document-units="mm" - inkscape:current-layer="layer1" - inkscape:document-rotation="0" - showgrid="false" - inkscape:window-width="1370" - inkscape:window-height="855" - inkscape:window-x="70" - inkscape:window-y="1" - inkscape:window-maximized="1" - fit-margin-top="1" - fit-margin-left="1" - fit-margin-right="1" - fit-margin-bottom="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(-20.012562,-104.02093)"> - <path - style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 118.70971,184.6574 -95.648159,-3.6076 3.057998,-36.05997 94.889771,12.55061 z" - id="path881-6" - inkscape:connector-curvature="0" /> - <path - style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 115.9663,153.97492 21.168157,140.75006 27.843286,105.1816 120.98597,127.22758 Z" - id="path881" - inkscape:connector-curvature="0" /> - <rect - style="opacity:0.55626999;fill:none;stroke:#000000;stroke-width:0.45953801;stroke-linejoin:round;stroke-dasharray:0.459538, 0.459538" - id="rect851" - width="95.610909" - height="27.214285" - x="46.766327" - y="102.72878" - transform="matrix(0.98284193,0.18444983,-0.18444983,0.98284193,0,0)" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.132;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.056, 1.056;stroke-dashoffset:0;stroke-opacity:1" - d="m 121.19673,114.81766 c 0,0 0,69.80265 0,79.40051" - id="path853" - inkscape:connector-curvature="0" /> - <rect - style="opacity:0.55626999;fill:none;stroke:#000000;stroke-width:0.459539;stroke-linejoin:round;stroke-dasharray:0.459539, 0.459539" - id="rect851-7" - width="95.610909" - height="27.214285" - x="38.277802" - y="146.75175" - transform="matrix(0.9964235,0.08449981,-0.08449981,0.9964235,0,0)" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52778006px;line-height:9.89999962;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="55.404697" - y="141.54611" - id="text903"><tspan - sodipodi:role="line" - x="55.404697" - y="141.54611" - style="font-size:3.52778006px;baseline-shift:baseline;stroke-width:0.26458299px" - id="tspan907">α<tspan - style="font-size:64.99999762%;baseline-shift:sub" - id="tspan911">i</tspan></tspan></text> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 54.522983,145.39462 c 0,0 -0.133636,-2.27179 0.935442,-3.0736" - id="path913" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 58.932931,152.20999 Z" - id="path915" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 58.932931,152.20999 c 0,0 -0.133636,-1.87088 0.668174,-2.93996" - id="path917" - inkscape:connector-curvature="0" /> - <text - xml:space="preserve" - style="font-size:3.52777004px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:none;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="53.721176" - y="150.60637" - id="text921" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan919" - x="53.721176" - y="150.60637" - style="stroke-width:0.26458299px" /></text> - <text - xml:space="preserve" - style="font-size:3.52777004px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:none;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="55.458424" - y="159.82718" - id="text927" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan925" - x="55.458424" - y="159.82718" - style="stroke-width:0.26458299px" /></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52777004px;line-height:9.89999962;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="56.610561" - y="154.78633" - id="text903-2"><tspan - sodipodi:role="line" - x="56.610561" - y="154.78633" - style="font-size:3.52777004px;baseline-shift:baseline;stroke-width:0.26458299px" - id="tspan907-6">α<tspan - style="font-size:64.99999762%;baseline-shift:sub" - id="tspan950">(i-1)</tspan></tspan></text> - <text - xml:space="preserve" - style="font-size:3.52777004px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:none;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="93.277069" - y="170.6516" - id="text954" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan952" - x="93.277069" - y="170.6516" - style="stroke-width:0.26458299px" /></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52777004px;line-height:9.89999962;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="116.84573" - y="153.86206" - id="text903-5"><tspan - sodipodi:role="line" - x="116.84573" - y="153.86206" - style="font-size:3.52777004px;baseline-shift:baseline;stroke-width:0.26458299px" - id="tspan907-5">γ<tspan - style="font-size:64.99999762%;baseline-shift:sub" - id="tspan977">i</tspan></tspan></text> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 118.22386,157.15541 c 0,0 0.40161,-2.50409 2.95294,-2.97656" - id="path979" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 118.87351,138.1503 c 0,0 0.42522,0.37797 2.36235,0.42522" - id="path996" - inkscape:connector-curvature="0" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52777004px;line-height:9.89999962;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="121.75632" - y="139.47372" - id="text903-5-1"><tspan - sodipodi:role="line" - x="121.75632" - y="139.47372" - style="font-size:3.52777004px;baseline-shift:baseline;stroke-width:0.26458299px" - id="tspan907-5-5">β<tspan - style="font-size:64.99999762%;baseline-shift:sub" - id="tspan1025">i</tspan></tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52777004px;line-height:9.89999962;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="121.77092" - y="171.75256" - id="text903-5-1-4"><tspan - sodipodi:role="line" - x="121.77092" - y="171.75256" - style="font-size:3.52777004px;baseline-shift:baseline;stroke-width:0.26458299px" - id="tspan907-5-5-4">β<tspan - style="font-size:2.29305005px;baseline-shift:sub;stroke-width:0.26458299px" - id="tspan1025-5">(i-1)</tspan></tspan></text> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 119.84207,171.17597 c 0,0 0.63784,0.23623 1.41741,0.25985" - id="path1080" - inkscape:connector-curvature="0" /> - <text - xml:space="preserve" - style="font-size:3.52777004px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:none;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="123.03125" - y="190.40552" - id="text1084" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan1082" - x="123.03125" - y="190.40552" - style="stroke-width:0.26458299px" /></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52777004px;line-height:9.89999962;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="121.817" - y="191.11963" - id="text903-5-1-4-5"><tspan - sodipodi:role="line" - x="121.817" - y="191.11963" - style="font-size:3.52777004px;baseline-shift:baseline;stroke-width:0.26458299px" - id="tspan907-5-5-4-6">r=r<tspan - style="font-size:64.99999762%;baseline-shift:sub" - id="tspan1107">0</tspan></tspan></text> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.265, 0.53;stroke-dashoffset:0;stroke-opacity:1" - d="m 120.98597,127.22758 7.46894,0" - id="path1163" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.265, 0.53;stroke-dashoffset:0;stroke-opacity:1" - d="m 121.00935,157.54047 7.46894,0" - id="path1163-5" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.13500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 126.8674,127.22758 0.0234,30.31289" - id="path1180" - inkscape:connector-curvature="0" /> - <text - xml:space="preserve" - style="font-size:3.52777004px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:none;stroke:#000000;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="128.32127" - y="144.44319" - id="text1184" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan1182" - x="128.32127" - y="144.44319" - style="stroke-width:0.26458299px" /></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52777004px;line-height:9.89999962;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458299px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="127.67739" - y="145.1073" - id="text903-5-1-3"><tspan - sodipodi:role="line" - x="127.67739" - y="145.1073" - style="font-size:3.52777004px;baseline-shift:baseline;stroke-width:0.26458299px" - id="tspan907-5-5-3">Δz<tspan - style="font-size:64.99999762%;baseline-shift:sub" - id="tspan1207">i</tspan></tspan></text> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.13500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 126.8674,127.22758 -0.61209,0.87352 0.61421,0" - id="path1209" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.13500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 126.87164,127.22758 0.61209,0.87352 -0.61421,0" - id="path1209-3" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.13500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 126.88656,157.54047 -0.61209,-0.87352 0.61421,0" - id="path1209-8" - inkscape:connector-curvature="0" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.13500001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 126.8908,157.54047 0.61209,-0.87352 -0.61421,0" - id="path1209-3-7" - inkscape:connector-curvature="0" /> - </g> -</svg> diff --git a/src/BarrelCalorimeterSciGlass_geo.cpp b/src/BarrelCalorimeterSciGlass_geo.cpp deleted file mode 100644 index b3f53ff34..000000000 --- a/src/BarrelCalorimeterSciGlass_geo.cpp +++ /dev/null @@ -1,417 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Dmitry Kalinkin, Wouter Deconinck - -#include <array> -#include <limits> -#include <string> - -#include <DD4hep/DetFactoryHelper.h> -#include <DD4hep/Printout.h> - -using std::string; -using namespace dd4hep; - -static Ref_t create_detector(Detector& lcdd, xml_h handle, SensitiveDetector sens) -{ - xml_det_t det_handle = handle; - xml_dim_t envelope_handle = det_handle.dimensions(); - xml_dim_t sectors_handle = det_handle.child(_Unicode(sectors)); - xml_dim_t rows_handle = sectors_handle.child(_Unicode(rows)); - xml_dim_t dim_handle = rows_handle.dimensions(); - Material tower_mat = lcdd.material(det_handle.materialStr()); - double row_rmin = dim_handle.inner_r(); - DetElement det_element{det_handle.nameStr(), det_handle.id()}; - - // envelope - std::vector<double> v_rmin, v_rmax, v_z; - - { - auto dim = det_handle.dimensions(); - auto rmin = dim.rmin(); - auto rmax = dim.rmax(); - auto zmin = dim.zmin(); - auto zmax = dim.zmax(); - auto etamin = dd4hep::getAttrOrDefault<double>(det_handle.child(_U(dimensions)), _Unicode(etamin), - -std::numeric_limits<double>::max()); - auto etamax = dd4hep::getAttrOrDefault<double>(det_handle.child(_U(dimensions)), _Unicode(etamax), - +std::numeric_limits<double>::max()); - auto theta = [](const auto eta) { return 2.0 * atan(exp(-eta)); }; - - // backward nose cone - printout(DEBUG, "SciGlassCalorimeter", "etamin cutout: etamin = %f, thetamin = %f", etamin, theta(etamin)); - if (zmin * tan(theta(etamin)) < rmin) { - // no cutout: regular end face - printout(DEBUG, "SciGlassCalorimeter", "no etamin cutout: zmin * tan(theta(etamin)) = %f < rmin = %f", - zmin * tan(theta(etamin)), rmin); - v_z.emplace_back(zmin); - v_rmin.emplace_back(rmin); - v_rmax.emplace_back(rmax); - } else { - // with cutout: first add zmin side - printout(DEBUG, "SciGlassCalorimeter", "etamin cutout: zmin * tan(theta(etamin)) = %f > rmin = %f", - zmin * tan(theta(etamin)), rmin); - auto z = std::max(zmin, rmax / tan(theta(etamin))); // zmin or furthest backwards - v_z.emplace_back(z); - v_rmin.emplace_back(std::max(rmin, z * tan(theta(etamin)))); - v_rmax.emplace_back(rmax); - // then where cutout starts - v_z.emplace_back(rmin / tan(theta(etamin))); - v_rmin.emplace_back(rmin); - v_rmax.emplace_back(rmax); - } - - // forward nose cone - printout(DEBUG, "SciGlassCalorimeter", "etamax cutout: etamax = %f, thetamax = %f", etamax, theta(etamax)); - if (zmax * tan(theta(etamax)) < rmin) { - // no cutout: regular end face - printout(DEBUG, "SciGlassCalorimeter", "no etamax cutout: zmax * tan(theta(etamin)) = %f < rmin = %f", - zmax * tan(theta(etamax)), rmin); - v_z.emplace_back(zmax); - v_rmin.emplace_back(rmin); - v_rmax.emplace_back(rmax); - } else { - // with cutout: first add where cutout starts - printout(DEBUG, "SciGlassCalorimeter", "etamax cutout: zmax * tan(theta(etamax)) = %f > rmin = %f", - zmax * tan(theta(etamax)), rmin); - v_z.emplace_back(rmin / tan(theta(etamax))); - v_rmin.emplace_back(rmin); - v_rmax.emplace_back(rmax); - // then add zmax side - auto z = std::min(zmax, rmax / tan(theta(etamax))); // zmax or furthest forward - v_z.emplace_back(z); - v_rmin.emplace_back(std::max(rmin, z * tan(theta(etamax)))); - v_rmax.emplace_back(rmax); - } - } - - // create polycone - Polycone envelope_shape(0.0, 2 * M_PI, v_rmin, v_rmax, v_z); - Volume envelope_v{det_handle.nameStr(), envelope_shape, lcdd.material("Air")}; - - PlacedVolume envelope_pv = lcdd.pickMotherVolume(det_element).placeVolume(envelope_v); - envelope_pv.addPhysVolID("system", det_handle.id()); - det_element.setPlacement(envelope_pv); - - sens.setType("calorimeter"); - - double support_inner_r = std::numeric_limits<double>::max(); - - if (det_handle.hasChild(_Unicode(outer_supports))) { - xml_comp_t outer_supports = det_handle.child(_Unicode(outer_supports)); - - for (xml_coll_t layer_handle{outer_supports, _Unicode(layer)}; layer_handle; ++layer_handle) { - xml_comp_t outer_support_handle = layer_handle; - Material outer_support_mat = lcdd.material(outer_support_handle.materialStr()); - - Tube outer_support_tube_full_shape{outer_support_handle.inner_r(), - outer_support_handle.inner_r() + outer_support_handle.thickness(), - (envelope_handle.zmax() - envelope_handle.zmin()) / 2}; - IntersectionSolid outer_support_tube_shape{ - outer_support_tube_full_shape, - envelope_shape, - }; - - support_inner_r = std::min(support_inner_r, outer_support_handle.inner_r()); - - Volume outer_support_tube_v{"outer_support", outer_support_tube_shape, outer_support_mat}; - outer_support_tube_v.setVisAttributes(lcdd.visAttributes(outer_support_handle.visStr())); - envelope_v.placeVolume(outer_support_tube_v); - } - } - - double sector_rmin = envelope_handle.rmin(); - - if (det_handle.hasChild(_Unicode(wedge_box))) { - xml_comp_t wedge_box_handle = det_handle.child(_Unicode(wedge_box)); - Material wedge_box_mat = lcdd.material(wedge_box_handle.materialStr()); - - // Approximate bottoms of wedge boxes with a single tube common for all sectors - // The actual wedge bottom may have to be a plane, not a tube section - - Tube wedge_box_tube_full_shape{wedge_box_handle.inner_r(), - wedge_box_handle.inner_r() + wedge_box_handle.thickness(), - (envelope_handle.zmax() - envelope_handle.zmin()) / 2}; - IntersectionSolid wedge_box_tube_shape{ - wedge_box_tube_full_shape, - envelope_shape, - }; - - Volume wedge_box_tube_v{"wedge_box_placeholder", wedge_box_tube_shape, wedge_box_mat}; - wedge_box_tube_v.setVisAttributes(lcdd.visAttributes(wedge_box_handle.visStr())); - envelope_v.placeVolume(wedge_box_tube_v); - - const double side_rmin = wedge_box_handle.inner_r() + wedge_box_handle.thickness(); - const double side_rmax_default = std::min(envelope_handle.rmax(), - // subtract a unit of thickness to avoid an overlap - support_inner_r - wedge_box_handle.thickness()); - const double side_rmax = dd4hep::getAttrOrDefault<double>(wedge_box_handle, _U(outer_r), side_rmax_default); - - sector_rmin = side_rmin; - - Box wedge_box_side_box_shape{ - (side_rmax - side_rmin) / 2, - wedge_box_handle.thickness() / 2, (envelope_handle.zmax() - envelope_handle.zmin()) / 2}; - Volume wedge_box_side_v[2]; - for (int side = -1; side <= 1; side += 2) { - IntersectionSolid wedge_box_side_shape{envelope_shape, wedge_box_side_box_shape, - Position{(side_rmax + side_rmin) / 2, side * wedge_box_handle.gap() / 2, - (envelope_handle.zmax() + envelope_handle.zmin()) / 2}}; - - wedge_box_side_v[(side + 1) / 2] = Volume({"wedge_box_side", wedge_box_side_shape, wedge_box_mat}); - wedge_box_side_v[(side + 1) / 2].setVisAttributes(lcdd.visAttributes(wedge_box_handle.visStr())); - } - - int sector = 0; - double sector_phi = sectors_handle.phi0(); - for (; sector < sectors_handle.number(); sector++, sector_phi += sectors_handle.deltaphi()) { - for (int side = -1; side <= 1; side += 2) { - envelope_v.placeVolume(wedge_box_side_v[(side + 1) / 2], - Transform3D{RotationZ{sector_phi + side * sectors_handle.deltaphi() / 2}}); - } - } - - // TODO: The endcap sides of the box are not implemented - } - - int row = 0; - double row_phi = -rows_handle.deltaphi() / 2 * (rows_handle.number() - 1); - - Tube sector_tube_shape{sector_rmin, std::min(support_inner_r, envelope_handle.rmax()), - (envelope_handle.zmax() - envelope_handle.zmin()) / 2, - -rows_handle.deltaphi() / 2 * rows_handle.number(), - rows_handle.deltaphi() / 2 * rows_handle.number()}; - IntersectionSolid sector_shape{envelope_shape, sector_tube_shape, - Position{0., 0., (envelope_handle.zmax() + envelope_handle.zmin()) / 2}}; - - Volume sector_v{"sector", sector_shape, lcdd.material("Air")}; - sector_v.setVisAttributes(lcdd.visAttributes(det_handle.visStr())); - - for (; row < rows_handle.number(); row++, row_phi += rows_handle.deltaphi()) { - - const double tower_gap_longitudinal = dim_handle.gap(); - - // negative rapidity towers will be counted backwards from -1 - std::array<int, 2> tower_ids = {-1, 0}; - std::array<double, 2> betas = {0., 0.}; - std::array<double, 2> beta_prevs = {0., 0.}; - std::array<double, 2> dzs = {0., 0.}; - std::array<double, 2> flare_angle_polar_prevs = {0., 0.}; - - for (xml_coll_t family_handle{rows_handle, _Unicode(family)}; family_handle; ++family_handle) { - const int dir_sign = family_handle.attr<double>(_Unicode(dir_sign)); - int& tower_id = tower_ids[(dir_sign > 0) ? 1 : 0]; - double& beta = betas[(dir_sign > 0) ? 1 : 0]; - double& beta_prev = beta_prevs[(dir_sign > 0) ? 1 : 0]; - double& dz = dzs[(dir_sign > 0) ? 1 : 0]; - double& flare_angle_polar_prev = flare_angle_polar_prevs[(dir_sign > 0) ? 1 : 0]; - - xml_dim_t family_dim_handle = family_handle; - const double length = family_dim_handle.z_length(); - const auto flare_angle_polar = family_dim_handle.attr<double>(_Unicode(flare_angle_polar)); - const unsigned int number = family_dim_handle.number(); - - // some per-family calculations rely on extreme values of "beta" to make - // conservative estimates - double beta_max = beta + flare_angle_polar_prev + (2 * number - 1) * flare_angle_polar; - - const double z = length / 2; - // Face parameters (see doc/sciglass_tower_front_view.svg for definitions) - const double y1 = family_dim_handle.y1(); - const double y2 = y1 + length * tan(flare_angle_polar); - double x1 = family_dim_handle.x1(); - - const auto flare_angle_at_face_s = family_dim_handle.attr<string>(_Unicode(flare_angle_at_face)); - double flare_angle_at_face; - if (flare_angle_at_face_s == "auto") { - flare_angle_at_face = asin(sin(beta_max) * (x1 / row_rmin)); - } else { - flare_angle_at_face = family_dim_handle.attr<double>(_Unicode(flare_angle_at_face)); - } - - double x2 = family_dim_handle.x1() + (2 * y1) * tan(flare_angle_at_face); - double x3, x4; - - const auto flare_angle_azimuthal_s = family_dim_handle.attr<string>(_Unicode(flare_angle_azimuthal)); - if (flare_angle_azimuthal_s == "pyramidal") { - // Pyramidal shape - // corresponds to: tan(flare_angle_azimuthal) = (x1 / y1 + tan(flare_angle_at_face)) * tan(flare_angle_polar) - x3 = x1 * (y2 / y1); - x4 = x2 * (y2 / y1); - } else { - double flare_angle_azimuthal; - // Azimuthal flaring independently defined - if (flare_angle_azimuthal_s == "auto") { - // This is a solution to x4 - x1 = delta_r * tan(alpha), where the - // "alpha" is the azimuthal flaring for projection to x-y plane and - // "delta_r" is the length of the projection of the tower onto the - // same x-y plane. - // Here, we assumed tan(alpha) = x1 / row_rmin flaring preserves the - // desired gap, which is strictly not true. - flare_angle_azimuthal = atan( - (cos(beta_max) + sin(beta_max) * 2 * y1 / length) * (x1 / row_rmin) - - (x2 - x1) / length - - tan(flare_angle_polar) * tan(flare_angle_at_face) - ); - } else { - flare_angle_azimuthal = family_dim_handle.attr<double>(_Unicode(flare_angle_azimuthal)); - } - - x3 = x1 + length * (tan(flare_angle_azimuthal) - tan(flare_angle_polar) * tan(flare_angle_at_face)); - x4 = x2 + length * (tan(flare_angle_azimuthal) + tan(flare_angle_polar) * tan(flare_angle_at_face)); - } - - if (dir_sign < 0) { - // Mirror towers going towards negative rapidities - std::swap(x1, x2); - std::swap(x3, x4); - } - const double theta = 0.; - const double phi = 0.; - const double alpha1 = 0.; - const double alpha2 = 0.; - - for (unsigned int tower = 0; tower < number; tower++, tower_id += dir_sign) { - // see https://github.com/eic/epic/blob/main/doc/sciglass_tower_stacking.svg - beta += flare_angle_polar_prev + flare_angle_polar; - const double gamma = M_PI_2 - flare_angle_polar_prev - beta_prev; - - const double dz_prev = dz; - dz += (tower_gap_longitudinal / cos(flare_angle_polar) + 2 * y1) * sin(M_PI - gamma - beta) / sin(gamma); - const string t_name = _toString(row, "_row%d") + _toString(tower_id, "_tower%d"); - sector_v - .placeVolume( - Volume{t_name, Trap{z, theta, phi, y1, x1, x2, alpha1, y2, x3, x4, alpha2}, tower_mat}, - Transform3D{RotationZ{-M_PI_2 + row_phi}} * Transform3D{Position{0. * cm, row_rmin, dir_sign * dz}} * - Transform3D{RotationX{-M_PI / 2 + dir_sign * beta}} * Transform3D{Position{0, dir_sign * y1, z}}) - .addPhysVolID("row", row) - .addPhysVolID("tower", tower_id) - .volume() - .setSensitiveDetector(sens) - .setVisAttributes(lcdd.visAttributes(family_dim_handle.visStr())); - - if (sectors_handle.hasChild(_Unicode(carbon_fiber_support))) { - xml_comp_t carbon_fiber_support_handle = sectors_handle.child(_Unicode(carbon_fiber_support)); - xml_comp_t cut_out_handle = carbon_fiber_support_handle.child(_Unicode(cut_out)); - Material carbon_fiber_support_mat = lcdd.material(carbon_fiber_support_handle.materialStr()); - - const double margin_horizontal = cut_out_handle.attr<double>(_Unicode(margin_horizontal)); - const double margin_top = cut_out_handle.attr<double>(_Unicode(margin_top)); - const double margin_bottom = cut_out_handle.attr<double>(_Unicode(margin_bottom)); - const double overhang_top = carbon_fiber_support_handle.attr<double>(_Unicode(overhang_top)); - const double overhang_bottom = carbon_fiber_support_handle.attr<double>(_Unicode(overhang_bottom)); - - const double y1_long = - y1 + tower_gap_longitudinal / 2 / cos(flare_angle_polar) - overhang_bottom * tan(flare_angle_polar); - const double y2_long = - y2 + tower_gap_longitudinal / 2 / cos(flare_angle_polar) + overhang_top * tan(flare_angle_polar); - - Trap trap_long_1{z + (overhang_top + overhang_bottom) / 2, - theta, - phi, - y1_long, - carbon_fiber_support_handle.thickness() / 4, - carbon_fiber_support_handle.thickness() / 4, - alpha1, - y2_long, - carbon_fiber_support_handle.thickness() / 4, - carbon_fiber_support_handle.thickness() / 4, - alpha2}; - Trap trap_long_2{ - z - (margin_top + margin_bottom) / 2, - theta, - phi, - y1_long - margin_horizontal / - 2, // FIXME: y1_long/y2_long do not account for reduction of z by the vertical margins - carbon_fiber_support_handle - .thickness(), // no division by 2 to ensure subtrahend volume is thicker than the minuend - carbon_fiber_support_handle.thickness(), - alpha1, - y2_long - margin_horizontal / 2, - carbon_fiber_support_handle.thickness(), - carbon_fiber_support_handle.thickness(), - alpha2}; - SubtractionSolid trap_long{trap_long_1, trap_long_2, Position{0., 0., (margin_bottom - margin_top) / 2}}; - - for (int side = -1; side <= 1; side += 2) { - sector_v - .placeVolume(Volume{"fiber_structure_longitudinal", trap_long, carbon_fiber_support_mat}, - Transform3D{RotationZ{-M_PI_2 + row_phi + side * rows_handle.deltaphi() / 2}} * - Transform3D{Position{0. * cm, row_rmin, dir_sign * dz}} * - Transform3D{RotationX{-M_PI / 2 + dir_sign * beta}} * - Transform3D{Position{side * carbon_fiber_support_handle.thickness() / 4, dir_sign * y1, - z + (overhang_top - overhang_bottom) / 2}}) - .volume() - .setVisAttributes(lcdd.visAttributes(carbon_fiber_support_handle.visStr())); - } - - const double dz_trans = dz_prev + (tower_gap_longitudinal / 2 + carbon_fiber_support_handle.thickness() / 2) / - cos(flare_angle_polar) * sin(M_PI - gamma - beta) / sin(gamma); - - const double non_overlap_long = - sin(beta) * (tower_gap_longitudinal / cos(flare_angle_polar) + 2 * y1) / sin(gamma); - - const double beta_trans = beta_prev + flare_angle_polar_prev; - const double x1_trans = tan(rows_handle.deltaphi() / 2) * (row_rmin - overhang_bottom * cos(beta_trans)) - - carbon_fiber_support_handle.thickness() / 2 / cos(rows_handle.deltaphi() / 2); - const double x2_trans = tan(rows_handle.deltaphi() / 2) * - (row_rmin + (2 * z + overhang_top + non_overlap_long) * cos(beta_trans)) - - carbon_fiber_support_handle.thickness() / 2 / cos(rows_handle.deltaphi() / 2); - - Trap trap_trans_1{z + (overhang_top + non_overlap_long + overhang_bottom) / 2, - theta, - phi, - carbon_fiber_support_handle.thickness() / 2, - x1_trans, - x1_trans, - alpha1, - carbon_fiber_support_handle.thickness() / 2, - x2_trans, - x2_trans, - alpha2}; - Trap trap_trans_2{ - z - (margin_top + non_overlap_long + margin_bottom) / 2, - theta, - phi, - carbon_fiber_support_handle - .thickness(), // no division by 2 to ensure subtrahend volume is thicker than the minuend - x1_trans - margin_horizontal / - 2, // FIXME: x1_trans/x2_trans do not account for reduction of z by the vertical margins - x1_trans - margin_horizontal / 2, - alpha1, - carbon_fiber_support_handle.thickness(), - x2_trans - margin_horizontal / 2, - x2_trans - margin_horizontal / 2, - alpha2}; - SubtractionSolid trap_trans{ - trap_trans_1, trap_trans_2, - Position{0., 0., (margin_bottom - margin_top) / 2 + (overhang_bottom - overhang_top) / 2}}; - - sector_v - .placeVolume(Volume{"fiber_structure_transverse" + t_name, trap_trans, carbon_fiber_support_mat}, - Transform3D{RotationZ{-M_PI_2 + row_phi}} * - Transform3D{Position{0. * cm, row_rmin, dir_sign * dz_trans}} * - Transform3D{RotationX{-M_PI / 2 + dir_sign * beta_trans}} * - Transform3D{Position{0, dir_sign * carbon_fiber_support_handle.thickness() / 2, - z + (overhang_top + non_overlap_long - overhang_bottom) / 2}}) - .volume() - .setVisAttributes(lcdd.visAttributes(carbon_fiber_support_handle.visStr())); - } - - beta_prev = beta; - flare_angle_polar_prev = flare_angle_polar; - } - } - } - - int sector = 0; - double sector_phi = sectors_handle.phi0(); - for (; sector < sectors_handle.number(); sector++, sector_phi += sectors_handle.deltaphi()) { - envelope_v.placeVolume(sector_v, Transform3D{RotationZ{sector_phi}}).addPhysVolID("sector", sector); - } - - envelope_v.setVisAttributes(lcdd.visAttributes(det_handle.visStr())); - - return det_element; -} - -DECLARE_DETELEMENT(epic_EcalBarrelSciGlass, create_detector) diff --git a/src/BarrelPlanarMPGDTracker_geo.cpp b/src/BarrelPlanarMPGDTracker_geo.cpp index 665e56e39..02f75c7a8 100644 --- a/src/BarrelPlanarMPGDTracker_geo.cpp +++ b/src/BarrelPlanarMPGDTracker_geo.cpp @@ -321,4 +321,3 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, //@} // clang-format off DECLARE_DETELEMENT(epic_OuterMPGDBarrel, create_BarrelPlanarMPGDTracker_geo) -DECLARE_DETELEMENT(epic_MPGDDIRC, create_BarrelPlanarMPGDTracker_geo) From 76129f3ce4fd8c521d160e5e6090ada890ba02ed Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Tue, 12 Mar 2024 07:35:16 -0500 Subject: [PATCH 035/113] feat: define and add inner detector barrel support cylinder (1 cm CF) (#659) ### Briefly, what does this PR introduce? This PR adds the outer MPGD barrel support cylinder, which is 1 cm thick carbon fiber. Absent better info, it is defined here as sitting just inside the MPGD rmin, for the full length and offset of the outer MPGD barrel. TODO: - [x] fix overlaps with current dimensions, - [ ] verify dimensions with engineers, - [ ] fix overlaps with new dimensions. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, more material in front of outer MPGD barrel and barrel imaging calorimeter. --- compact/tracking/mpgd_outerbarrel.xml | 2 +- .../tracking/support_service_craterlake.xml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/compact/tracking/mpgd_outerbarrel.xml b/compact/tracking/mpgd_outerbarrel.xml index 4d31f71dc..fbbb8fca3 100644 --- a/compact/tracking/mpgd_outerbarrel.xml +++ b/compact/tracking/mpgd_outerbarrel.xml @@ -24,7 +24,7 @@ <constant name="MPGDOuterBarrelModule_rmax" value="MPGDOuterBarrelModule_rmin + MPGDOuterBarrelModule_allowed_space" /> <constant name="MPGDOuterBarrelModule_roffset" value="0.5*cm" /> <constant name="MPGDOuterBarrelModule_width" value="36.0*cm"/> - <constant name="MPGDOuerBarrel_length" value="MPGDOuterBarrelModule_zmin1 + MPGDOuterBarrelModule_zmin2"/> + <constant name="MPGDOuterBarrel_length" value="MPGDOuterBarrelModule_zmin1 + MPGDOuterBarrelModule_zmin2"/> <constant name="MPGDOuterBarrelModule_length" value="0.5*(MPGDOuterBarrelModule_zmin1 + MPGDOuterBarrelModule_zmin2 + MPGDOuterBarrelModule_zoverlap)"/> <constant name="MPGDOuterBarrelModule_offset" value="(MPGDOuterBarrelModule_zmin2 - MPGDOuterBarrelModule_zmin1)/2.0"/> diff --git a/compact/tracking/support_service_craterlake.xml b/compact/tracking/support_service_craterlake.xml index 241b59ba0..55ba62bff 100644 --- a/compact/tracking/support_service_craterlake.xml +++ b/compact/tracking/support_service_craterlake.xml @@ -168,6 +168,14 @@ <constant name="TrackerSupportCylN_thickness2B" value="TrackerSupportCylAlN_thickness2B + TrackerSupportCylCF_thickness2 + TrackerSupportCylAlN_thickness2SiCone+TrackerSupportCylAlN_thickness2SiDisk" /> <constant name="TrackerSupportCylN_thickness2C" value="TrackerSupportCylAlN_thickness2C + TrackerSupportCylCF_thickness2 + TrackerSupportCylAlN_thickness2SiCone+TrackerSupportCylAlN_thickness2SiDisk" /> + <comment> Inner detector support cylinder </comment> + <constant name="InnerDetectorBarrelSupportCylCF_thickness" value="1.0*cm" /> + <constant name="InnerDetectorBarrelSupportCylCF_zmin1" value="MPGDOuterBarrelModule_zmin1" /> + <constant name="InnerDetectorBarrelSupportCylCF_zmin2" value="MPGDOuterBarrelModule_zmin2" /> + <constant name="InnerDetectorBarrelSupportCylCF_length" value="InnerDetectorBarrelSupportCylCF_zmin1 + InnerDetectorBarrelSupportCylCF_zmin2" /> + <constant name="InnerDetectorBarrelSupportCylCF_offset" value="(InnerDetectorBarrelSupportCylCF_zmin2 - InnerDetectorBarrelSupportCylCF_zmin1)/2.0"/> + <constant name="InnerDetectorBarrelSupportCylCF_rmin" value="MPGDOuterBarrelModule_rmin - InnerDetectorBarrelSupportCylCF_thickness - 2*mm" /> + </define> <detectors> @@ -364,6 +372,17 @@ <component material="Aluminum" thickness="TrackerSupportCylAlP_thickness2E" name="Services" vis="TrackerServiceVis" /> <component material="CarbonFiber" thickness="TrackerSupportCylCF_thickness2" name="Support" vis="TrackerSupportVis"/> </support> + + <comment> Inner detector support barrel </comment> + <support type="Cylinder" + name="InnerDetectorBarrelSupportCyl" + vis="TrackerSupportVis" + rmin="InnerDetectorBarrelSupportCylCF_rmin" + length="InnerDetectorBarrelSupportCylCF_length" + thickness="InnerDetectorBarrelSupportCylCF_thickness"> + <position x="0*cm" y="0*cm" z="InnerDetectorBarrelSupportCylCF_offset" /> + <component material="CarbonFiber" thickness="InnerDetectorBarrelSupportCylCF_thickness" name="Support" vis="TrackerSupportVis"/> + </support> </detector> </detectors> </lccdd> From 0ec7e68ff0666582e7b44f005641bde29bd3d013 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Tue, 12 Mar 2024 11:30:12 -0500 Subject: [PATCH 036/113] fix: require dd4hep 1.27 because of HexGrid segmentation (#662) ### Briefly, what does this PR introduce? This PR sets the required version of DD4hep to 1.27 since we use HexGrid, added in https://github.com/AIDASoft/DD4hep/commit/03a54fdb313fb507448327269712851bc809b3ca. ### What kind of change does this PR introduce? - [x] Bug fix (issue: https://chat.epic-eic.org/main/pl/jn5eodrdhpg3dxchy5iiritxyo) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No; if you were on an older version of DD4hep, it wasn't compiling anyway. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdc2eaf92..1f6000286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ endif() include(GNUInstallDirs) # Dependencies -find_package(DD4hep 1.21 REQUIRED COMPONENTS DDCore DDRec) +find_package(DD4hep 1.27 REQUIRED COMPONENTS DDCore DDRec) find_package(fmt REQUIRED) #----------------------------------------------------------------------------------- From 2c4e192e2aa712e805d41a94c99a81645d2d0818 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Thu, 14 Mar 2024 06:52:17 -0500 Subject: [PATCH 037/113] fix: InnerMPGDBarrel rmin 51.25 -> 55 cm; zmax 135 -> 143 cm (#663) ### Briefly, what does this PR introduce? This PR updates the InnerMPGDBarrel position in accordance with latest drawings from the project engineers. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: Matthew Posik <posik@temple.edu> --- compact/tracking/definitions_craterlake.xml | 6 +-- compact/tracking/mpgd_barrel.xml | 47 +++++++++------------ 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/compact/tracking/definitions_craterlake.xml b/compact/tracking/definitions_craterlake.xml index 79c3698fc..e0403f9c6 100644 --- a/compact/tracking/definitions_craterlake.xml +++ b/compact/tracking/definitions_craterlake.xml @@ -32,10 +32,10 @@ <constant name="MPGDOuterBarrelModule_zmin2" value="174.5*cm"/> <comment> Inner MPGD unsegmented barrel </comment> - <constant name="InnerMPGDBarrel_rmin" value="51.25*cm"/> + <constant name="InnerMPGDBarrel_rmin" value="55*cm"/> <constant name="InnerMPGDBarrel_dz" value="0"/> <constant name="InnerMPGDBarrel_zmin" value="105*cm"/> <comment> negative z </comment> - <constant name="InnerMPGDBarrel_zmax" value="135*cm"/> <comment> positive z </comment> + <constant name="InnerMPGDBarrel_zmax" value="143*cm"/> <comment> positive z </comment> <constant name="InnerMPGDBarrel_length" value="InnerMPGDBarrel_zmax + InnerMPGDBarrel_zmin"/> <constant name="InnerMPGDBarrel_zoffset" value="0.5*(InnerMPGDBarrel_zmax - InnerMPGDBarrel_zmin)"/> @@ -57,7 +57,7 @@ <comment> Service/Support setup </comment> <constant name="TrackerSupportCyl_rmin1" value="TrackerEndcapDisk_rmax + 0.2*cm"/> - <constant name="TrackerSupportCyl_rmin2" value="InnerMPGDBarrel_rmin + 2*cm"/> + <constant name="TrackerSupportCyl_rmin2" value="InnerMPGDBarrel_rmin - 1.2*cm"/> <comment> These may belong in definitions.xml </comment> <constant name="InnerTrackerEndcapP_zmax" value="CentralTrackingRegionP_zmax"/> <constant name="InnerTrackerEndcapN_zmax" value="CentralTrackingRegionN_zmax"/> diff --git a/compact/tracking/mpgd_barrel.xml b/compact/tracking/mpgd_barrel.xml index cfae91f7d..8a927d7f3 100644 --- a/compact/tracking/mpgd_barrel.xml +++ b/compact/tracking/mpgd_barrel.xml @@ -20,14 +20,9 @@ in the future they could be put together in a single tag. </comment> - <constant name="InnerMPGDBarrelMod_rmin" value="InnerMPGDBarrel_rmin"/> - <constant name="InnerMPGDBarrelMod_dz" value="InnerMPGDBarrel_dz"/> - - <constant name="InnerMPGDBarrelMod_length" value="InnerMPGDBarrel_length" /> - - <constant name="InnerMPGDBarrelLayer_length" value="InnerMPGDBarrelMod_length + 1*um" /> - <constant name="InnerMPGDBarrelLayer_thickness" value="2*cm" /> - <constant name="InnerMPGDBarrelLayer_rmin" value="InnerMPGDBarrelMod_rmin - InnerMPGDBarrelLayer_thickness / 2.0"/> + <constant name="InnerMPGDBarrelLayer_length" value="InnerMPGDBarrel_length" /> + <constant name="InnerMPGDBarrelLayer_thickness" value="5*cm" /> + <constant name="InnerMPGDBarrelLayer_rmin" value="InnerMPGDBarrel_rmin"/> <constant name="InnerMPGDBarrelLayer_rmax" value="InnerMPGDBarrelLayer_rmin + InnerMPGDBarrelLayer_thickness"/> <constant name="MMKaptonOverlay_thickness" value="50*um"/> @@ -53,7 +48,7 @@ FIXME: this shouldn't be needed anymore, need to update the cylindrical plugin. </comment> <constant name="MPGDBarrelStave_count" value="128"/> - <constant name="InnerMPGDBarrelStave_width" value="2*InnerMPGDBarrelLayer_rmin * tan(180*degree/MPGDBarrelStave_count)"/> + <constant name="InnerMPGDBarrelStave_width" value="2*(InnerMPGDBarrelLayer_rmin) * tan(180*degree/MPGDBarrelStave_count)"/> </define> <detectors> @@ -63,26 +58,22 @@ type="epic_TrackerBarrel" readout="MPGDBarrelHits" insideTrackingVolume="true"> - <type_flags type="DetType_TRACKER + DetType_BARREL"/> - <dimensions - rmin="InnerMPGDBarrelLayer_rmin" - rmax="InnerMPGDBarrelLayer_rmax" - length="InnerMPGDBarrelLayer_length"/> + <type_flags type="DetType_TRACKER + DetType_BARREL"/> <module name="InnerMPGDBarrel_Mod1" vis="TrackerMPGDVis"> <comment> Going from the inside (sensitive) side to the readout side </comment> - <module_component name="DriftCuGround" thickness="MMDriftCuGround_thickness" material="Copper" vis="TrackerMPGDVis" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="DriftKapton" thickness="MMDriftKapton_thickness" material="Kapton" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="DriftCuElectrode" thickness="MMDriftCuElectrode_thickness" material="Copper" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="GasGap" thickness="MMGasGap_thickness" material="Ar90IsoButane" sensitive="True" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="Mesh" thickness="MMMesh_thickness" material="MMGAS_InoxForMesh" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="Fudge" thickness="MMFudgeInnerMPGDBarrel_thickness" material="Kapton" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="Gas" thickness="MMGas_thickness" material="Ar90IsoButane" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="ResistiveStrips" thickness="MMResistiveStrip_thickness" material="MMGAS_ResistivePaste" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="KaptonStrips" thickness="MMKaptonStrip_thickness" material="Kapton" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="CuStrips" thickness="MMCuStrip_thickness" material="Copper" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="PCB" thickness="MMPCB_thickness" material="Fr4" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="CuGround" thickness="MMCuGround_thickness" material="Copper" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> - <module_component name="KaptonOverlay" thickness="MMKaptonOverlay_thickness" material="Kapton" vis="TrackerSupportVis" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrelMod_length"/> + <module_component name="DriftCuGround" thickness="MMDriftCuGround_thickness" material="Copper" vis="TrackerMPGDVis" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="DriftKapton" thickness="MMDriftKapton_thickness" material="Kapton" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="DriftCuElectrode" thickness="MMDriftCuElectrode_thickness" material="Copper" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="GasGap" thickness="MMGasGap_thickness" material="Ar90IsoButane" sensitive="True" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="Mesh" thickness="MMMesh_thickness" material="MMGAS_InoxForMesh" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="Fudge" thickness="MMFudgeInnerMPGDBarrel_thickness" material="Kapton" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="Gas" thickness="MMGas_thickness" material="Ar90IsoButane" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="ResistiveStrips" thickness="MMResistiveStrip_thickness" material="MMGAS_ResistivePaste" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="KaptonStrips" thickness="MMKaptonStrip_thickness" material="Kapton" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="CuStrips" thickness="MMCuStrip_thickness" material="Copper" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="PCB" thickness="MMPCB_thickness" material="Fr4" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="CuGround" thickness="MMCuGround_thickness" material="Copper" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> + <module_component name="KaptonOverlay" thickness="MMKaptonOverlay_thickness" material="Kapton" vis="TrackerSupportVis" width="InnerMPGDBarrelStave_width" length="InnerMPGDBarrel_length"/> </module> <layer module="InnerMPGDBarrel_Mod1" id="1" vis="TrackerMMGASLayerVis"> <barrel_envelope @@ -91,7 +82,7 @@ z_length="InnerMPGDBarrelLayer_length" z0="InnerMPGDBarrel_zoffset"/> <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> - <rphi_layout phi_tilt="0" nphi="MPGDBarrelStave_count" phi0="0.0" rc="InnerMPGDBarrelMod_rmin" dr="0.0 * mm"/> + <rphi_layout phi_tilt="0" nphi="MPGDBarrelStave_count" phi0="0.0" rc="(InnerMPGDBarrelLayer_rmin + InnerMPGDBarrelLayer_rmax)/2.0" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/> </layer> </detector> From 91093e7d07776ca44f7abf2c6cb123a56cb385fa Mon Sep 17 00:00:00 2001 From: Maria Zurek <33816222+mariakzurek@users.noreply.github.com> Date: Thu, 14 Mar 2024 10:01:56 -0500 Subject: [PATCH 038/113] Bic geometry update (#654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Briefly, what does this PR introduce? This PR introduces - layers of the glue and lead (implemented as a glue and lead mixture with a effective mix density) at the edges of the SciFi/Pb matrix layers (thickness of 0.61 mm from the end of SciFi/Pb layer) - layers of 1mm Al at both sides of the SciFi/Pb imaging layers (SFILs) and bulk SciFi/Pb - parametrizes the Barrel Ecal envelope (full available space between r_min and solenoid) as `Solenoid_rmin-EcalBarrel_rmin` Before it was hardcoded to an arbitrary 40 cm - Introduces slight changes in the barrel ecal parametrization: before the implementation of layer thicknesses in .xml file were optimized to easily fully fill a particular radial space with SciFi/Pb, that was convenient for testing different geometry options, and thicknesses while developing this detector concept. However, now we have a clear parametrization of the detector with our engineering design, and it's much more intuitive to implement it according to it, with given number of layers with given thicknesses, etc. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [x] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @sly2j ### Does this PR introduce breaking changes? What changes might users need to make to their code? no ### Does this PR change default behavior? yes <img width="844" alt="Screenshot 2024-03-07 at 4 27 27 PM" src="https://github.com/eic/epic/assets/33816222/509458e7-62c6-44a2-963a-e5a5195d3047"> <img width="852" alt="Screenshot 2024-03-07 at 4 27 47 PM" src="https://github.com/eic/epic/assets/33816222/8639fc48-c724-4686-9d6a-e683361675bc"> --------- Co-authored-by: Maria <zurek@anl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sylvester Joosten <sylvester.joosten@gmail.com> --- compact/definitions.xml | 2 +- compact/ecal/barrel_interlayers.xml | 146 +++++++++++++++++----------- compact/materials.xml | 5 + 3 files changed, 97 insertions(+), 56 deletions(-) diff --git a/compact/definitions.xml b/compact/definitions.xml index ae480895e..a02a5a3d0 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -550,8 +550,8 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <constant name="EcalEndcapN_rmin" value="9.*cm"/> <!-- Currently fix value hardcoded --> <constant name="EcalEndcapN_rmax" value="63.*cm"/> <!-- Currently fix value hardcoded --> - <constant name="EcalBarrelRegion_thickness" value="40.*cm"/> <constant name="EcalBarrel_rmin" value="max(81.*cm, CentralTrackingRegion_rmax + BarrelPIDRegion_thickness + BarrelExtraSpace_thickness)"/> <!-- FIXME hardcoded max --> + <constant name="EcalBarrelRegion_thickness" value="Solenoid_rmin-EcalBarrel_rmin"/> <constant name="EcalBarrel_inner_margin" value="2*cm"/> <constant name="EcalBarrel_rmax" value="EcalBarrel_rmin + EcalBarrelRegion_thickness"/> <constant name="EcalBarrelForward_zmax" value="ForwardRICHRegion_zmin"/> <!-- FIXME currently unable to accommodate actual position --> diff --git a/compact/ecal/barrel_interlayers.xml b/compact/ecal/barrel_interlayers.xml index d245976bf..b5277c5c2 100644 --- a/compact/ecal/barrel_interlayers.xml +++ b/compact/ecal/barrel_interlayers.xml @@ -18,7 +18,7 @@ change EcalBarrelImagingLayers_nMax variable </comment> <!-- Number of imaging layer slots --> - <constant name="EcalBarrelImagingLayers_nMax" value="6"/> + <constant name="EcalBarrelImagingLayers_num" value="6"/> <comment> Active part of the calorimeter is 215 cm long in e-going @@ -29,26 +29,26 @@ value="min(260.25*cm, EcalBarrelBackward_zmax)"/> <constant name="EcalBarrel_Calorimeter_zmax" value="min(176.25*cm, EcalBarrelForward_zmax)"/> - <constant name="EcalBarrel_Readout_zmin" value="275.25*cm"/> - <constant name="EcalBarrel_Readout_zmax" value="191.25*cm"/> + <constant name="EcalBarrel_Readout_zmin" value="275.25*cm"/> + <constant name="EcalBarrel_Readout_zmax" value="191.25*cm"/> <constant name="EcalBarrel_Calorimeter_length" value="EcalBarrel_Calorimeter_zmax + EcalBarrel_Calorimeter_zmin"/> <constant name="EcalBarrel_Calorimeter_offset" value="(EcalBarrel_Calorimeter_zmax - EcalBarrel_Calorimeter_zmin)/2.0"/> <constant name="EcalBarrel_FrontSupportThickness" value="0.5*cm"/> - <constant name="EcalBarrel_BackSupportThickness" value="3*cm"/> - <constant name="EcalBarrel_SiliconThickness" value="500*um"/> - <constant name="EcalBarrel_ElectronicsThickness" value="150*um"/> - <constant name="EcalBarrel_CopperThickness" value="100*um"/> - <constant name="EcalBarrel_KaptonThickness" value="200*um"/> - <constant name="EcalBarrel_EpoxyThickness" value="100*um"/> - <constant name="EcalBarrel_CarbonThickness" value="0.5*mm"/> - <constant name="EcalBarrel_CarbonSpacerWidth" value="4*mm"/> - - <constant name="EcalBarrel_AstroPix_width" value="2*cm"/> - <constant name="EcalBarrel_AstroPix_length" value="2*cm"/> - <constant name="EcalBarrel_AstroPix_margin" value="200*um"/> + <constant name="EcalBarrel_BackSupportThickness" value="3*cm"/> + <constant name="EcalBarrel_SiliconThickness" value="500*um"/> + <constant name="EcalBarrel_ElectronicsThickness" value="150*um"/> + <constant name="EcalBarrel_CopperThickness" value="100*um"/> + <constant name="EcalBarrel_KaptonThickness" value="200*um"/> + <constant name="EcalBarrel_EpoxyThickness" value="100*um"/> + <constant name="EcalBarrel_CarbonThickness" value="0.5*mm"/> + <constant name="EcalBarrel_CarbonSpacerWidth" value="4*mm"/> + + <constant name="EcalBarrel_AstroPix_width" value="2*cm"/> + <constant name="EcalBarrel_AstroPix_length" value="2*cm"/> + <constant name="EcalBarrel_AstroPix_margin" value="200*um"/> <constant name="EcalBarrel_AstroPix_thickness" value="EcalBarrel_SiliconThickness + EcalBarrel_ElectronicsThickness @@ -56,39 +56,37 @@ + EcalBarrel_KaptonThickness + EcalBarrel_EpoxyThickness"/> - <constant name="EcalBarrel_Stave_width" value="EcalBarrel_AstroPix_width + 2. * EcalBarrel_AstroPix_margin"/> - <constant name="EcalBarrel_Stave_length" value="EcalBarrel_Calorimeter_length"/> - <constant name="EcalBarrel_Stave_thickness" value="EcalBarrel_AstroPix_thickness + EcalBarrel_CarbonThickness"/> - <constant name="EcalBarrel_StaveTilt_angle" value="10*degree"/> - <constant name="EcalBarrel_Stave_ModuleRepeat" value="floor(EcalBarrel_Calorimeter_length / (EcalBarrel_AstroPix_length + EcalBarrel_AstroPix_margin))"/> - - <constant name="EcalBarrel_LayerSpacing" value="10.0*mm"/> - <constant name="EcalBarrel_FiberRadius" value="0.5*mm"/> - <constant name="EcalBarrel_FiberXSpacing" value="1.34*mm"/> - <constant name="EcalBarrel_FiberZSpacing" value="1.22*mm"/> - <constant name="EcalBarrel_CladdingThickness" value="0.04*mm"/> - <constant name="EcalBarrel_SpaceBetween" value="0.1*mm"/> + <constant name="EcalBarrel_Stave_width" value="EcalBarrel_AstroPix_width + 2. * EcalBarrel_AstroPix_margin"/> + <constant name="EcalBarrel_Stave_length" value="EcalBarrel_Calorimeter_length"/> + <constant name="EcalBarrel_Stave_thickness" value="EcalBarrel_AstroPix_thickness + EcalBarrel_CarbonThickness"/> + <constant name="EcalBarrel_StaveTilt_angle" value="10*degree"/> + <constant name="EcalBarrel_Stave_ModuleRepeat" value="floor(EcalBarrel_Calorimeter_length / (EcalBarrel_AstroPix_length + EcalBarrel_AstroPix_margin))"/> + + <constant name="EcalBarrel_FiberRadius" value="0.5*mm"/> + <constant name="EcalBarrel_FiberXSpacing" value="1.34*mm"/> + <constant name="EcalBarrel_FiberZSpacing" value="1.22*mm"/> + <constant name="EcalBarrel_CladdingThickness" value="0.04*mm"/> + <constant name="EcalBarrel_SpaceBetween" value="0.01*mm"/> <comment> For Pb/SiFi (GlueX): X0 ~ 1.45 cm For W/SiFi (sPHENIX): X0 ~ 0.7 cm (but different fiber orientation) </comment> - <constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing * 17"/> - <constant name="EcalBarrel_TotalFiberLayers_num" value="12"/> - <constant name="EcalBarrel_SectorRepeat" value="EcalBarrelSectorsN"/> - <constant name="EcalBarrel_AvailThickness" value="EcalBarrelRegion_thickness - EcalBarrel_BackSupportThickness - EcalBarrel_FrontSupportThickness"/> + <constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing * 17"/> + <constant name="EcalBarrel_TotalFiberLayers_num" value="12"/> + <constant name="EcalBarrel_RadiatorEdgeThickness" value="0.61*mm"/> + <constant name="EcalBarrel_AluminumPlateThickness" value="1*mm"/> + <constant name="EcalBarrel_SectorRepeat" value="EcalBarrelSectorsN"/> + <constant name="EcalBarrel_AvailThickness" value="EcalBarrelRegion_thickness - EcalBarrel_BackSupportThickness - EcalBarrel_FrontSupportThickness"/> - <constant name="EcalBarrel_ImagingLayerThickness" value="1.5*cm"/> + <constant name="EcalBarrel_ImagingLayerThickness" value="1.5*cm"/> <constant name="EcalBarrel_ImagingLayerThickness_WithoutFrame" value="EcalBarrel_ImagingLayerThickness - 2*EcalBarrel_CarbonThickness"/> - <constant name="EcalBarrel_ScFiLayerThickness" - value="EcalBarrel_RadiatorThickness"/> + <constant name="EcalBarrel_ScFiLayerThickness_Imaging" + value="EcalBarrel_RadiatorThickness + 2*EcalBarrel_RadiatorEdgeThickness + 2*EcalBarrel_AluminumPlateThickness"/> - <constant name="EcalBarrelImagingLayers_num" - value="min(EcalBarrelImagingLayers_nMax, - floor(EcalBarrel_AvailThickness/(EcalBarrel_ImagingLayerThickness + EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween)))"/> <comment> Adjusting size of the ScFi back chunk to match number of imaging layers and ~17.1 radiation lengths in total @@ -96,14 +94,14 @@ <constant name="EcalBarrel_FiberBulkLayers_num" value = "EcalBarrel_TotalFiberLayers_num-EcalBarrelImagingLayers_num+1"/> <constant name="EcalBarrel_ImagingPartThickness" - value="EcalBarrelImagingLayers_num*(EcalBarrel_ImagingLayerThickness + EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween)-EcalBarrel_ScFiLayerThickness"/> - <constant name="EcalBarrel_ScFiPartThickness_max" - value="max(0, EcalBarrel_AvailThickness-EcalBarrel_ImagingPartThickness)"/> + value="EcalBarrelImagingLayers_num * (EcalBarrel_ImagingLayerThickness + EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween) + - EcalBarrel_ScFiLayerThickness_Imaging"/> <constant name="EcalBarrel_ScFiPartThickness" - value="min(EcalBarrel_ScFiPartThickness_max, - EcalBarrel_RadiatorThickness*EcalBarrel_FiberBulkLayers_num)"/> - <constant name="EcalBarrel_SensitiveLayers_rmax" - value="EcalBarrel_rmin + EcalBarrel_ImagingPartThickness + EcalBarrel_ScFiPartThickness"/> + value="EcalBarrel_RadiatorThickness*EcalBarrel_FiberBulkLayers_num"/> + <constant name="EcalBarrelDetector_rmax" + value="EcalBarrel_rmin + EcalBarrel_FrontSupportThickness + + EcalBarrel_ImagingPartThickness + EcalBarrel_ScFiPartThickness + EcalBarrel_BackSupportThickness"/> + </define> <limits> @@ -178,14 +176,14 @@ <layer repeat="1" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" - space_before="EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween"> + space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> </layer> <layer repeat="2" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" - space_between="EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween" - space_before="EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween"> + space_between="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween" + space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> <stave repeat="6" width="EcalBarrel_Stave_width" @@ -203,14 +201,14 @@ <layer repeat="1" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" - space_before="EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween"> + space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> </layer> <layer repeat="EcalBarrelImagingLayers_num-5" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" - space_between="EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween" - space_before="EcalBarrel_ScFiLayerThickness + EcalBarrel_SpaceBetween"> + space_between="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween" + space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> <stave repeat="7" width="EcalBarrel_Stave_width" @@ -244,9 +242,12 @@ rmin="EcalBarrel_rmin" z="EcalBarrel_Calorimeter_length"/> <sectors vis="EcalBarrelSectorVis"/> + <layer repeat="EcalBarrelImagingLayers_num-1" vis="EcalBarrelLayerVis" - space_between="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween" - space_before="EcalBarrel_FrontSupportThickness + EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween/2."> + space_between="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween" + space_before="EcalBarrel_FrontSupportThickness + EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween/2."> + <slice material="Aluminum" thickness="EcalBarrel_AluminumPlateThickness" vis="EcalBarrelSliceVis"/> + <slice material="SciFiPb_PbGlue_Edge" thickness="EcalBarrel_RadiatorEdgeThickness" vis="EcalBarrelSliceVis"/> <slice material="SciFiPb_PbGlue" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis"> <fiber material="SciFiPb_Scintillator" sensitive="yes" @@ -259,12 +260,31 @@ vis="EcalBarrelFiberLayerVis"> </fiber> </slice> + <slice material="SciFiPb_PbGlue_Edge" thickness="EcalBarrel_RadiatorEdgeThickness" vis="EcalBarrelSliceVis"/> + <slice material="Aluminum" thickness="EcalBarrel_AluminumPlateThickness" vis="EcalBarrelSliceVis"/> </layer> - <layer repeat="EcalBarrel_FiberBulkLayers_num" vis="EcalBarrelLayerVis" - space_before="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween"> + <layer repeat="1" vis="EcalBarrelLayerVis" + space_before="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween"> + <slice material="Aluminum" thickness="EcalBarrel_AluminumPlateThickness" vis="EcalBarrelSliceVis"/> + <slice material="SciFiPb_PbGlue_Edge" thickness="EcalBarrel_RadiatorEdgeThickness" vis="EcalBarrelSliceVis"/> + <slice material="SciFiPb_PbGlue" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis"> + <fiber material="SciFiPb_Scintillator" + sensitive="yes" + grid_n_phi="5" + grid_dr="2*cm" + radius="EcalBarrel_FiberRadius" + cladding_thickness="EcalBarrel_CladdingThickness" + spacing_x="EcalBarrel_FiberXSpacing" + spacing_z="EcalBarrel_FiberZSpacing" + vis="EcalBarrelFiberLayerVis"> + </fiber> + </slice> + </layer> + + <layer repeat="EcalBarrel_FiberBulkLayers_num-2" vis="EcalBarelLayerVis"> <slice material="SciFiPb_PbGlue" - thickness="EcalBarrel_ScFiPartThickness/EcalBarrel_FiberBulkLayers_num" + thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis"> <fiber material="SciFiPb_Scintillator" sensitive="yes" @@ -279,6 +299,22 @@ </slice> </layer> + <layer repeat="1" vis="EcalBarrelLayerVis"> + <slice material="SciFiPb_PbGlue" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis"> + <fiber material="SciFiPb_Scintillator" + sensitive="yes" + grid_n_phi="5" + grid_dr="2*cm" + radius="EcalBarrel_FiberRadius" + cladding_thickness="EcalBarrel_CladdingThickness" + spacing_x="EcalBarrel_FiberXSpacing" + spacing_z="EcalBarrel_FiberZSpacing" + vis="EcalBarrelFiberLayerVis"> + </fiber> + </slice> + <slice material="SciFiPb_PbGlue_Edge" thickness="EcalBarrel_RadiatorEdgeThickness" vis="EcalBarrelSliceVis"/> + </layer> + <support thickness="EcalBarrel_BackSupportThickness" material="Aluminum" vis="EcalBarrelSupportVis"/> </detector> </detectors> diff --git a/compact/materials.xml b/compact/materials.xml index e8e04d034..4b54e47df 100644 --- a/compact/materials.xml +++ b/compact/materials.xml @@ -485,6 +485,11 @@ <fraction n="0.9622" ref="Pb"/> <fraction n="0.0378" ref="SciFiPb_Glue"/> </material> + <material name="SciFiPb_PbGlue_Edge"> + <D type="density" value="4.231" unit="g / cm3"/> + <fraction n="0.805" ref="Pb"/> + <fraction n="0.195" ref="SciFiPb_Glue"/> + </material> <material name="Brass"> <D type="density" value="8.41" unit="g / cm3"/> <fraction n="0.70" ref="Cu"/> From ecfeedf6f11aeb6570946b4ec9c9628781421456 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Fri, 15 Mar 2024 15:27:50 -0500 Subject: [PATCH 039/113] fix: rename detector to HcalFarForwardZDC_SiPMonTile (#666) ### Briefly, what does this PR introduce? This PR renames the HcalFarForwardZDC_SiPMonTile detector from a previous name with spaces and dashes. ### What kind of change does this PR introduce? - [x] Bug fix (issue: non-compliant name) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [x] Tests for the changes have been added: a workflow test is coming in a different context that doesn't like this name - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. This name is not used for output collection names etc. --- compact/far_forward/ZDC_SiPMonTile.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact/far_forward/ZDC_SiPMonTile.xml b/compact/far_forward/ZDC_SiPMonTile.xml index 2f58cdcd5..974fb3536 100644 --- a/compact/far_forward/ZDC_SiPMonTile.xml +++ b/compact/far_forward/ZDC_SiPMonTile.xml @@ -72,7 +72,7 @@ </documentation> <detector id="HcalFarForwardZDC_SiPMonTile_ID" - name="ZDC SiPM-on-Tile Hcal" + name="HcalFarForwardZDC_SiPMonTile" type="ZeroDegreeCalorimeterSiPMonTile" readout="HcalFarForwardZDCHits" vis="InvisibleWithDaughters" From f09b63754a9ec8546a2dcda73de8b9132f59bf61 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sun, 17 Mar 2024 16:16:48 -0500 Subject: [PATCH 040/113] fix: tell dd4hep_configure_output which install prefix to use (#669) ### Briefly, what does this PR introduce? This PR prevents [dd4hep_configure_output](https://github.com/AIDASoft/DD4hep/blob/e52af7f770ec3e51460d832428f2cca214678e2a/cmake/DD4hepBuild.cmake#L328-L331) from overriding the `CMAKE_INSTALL_PREFIX` that we just set in case the user doesn't define it. ### What kind of change does this PR introduce? - [x] Bug fix (issue: setup.sh has path that does not match with actual install location) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes. The default install prefix (if not specified) will change from `${CMAKE_SOURCE_DIR}` to `${CMAKE_SOURCE_DIR}/prefix`. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6000286..913dfa13f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ find_package(fmt REQUIRED) #----------------------------------------------------------------------------------- set(a_lib_name ${PROJECT_NAME}) -dd4hep_configure_output() +dd4hep_configure_output(INSTALL ${CMAKE_INSTALL_PREFIX}) dd4hep_set_compiler_flags() file(GLOB sources CONFIGURE_DEPENDS src/*.cpp) From a88e26ed902cbba9e4802de81f80fcc06076b974 Mon Sep 17 00:00:00 2001 From: Nilanga Wickramaarachchi <wnilanga@yahoo.com> Date: Sun, 17 Mar 2024 17:59:19 -0400 Subject: [PATCH 041/113] correct the absorption length values for EpotekOptical (#670) ### Briefly, what does this PR introduce? The absorption length values currently used for "EpotekOptical" material in hpDIRC seem to be as same as those for "QuartzOptical". This PR corrects the values for "EpotekOptical". ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? ### Does this PR change default behavior? --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/optical_materials.xml | 72 +++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/compact/optical_materials.xml b/compact/optical_materials.xml index 388e2e694..d21039fad 100644 --- a/compact/optical_materials.xml +++ b/compact/optical_materials.xml @@ -149,42 +149,42 @@ 4.13281*eV 1.64807 "/> <matrix name="ABSLENGTH__DIRCEpotek" coldim="2" values=" - 1.90745*eV 2.33615e+06*mm - 1.93725*eV 2.19567e+06*mm - 1.968*eV 2.06162e+06*mm - 1.99974*eV 1.93381e+06*mm - 2.03253*eV 1.81203e+06*mm - 2.0664*eV 1.6961e+06*mm - 2.10143*eV 1.58582e+06*mm - 2.13766*eV 1.48101e+06*mm - 2.17516*eV 1.38148e+06*mm - 2.214*eV 1.28706e+06*mm - 2.25426*eV 1.19756e+06*mm - 2.296*eV 1.11281e+06*mm - 2.33932*eV 1.03264e+06*mm - 2.38431*eV 956885*mm - 2.43106*eV 885374*mm - 2.47968*eV 817949*mm - 2.53029*eV 754450*mm - 2.583*eV 694722*mm - 2.63796*eV 638613*mm - 2.69531*eV 585973*mm - 2.7552*eV 536656*mm - 2.81782*eV 490520*mm - 2.88335*eV 447425*mm - 2.952*eV 407233*mm - 3.024*eV 369813*mm - 3.0996*eV 335032*mm - 3.17908*eV 302764*mm - 3.26274*eV 272886*mm - 3.35092*eV 245275*mm - 3.44401*eV 219814*mm - 3.54241*eV 196390*mm - 3.64659*eV 174889*mm - 3.7571*eV 155204*mm - 3.87451*eV 137229*mm - 3.99949*eV 120863*mm - 4.13281*eV 106006*mm + 1.90745*eV 2.54e+06*mm + 1.93725*eV 2.54e+06*mm + 1.968*eV 2.54e+06*mm + 1.99974*eV 2.54e+06*mm + 2.03253*eV 2.54e+06*mm + 2.0664*eV 2.54e+06*mm + 2.10143*eV 2.54e+06*mm + 2.13766*eV 2.54e+06*mm + 2.17516*eV 2.54e+06*mm + 2.214*eV 2.54e+06*mm + 2.25426*eV 2.54e+06*mm + 2.296*eV 2.54e+06*mm + 2.33932*eV 2.54e+06*mm + 2.38431*eV 2.54e+06*mm + 2.43106*eV 2.54e+06*mm + 2.47968*eV 2.54e+06*mm + 2.53029*eV 2.54e+06*mm + 2.583*eV 2.54e+06*mm + 2.63796*eV 2.54e+06*mm + 2.69531*eV 2.54e+06*mm + 2.7552*eV 2.54e+06*mm + 2.81782*eV 2.54e+06*mm + 2.88335*eV 2.54e+06*mm + 2.952*eV 2.54e+06*mm + 3.024*eV 2.54e+06*mm + 3.0996*eV 253.987*mm + 3.17908*eV 126.987*mm + 3.26274*eV 50.7873*mm + 3.35092*eV 25.3873*mm + 3.44401*eV 12.6873*mm + 3.54241*eV 8.45396*mm + 3.64659*eV 6.33729*mm + 3.7571*eV 5.63173*mm + 3.87451*eV 3.61586*mm + 3.99949*eV 1.95626*mm + 4.13281*eV 0.983324*mm "/> <matrix name="RINDEX__DIRCNlak33a" coldim="2" values=" From 1477f391c7b6f5d9b97d771d76328d08323a12c4 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Mon, 18 Mar 2024 16:07:54 -0500 Subject: [PATCH 042/113] fix: remove fieldmap type backward compatibility < dd4hep 1.26 (#671) ### Briefly, what does this PR introduce? This PR removes the forward/backward compatibliity that we introduced for the transition from DD4hep 1.25 to 1.26. Since we now require DD4hep 1.27 for other reasons (HexGrid segmentation), we don't have any backward compatibility anymore. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [x] Other: technical debt payment on principal ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- src/FieldMapB.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/FieldMapB.cpp b/src/FieldMapB.cpp index 625cd6fa4..377b0fe7a 100644 --- a/src/FieldMapB.cpp +++ b/src/FieldMapB.cpp @@ -31,25 +31,6 @@ using namespace dd4hep; // <Y step="" min="" max=""/> // <Z step="" min="" max=""/> -// In DD4hep 1.26, the name for the `field_type` enum changed (from `type`). -#if DD4HEP_VERSION_GE(1, 26) -#define DD4HEP_FIELD_TYPE field_type -#else -#define DD4HEP_FIELD_TYPE type -#endif - -// This allows us to specify the name of the variable by hand, when patching -// the previous versions, by setting `DD4HEP_FIELD_TYPE_OVERRIDE`. -// TODO remove after DD4hep 1.26 release -#define XSTR(x) STR(x) -#define STR(x) #x -#ifdef DD4HEP_FIELD_TYPE_OVERRIDE -#undef DD4HEP_FIELD_TYPE -#define DD4HEP_FIELD_TYPE DD4HEP_FIELD_TYPE_OVERRIDE -#pragma message("DD4HEP_FIELD_TYPE overridden as " XSTR(DD4HEP_FIELD_TYPE)) -#endif -#pragma message("DD4HEP_FIELD_TYPE is " XSTR(DD4HEP_FIELD_TYPE)) - // implementation of the field map class FieldMapB : public dd4hep::CartesianField::Object { @@ -100,11 +81,11 @@ FieldMapB::FieldMapB(const std::string& field_type_str, const std::string& coord // set type if (ftype == "magnetic") { - DD4HEP_FIELD_TYPE = CartesianField::MAGNETIC; + field_type = CartesianField::MAGNETIC; } else if (ftype == "electric") { - DD4HEP_FIELD_TYPE = CartesianField::ELECTRIC; + field_type = CartesianField::ELECTRIC; } else { - DD4HEP_FIELD_TYPE = CartesianField::UNKNOWN; + field_type = CartesianField::UNKNOWN; printout(ERROR, "FieldMap","Unknown field type " + ftype); } From 38ec9bb84ec72cd10915ca58f60136d9adbe93fe Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Tue, 19 Mar 2024 09:04:32 -0500 Subject: [PATCH 043/113] fix: mv evaluated templates during build into CMAKE_CURRENT_BINARY_DIR (#672) ### Briefly, what does this PR introduce? The build system writes the evaluated jinja templates (entrypoint xml files) into the source directory instead of a build directory. This PR moves these temporary build artifacts into the build directory instead. TODO: - [x] fix common_bench to do a proper install into a prefix instead of a build into the source directory ### What kind of change does this PR introduce? - [x] Bug fix (issue #54) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, no more xml files will be written to the source directory; `make install` or bust. --- CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 913dfa13f..346981db7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,9 +60,6 @@ target_link_libraries(${a_lib_name} #----------------------------------------------------------------------------------- # Parse jinja templates: once by default, and once for all yml files -# -# FIXME: should not write rendered templates to ${CMAKE_CURRENT_SOURCE_DIR} - set(TEMPLATE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/templates) set(TEMPLATE_XML ${PROJECT_NAME}.xml.jinja2) @@ -76,15 +73,15 @@ foreach(config_yml ${CONFIG_YMLS}) --dir ${TEMPLATE_DIR} --template ${TEMPLATE_XML} --config ${config_yml} - --output ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}_${config}.xml + --output ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_${config}.xml COMMENT "Creating configuration ${config} for ${PROJECT_NAME}" ) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}_${config}.xml + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_${config}.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/ ) endforeach() -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}_full.xml +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_full.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/ RENAME ${PROJECT_NAME}.xml ) From 6d7e7bf92597af0ba6a05d0b516160e63d599766 Mon Sep 17 00:00:00 2001 From: Michael Pitt <m_u_pitt@yahoo.com> Date: Wed, 20 Mar 2024 22:40:23 +0200 Subject: [PATCH 044/113] Update B0 ECAL geometry (#658) ### Briefly, what does this PR introduce? Following the discussion at the Far-Fowrard working group meeting, the B0 Crystal length is now set to 20cm instead of 10cm. The Crystal material was changed from PbOW4 to LYSO. More information is available here: https://indico.bnl.gov/event/21778/#20-updated-studies-on-b0-emcal For now, the default choice is LYSO, while the final choice will be made in spring 2024 ([TIC meeting 3 Apr](https://indico.bnl.gov/event/22321/#11-planning-for-tdr-effort-ff)) ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [x] Other: Update geometry ### Please check if this PR fulfills the following: - [X] Tests for the changes have been added - [ ] Documentation has been added / updated - [X] Changes have been communicated to collaborators (https://indico.bnl.gov/event/21709/) ### Does this PR introduce breaking changes? What changes might users need to make to their code? The energy containment of the B0 Crystal detector will be improved from 60% -> 90% ### Does this PR change default behavior? no The overlap of the crystals with the magnet bore were checked.  --- compact/far_forward/B0_ECal.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compact/far_forward/B0_ECal.xml b/compact/far_forward/B0_ECal.xml index 13deb66b8..e7cbd128a 100644 --- a/compact/far_forward/B0_ECal.xml +++ b/compact/far_forward/B0_ECal.xml @@ -4,10 +4,10 @@ <lccdd> <define> <constant name="B0ECal_rotation" value="ionCrossingAngle"/> - <constant name="B0ECal_IP_distance" value="683*cm"/> + <constant name="B0ECal_IP_distance" value="688*cm"/> <constant name="B0ECal_xcenter" value="B0ECal_IP_distance*sin(ionCrossingAngle)"/> <constant name="B0ECal_zcenter" value="B0ECal_IP_distance*cos(ionCrossingAngle)"/> - <constant name="B0ECal_length" value="10*cm"/> + <constant name="B0ECal_length" value="20*cm"/> <constant name="B0ECal_CrystalModule_width" value="2*cm"/> <constant name="B0ECal_CrystalModule_length" value="B0ECal_length"/> <constant name="B0ECal_CrystalModule_wrap" value="0.50*mm"/> @@ -49,7 +49,7 @@ sizey="B0ECal_CrystalModule_width" sizez="B0ECal_CrystalModule_length" vis="GreenVis" - material="PbWO4"/> + material="LYSO"/> <wrapper thickness="B0ECal_CrystalModule_wrap" material="Epoxy" From 931c6e2c94ce813bdbf27e45d259199e234db570 Mon Sep 17 00:00:00 2001 From: ShujieL <ShujieL@users.noreply.github.com> Date: Thu, 21 Mar 2024 06:27:41 -0700 Subject: [PATCH 045/113] add default material map binning for approach 2 (#660) ### Briefly, what does this PR introduce? add default material map binning for approach 2 in tracking detectors ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [x ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? N/A ### Does this PR change default behavior? N/A --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/far_forward/B0_tracker.xml | 12 ++++++++---- compact/tracking/mpgd_barrel.xml | 1 + compact/tracking/mpgd_innerbarrel.xml | 3 +++ compact/tracking/mpgd_outerbarrel.xml | 3 ++- compact/tracking/silicon_barrel.xml | 2 ++ compact/tracking/silicon_disks.xml | 4 ++-- compact/tracking/tof_barrel.xml | 3 ++- compact/tracking/tof_endcap.xml | 2 +- compact/tracking/vertex_barrel.xml | 25 +++++++++++++++---------- 9 files changed, 36 insertions(+), 19 deletions(-) diff --git a/compact/far_forward/B0_tracker.xml b/compact/far_forward/B0_tracker.xml index eec07e726..88ec565e7 100644 --- a/compact/far_forward/B0_tracker.xml +++ b/compact/far_forward/B0_tracker.xml @@ -120,7 +120,8 @@ <ring phi0="-B0TrackerLayerSmallMod_phi0" dphi="B0TrackerModOpeningAngle" r="B0TrackerMod1Inner_r+B0TrackerMod1Small_y/2.0" zstart="0.0*mm" nmodules="B0TrackerLayerSmallMod_nModules" dz="0 * mm" module="SmallModule1" /> - <layer_material surface="inner" binning="binPhi,binR" bins0="20*(B0TrackerLayerSmallMod_nModules)" bins1="256"/> + <layer_material surface="inner" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> + <layer_material surface="outer" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> </layer> <layer id="2" > <envelope vis="FFTrackerLayerVis" rmin_tolerance="0*mm" rmax_tolerance="0*mm" @@ -132,7 +133,8 @@ <ring phi0="-B0TrackerLayerSmallMod_phi0" dphi="B0TrackerModOpeningAngle" r="B0TrackerMod1Inner_r+B0TrackerMod2Small_y/2.0" zstart="0.0*mm" nmodules="B0TrackerLayerSmallMod_nModules" dz="0 * mm" module="SmallModule2" /> - <layer_material surface="inner" binning="binPhi,binR" bins0="20*(B0TrackerLayerSmallMod_nModules)" bins1="256"/> + <layer_material surface="inner" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> + <layer_material surface="outer" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> </layer> <layer id="3" > <envelope vis="FFTrackerLayerVis" rmin_tolerance="0*mm" rmax_tolerance="0*mm" @@ -144,7 +146,8 @@ <ring phi0="-B0TrackerLayerSmallMod_phi0" dphi="B0TrackerModOpeningAngle" r="B0TrackerMod1Inner_r+B0TrackerMod3Small_y/2.0" zstart="0.0*mm" nmodules="B0TrackerLayerSmallMod_nModules" dz="0 * mm" module="SmallModule3" /> - <layer_material surface="inner" binning="binPhi,binR" bins0="20*(B0TrackerLayerSmallMod_nModules)" bins1="256"/> + <layer_material surface="inner" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> + <layer_material surface="outer" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> </layer> <layer id="4" > <envelope vis="FFTrackerLayerVis" rmin_tolerance="0*mm" rmax_tolerance="0*mm" @@ -156,7 +159,8 @@ <ring phi0="-B0TrackerLayerSmallMod_phi0" dphi="B0TrackerModOpeningAngle" r="B0TrackerMod1Inner_r+B0TrackerMod4Small_y/2.0" zstart="0.0*mm" nmodules="B0TrackerLayerSmallMod_nModules" dz="0 * mm" module="SmallModule4" /> - <layer_material surface="inner" binning="binPhi,binR" bins0="20*(B0TrackerLayerSmallMod_nModules)" bins1="256"/> + <layer_material surface="inner" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> + <layer_material surface="outer" binning="binPhi,binR" bins0="2*(B0TrackerLayerSmallMod_nModules)" bins1="12"/> </layer> </detector> diff --git a/compact/tracking/mpgd_barrel.xml b/compact/tracking/mpgd_barrel.xml index 8a927d7f3..8f163b37d 100644 --- a/compact/tracking/mpgd_barrel.xml +++ b/compact/tracking/mpgd_barrel.xml @@ -82,6 +82,7 @@ z_length="InnerMPGDBarrelLayer_length" z0="InnerMPGDBarrel_zoffset"/> <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> <rphi_layout phi_tilt="0" nphi="MPGDBarrelStave_count" phi0="0.0" rc="(InnerMPGDBarrelLayer_rmin + InnerMPGDBarrelLayer_rmax)/2.0" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/> </layer> diff --git a/compact/tracking/mpgd_innerbarrel.xml b/compact/tracking/mpgd_innerbarrel.xml index 9932996a5..24c081e0f 100644 --- a/compact/tracking/mpgd_innerbarrel.xml +++ b/compact/tracking/mpgd_innerbarrel.xml @@ -120,6 +120,7 @@ z_length="InnerMPGDBarrelLayer1_length" z0="0" /> <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> <rphi_layout phi_tilt="0" nphi="MPGDBarrelStave_count" phi0="0.0" rc="InnerMPGDBarrelMod1_rmin" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0" nz="1"/> </layer> @@ -146,6 +147,7 @@ z_length="InnerMPGDBarrelLayer2_length" z0="-InnerMPGDBarrelMod2_zpos"/> <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> <rphi_layout phi_tilt="0" nphi="MPGDBarrelStave_count" phi0="0.0" rc="InnerMPGDBarrelMod2_rmin" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0" nz="1"/> </layer> @@ -172,6 +174,7 @@ z_length="InnerMPGDBarrelLayer3_length" z0="InnerMPGDBarrelMod3_zpos"/> <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="MPGDBarrelStave_count" bins1="100" /> <rphi_layout phi_tilt="0" nphi="MPGDBarrelStave_count" phi0="0.0" rc="InnerMPGDBarrelMod3_rmin" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0" nz="1"/> </layer> diff --git a/compact/tracking/mpgd_outerbarrel.xml b/compact/tracking/mpgd_outerbarrel.xml index fbbb8fca3..c4e69c044 100644 --- a/compact/tracking/mpgd_outerbarrel.xml +++ b/compact/tracking/mpgd_outerbarrel.xml @@ -150,7 +150,8 @@ <comment> Layout for MPGD DIRC layers </comment> <layer module="MPGDOuterBarrelModule" id="0" vis="TrackerSupportVis"> <envelope_tolerance r_min="-50*mm" r_max="0*mm" z_min="0*mm" z_max="0*mm"/> - <layer_material surface="outer" binning="binPhi,binZ" bins0="MPGDOuterBarrelModule_count" bins1="100" /> + <layer_material surface="inner" binning="binPhi,binZ" bins0="MPGDOuterBarrelModule_count*10" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="MPGDOuterBarrelModule_count*10" bins1="100" /> <rphi_layout phi_tilt="0" nphi="MPGDOuterBarrelModule_count" diff --git a/compact/tracking/silicon_barrel.xml b/compact/tracking/silicon_barrel.xml index 0a73f19a4..4fbce770b 100644 --- a/compact/tracking/silicon_barrel.xml +++ b/compact/tracking/silicon_barrel.xml @@ -91,6 +91,7 @@ outer_r="SiBarrelLayer1_rmax" z_length="SiBarrelLayer1_length" /> <layer_material surface="inner" binning="binPhi,binZ" bins0="SiBarrelStave1_count" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="SiBarrelStave1_count" bins1="100" /> <comment> phi0 : Starting phi of first module. phi_tilt : Phi tilt of a module. @@ -149,6 +150,7 @@ outer_r="SiBarrelLayer2_rmax" z_length="SiBarrelLayer2_length" /> <layer_material surface="inner" binning="binPhi,binZ" bins0="128" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="128" bins1="100" /> <comment> phi0 : Starting phi of first module. phi_tilt : Phi tilt of a module. diff --git a/compact/tracking/silicon_disks.xml b/compact/tracking/silicon_disks.xml index db4c290f0..36f5b9e3e 100644 --- a/compact/tracking/silicon_disks.xml +++ b/compact/tracking/silicon_disks.xml @@ -222,7 +222,7 @@ length="SiTrackerEndcapLayer_thickness" zstart="TrackerEndcapPLayer1_zmin" /> <layer_material surface="inner" binning="binPhi,binR" bins0="5*SiTrackerEndcapMod_count" bins1="100"/> - <layer_material surface="inner" binning="binPhi,binR" bins0="5*SiTrackerEndcapMod_count" bins1="100"/> + <layer_material surface="outer" binning="binPhi,binR" bins0="5*SiTrackerEndcapMod_count" bins1="100"/> <ring r="TrackerEndcapPMod1_rmin + TrackerEndcapPMod1_y/2" zstart="0" @@ -252,7 +252,7 @@ length="SiTrackerEndcapLayer_thickness" zstart="TrackerEndcapNLayer1_zmin" /> <layer_material surface="inner" binning="binPhi,binR" bins0="5*SiTrackerEndcapMod_count" bins1="100"/> - <layer_material surface="inner" binning="binPhi,binR" bins0="5*SiTrackerEndcapMod_count" bins1="100"/> + <layer_material surface="outer" binning="binPhi,binR" bins0="5*SiTrackerEndcapMod_count" bins1="100"/> <ring r="TrackerEndcapNMod1_rmin + TrackerEndcapNMod1_y/2" zstart="0" diff --git a/compact/tracking/tof_barrel.xml b/compact/tracking/tof_barrel.xml index 9ae13171b..d916f0265 100644 --- a/compact/tracking/tof_barrel.xml +++ b/compact/tracking/tof_barrel.xml @@ -123,7 +123,8 @@ outer_r="BarrelTOF_rmax" z_length="BarrelTOF_length+2*BarrelTOF_zOffset" z0="BarrelTOF_zoffset"/> - + <layer_material surface="inner" binning="binPhi,binZ" bins0="BarrelTOF_Module_nphi" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="BarrelTOF_Module_nphi" bins1="100" /> <rphi_layout phi_tilt="BarrelTOF_Module_tiltangle" nphi="BarrelTOF_Module_nphi" phi0="0.0" rc="BarrelTOF_radius" dr="0.0*mm"/> <z_layout dr="0.0*mm" z0="BarrelTOF_zOffset" nz="BarrelTOF_Module_nz"/> </layer> diff --git a/compact/tracking/tof_endcap.xml b/compact/tracking/tof_endcap.xml index 8bb2a63fd..e0c78530b 100644 --- a/compact/tracking/tof_endcap.xml +++ b/compact/tracking/tof_endcap.xml @@ -252,7 +252,7 @@ length="3*cm" zstart="ForwardTOF_zmin" /> <layer_material surface="inner" binning="binPhi,binR" bins0="30" bins1="30"/> - <layer_material surface="inner" binning="binPhi,binR" bins0="30" bins1="30"/> + <layer_material surface="outer" binning="binPhi,binR" bins0="30" bins1="30"/> <y_layout dr="0.0*mm" z0="EndcapTOF_zOffset" nz="EndcapTOF_Module_nz"/> <z_layout z0="ForwardTOF_zmin"/> </layer> diff --git a/compact/tracking/vertex_barrel.xml b/compact/tracking/vertex_barrel.xml index e299c4c23..f2fc4ad20 100644 --- a/compact/tracking/vertex_barrel.xml +++ b/compact/tracking/vertex_barrel.xml @@ -46,10 +46,12 @@ due to ACTS limitations. FIXME: this shouldn't be needed anymore, need to update the cylindrical plugin. </comment> - <constant name="VertexBarrelStave_count" value="128"/> - <constant name="VertexBarrelStave1_width" value="2*VertexBarrelMod1_rmin * tan(180*degree/VertexBarrelStave_count)"/> - <constant name="VertexBarrelStave2_width" value="2*VertexBarrelMod2_rmin * tan(180*degree/VertexBarrelStave_count)"/> - <constant name="VertexBarrelStave3_width" value="2*VertexBarrelMod3_rmin * tan(180*degree/VertexBarrelStave_count)"/> + <constant name="VertexBarrelStave_count1" value="128"/> + <constant name="VertexBarrelStave_count2" value="128"/> + <constant name="VertexBarrelStave_count3" value="128"/> + <constant name="VertexBarrelStave1_width" value="2*VertexBarrelMod1_rmin * tan(180*degree/VertexBarrelStave_count1)"/> + <constant name="VertexBarrelStave2_width" value="2*VertexBarrelMod2_rmin * tan(180*degree/VertexBarrelStave_count2)"/> + <constant name="VertexBarrelStave3_width" value="2*VertexBarrelMod3_rmin * tan(180*degree/VertexBarrelStave_count3)"/> </define> <detectors> @@ -101,7 +103,8 @@ inner_r="VertexBarrelLayer1_rmin" outer_r="VertexBarrelLayer1_rmax" z_length="VertexBarrelLayer_length" /> - <layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" /> + <layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelStave_count1" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count1" bins1="100" /> <comment> phi0 : Starting phi of first module. phi_tilt : Phi tilt of a module. @@ -112,7 +115,7 @@ nz : Number of modules to place in z. dr : Radial displacement parameter, of every other module. </comment> - <rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod1_rmin" dr="0.0 * mm"/> + <rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count1" phi0="0.0" rc="VertexBarrelMod1_rmin" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/> </layer> <layer module="Module2" id="2" vis="VertexLayerVis"> @@ -120,8 +123,9 @@ inner_r="VertexBarrelLayer2_rmin" outer_r="VertexBarrelLayer2_rmax" z_length="VertexBarrelLayer_length" /> - <layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" /> - <rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod2_rmin" dr="0.0 * mm"/> + <layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelStave_count2" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count2" bins1="100" /> + <rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count2" phi0="0.0*degree" rc="VertexBarrelMod2_rmin" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/> </layer> <layer module="Module3" id="4" vis="VertexLayerVis"> @@ -129,8 +133,9 @@ inner_r="VertexBarrelLayer3_rmin" outer_r="VertexBarrelLayer3_rmax" z_length="VertexBarrelLayer_length" /> - <layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" /> - <rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod3_rmin" dr="0.0 * mm"/> + <layer_material surface="inner" binning="binPhi,binZ" bins0="VertexBarrelStave_count3" bins1="100" /> + <layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count3" bins1="100" /> + <rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count3" phi0="0.0" rc="VertexBarrelMod3_rmin" dr="0.0 * mm"/> <z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/> </layer> </detector> From 62c13345996785ec9f61d179a20fcc7e08acec74 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Thu, 21 Mar 2024 12:19:03 -0500 Subject: [PATCH 046/113] fix: mv dRICH from 195cm to 198cm (#668) ### Briefly, what does this PR introduce? This PR extends the dRICH zmin to 198cm, per https://indico.bnl.gov/event/22417/, dRICH integration, an update, Marco Contalbrigo. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- compact/definitions.xml | 2 +- compact/pid/drich.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/definitions.xml b/compact/definitions.xml index a02a5a3d0..8b0b18345 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -454,7 +454,7 @@ Examples: <comment> Forward RICH region </comment> <constant name="ForwardRICHRegion_zmin" value="ForwardPIDRegion_zmin + ForwardTOFRegion_length" /> <constant name="ForwardRICHRegion_length" value="ForwardPIDRegion_length - ForwardTOFRegion_length" /> - <comment> Tangent of the opening angle at the front and back of the RICH </comment> + <comment> Tangent of the opening angle at the front and back of the RICH </comment> <constant name="ForwardRICHRegion_tan1" value="CentralTrackingRegionP_tan * 0.88" /> <constant name="ForwardRICHRegion_tan2" value="Eta3_6_tan * 0.89" /> diff --git a/compact/pid/drich.xml b/compact/pid/drich.xml index 8637f6a3c..67c4097e2 100644 --- a/compact/pid/drich.xml +++ b/compact/pid/drich.xml @@ -6,7 +6,7 @@ <define> <!-- vessel (=snout+tank) geometry --> <constant name="DRICH_length" value="ForwardRICHRegion_length"/> <!-- overall vessel length --> -<constant name="DRICH_zmin" value="ForwardRICHRegion_zmin"/> +<constant name="DRICH_zmin" value="ForwardRICHRegion_zmin + 3.*cm"/> <!-- 3cm spacing since https://indico.bnl.gov/event/22417/ --> <constant name="DRICH_zmax" value="DRICH_zmin + DRICH_length"/> <constant name="DRICH_rmin0" value="DRICH_zmin * ForwardRICHRegion_tan1"/> <!-- bore radius at dRICH entrance --> <constant name="DRICH_rmin1" value="DRICH_zmax * ForwardRICHRegion_tan2"/> <!-- bore radius at dRICH exit --> From ea81b4182356c1f188d5dc6406dac1ac0d6b51d1 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Fri, 22 Mar 2024 15:51:09 -0500 Subject: [PATCH 047/113] feat: add craterlake_material_map.yml configuration (#676) ### Briefly, what does this PR introduce? This PR adds a configuration with all geometry that is to be included in the material map for Acts track reconstruction. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @ShujieL ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- configurations/craterlake_material_map.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 configurations/craterlake_material_map.yml diff --git a/configurations/craterlake_material_map.yml b/configurations/craterlake_material_map.yml new file mode 100644 index 000000000..7e0f09055 --- /dev/null +++ b/configurations/craterlake_material_map.yml @@ -0,0 +1,17 @@ +# This contains all geometry to be used in the material map +features: + beampipe: + tracking: + definitions_craterlake: + vertex_barrel: + silicon_barrel: + mpgd_barrel: + support_service_craterlake: + mpgd_outerbarrel: + mpgd_forward_endcap: + mpgd_backward_endcap: + silicon_disks: + tof_barrel: + tof_endcap: + far_forward: + far_forward: From f56b5f215951cb6d0892cd7397accf8e9cd50c51 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sat, 23 Mar 2024 14:41:57 -0500 Subject: [PATCH 048/113] fix: rm unused compact files (#678) ### Briefly, what does this PR introduce? This PR removes three unused compact files. ### What kind of change does this PR introduce? - [x] Bug fix (issue: unused files) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- compact/forward_trd.xml | 43 --------------------------------------- compact/main_beamline.xml | 19 ----------------- compact/tof.xml | 21 ------------------- 3 files changed, 83 deletions(-) delete mode 100644 compact/forward_trd.xml delete mode 100644 compact/main_beamline.xml delete mode 100644 compact/tof.xml diff --git a/compact/forward_trd.xml b/compact/forward_trd.xml deleted file mode 100644 index ae00fe049..000000000 --- a/compact/forward_trd.xml +++ /dev/null @@ -1,43 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten --> - -<lccdd> - <define> - <comment> - -------------------------- - Forward TRD Parameters - -------------------------- - </comment> - <constant name="ForwardTRD_zmin" value="BarrelTracking_length/2.0 + ForwardTracking_length + ForwardRICH_length"/> - <constant name="ForwardTRD_rmin" value="ForwardPID_rmin1"/> - <constant name="ForwardTRD_rmax" value="Solenoid_rmin"/> - </define> - - <detectors> - <detector - id="ForwardTRD_ID" - name="ForwardTRD" - type="epic_DiskTracker" - insideTrackingVolume="true" - reflect="false" - vis="AnlRed"> - <position x="0" y="0" z="0.0"/> - <layer id="1" - vis="AnlRed" - inner_z="ForwardTRD_zmin" - inner_r="ForwardTRD_rmin" - outer_r="ForwardTRD_rmax"> - <slice material="Air" thickness="ForwardTRD_length/2.5" vis="AnlRed" /> - </layer> - - <layer id="1" - vis="AnlRed" - inner_z="ForwardTRD_zmin+ForwardTRD_length/2.0" - inner_r="ForwardTRD_rmin" - outer_r="ForwardTRD_rmax"> - <slice material="Air" thickness="ForwardTRD_length/2.5" vis="AnlRed" /> - </layer> - </detector> - </detectors> - -</lccdd> diff --git a/compact/main_beamline.xml b/compact/main_beamline.xml deleted file mode 100644 index 28025c608..000000000 --- a/compact/main_beamline.xml +++ /dev/null @@ -1,19 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Sylvester Joosten, Whitney Armstrong --> - -<lccdd> - <define> - <constant name="Pi" value="3.14159265359"/> - <constant name="world_side" value="30*m"/> - <constant name="world_x" value="world_side"/> - <constant name="world_y" value="world_side"/> - <constant name="world_z" value="100*m"/> - </define> - - <includes> - <gdmlFile ref="elements.xml"/> - <gdmlFile ref="materials.xml"/> - </includes> - <include ref="ip6/forward_ion_beamline.xml" /> - -</lccdd> diff --git a/compact/tof.xml b/compact/tof.xml deleted file mode 100644 index 15fdad287..000000000 --- a/compact/tof.xml +++ /dev/null @@ -1,21 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Whitney Armstrong, Zhenyu Ye --> - -<lccdd> - - <display> - </display> - <define> - </define> - - <documentation level="10"> - ### Time-of-flight detectors - - document here - - </documentation> - - <include ref="tof_endcap.xml"/> - <include ref="tof_barrel.xml"/> - -</lccdd> From 0a929341a6a11e78af98f676349e67a244be13a8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sat, 23 Mar 2024 15:15:26 -0500 Subject: [PATCH 049/113] feat: allow `source setup.sh epic_craterlake` to set DETECTOR_CONFIG (#681) ### Briefly, what does this PR introduce? This PR adds a quality of life improvement, hopefully, for loading geometry and setting `DETECTOR_CONFIG` in one go. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- templates/setup.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/setup.sh.in b/templates/setup.sh.in index 75cc81587..9f1006ce8 100644 --- a/templates/setup.sh.in +++ b/templates/setup.sh.in @@ -2,7 +2,7 @@ export DETECTOR=@PROJECT_NAME@ export DETECTOR_PATH=@CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@ -export DETECTOR_CONFIG=@PROJECT_NAME@ +export DETECTOR_CONFIG=${1:-@PROJECT_NAME@} export DETECTOR_VERSION=@GIT_BRANCH@ ## Export detector libraries From 32c7c95b5d4769b7e690700a4d1375b99197e2e6 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sat, 23 Mar 2024 17:50:34 -0500 Subject: [PATCH 050/113] fix: add `prefix/` to `.gitignore` (#680) ### Briefly, what does this PR introduce? Now that we have caused (#669) the default install directory to be `prefix/`, we should add it to the `.gitignore` so no one accidentally adds it to the repo. This PR adds `prefix/` to the project-wide `.gitignore` listing. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4abfaf92e..afb9d6591 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ acts2.txt materials-map.cbor # local install directories +prefix/ lib/ share/ setup.sh From 024877b0e09d2789a20b0265d549b971c521d829 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 24 Mar 2024 12:13:16 -0400 Subject: [PATCH 051/113] Remove brycecanyon configurations (#674) ### Briefly, what does this PR introduce? Removes epic_brycecanyon and upgrades other configurations. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? Not expected ### Does this PR change default behavior? No --- README.md | 1 - _config.yml | 1 - _layouts/geoviewer.html | 2 +- compact/tracking/definitions.xml | 178 ------------- compact/tracking/support_service_assembly.xml | 236 ------------------ configurations/brycecanyon.yml | 33 --- configurations/brycecanyon_10x100.yml | 32 --- configurations/brycecanyon_18x110_Au.yml | 32 --- configurations/brycecanyon_18x275.yml | 32 --- configurations/brycecanyon_5x41.yml | 32 --- configurations/brycecanyon_no_pfrich.yml | 32 --- configurations/brycecanyon_pfrich_gdml.yml | 32 --- configurations/forward_detectors.yml | 4 +- .../forward_detectors_with_inserts.yml | 4 +- configurations/ip6_arches.yml | 8 - configurations/ip6_brycecanyon.yml | 8 - configurations/tof_endcap_only.yml | 2 +- configurations/tof_only.yml | 2 +- configurations/vertex_only.yml | 2 +- reports/arches_views.md | 13 - reports/brycecanyon_views.md | 13 - .../subdetector_tests/draw_bemc_scfi_grids.py | 2 +- scripts/subdetector_tests/material_scan.py | 4 +- 23 files changed, 11 insertions(+), 694 deletions(-) delete mode 100644 compact/tracking/definitions.xml delete mode 100644 compact/tracking/support_service_assembly.xml delete mode 100644 configurations/brycecanyon.yml delete mode 100644 configurations/brycecanyon_10x100.yml delete mode 100644 configurations/brycecanyon_18x110_Au.yml delete mode 100644 configurations/brycecanyon_18x275.yml delete mode 100644 configurations/brycecanyon_5x41.yml delete mode 100644 configurations/brycecanyon_no_pfrich.yml delete mode 100644 configurations/brycecanyon_pfrich_gdml.yml delete mode 100644 configurations/ip6_arches.yml delete mode 100644 configurations/ip6_brycecanyon.yml delete mode 100644 reports/arches_views.md delete mode 100644 reports/brycecanyon_views.md diff --git a/README.md b/README.md index 1e68ea854..c3d5f5bfe 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Overview **Detector geometry viewer:** - [Viewer only](https://eic.github.io/epic/geoviewer) - Main configurations: - - [Brycecanyon](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_brycecanyon.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - [CraterLake](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_craterlake.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - Additional viewers: - [Inner detector (without calorimetry)](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_inner_detector.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) diff --git a/_config.yml b/_config.yml index bcf2a165a..08f8075b5 100644 --- a/_config.yml +++ b/_config.yml @@ -23,7 +23,6 @@ header_pages: - README.md - reports/artifacts.md - reports/geoviewer.md - - reports/brycecanyon_views.md - reports/craterlake_views.md exclude: diff --git a/_layouts/geoviewer.html b/_layouts/geoviewer.html index 59d82a743..e7159a319 100644 --- a/_layouts/geoviewer.html +++ b/_layouts/geoviewer.html @@ -6,7 +6,7 @@ <link rel="shortcut icon" href="https://root.cern/js/latest/img/RootIcon.ico"/> </head> <body> - <div id="simpleGUI" path="./artifacts/tgeo" files="epic_brycecanyon.root;epic_craterlake.root;epic_inner_detector.root"> + <div id="simpleGUI" path="./artifacts/tgeo" files="epic_craterlake.root;epic_inner_detector.root"> loading scripts ... </div> <script type="module"> diff --git a/compact/tracking/definitions.xml b/compact/tracking/definitions.xml deleted file mode 100644 index bc532c152..000000000 --- a/compact/tracking/definitions.xml +++ /dev/null @@ -1,178 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Sylvester Joosten, Shujie Li --> - -<lccdd> - - <display> - </display> - <define> - <comment> Primary directions for the tracker </comment> - <comment> TODO: use actual design angles rather than calculated projective directions </comment> - <comment> projective cone at 45 degree </comment> - <constant name="TrackerPrimaryAngle" value="atan(1)" /> - <constant name="TrackerForwardAngle" value="2*atan(exp(-1.6472))" /> - <constant name="TrackerBackwardAngle" value="2*atan(exp(-1.5166))" /> - - <comment> Main parameters for the vertex tracker </comment> - <constant name="VertexBarrel_length" value="270.0*mm"/> - <constant name="VertexBarrel_rmin" value="3.6*cm"/> - <constant name="VertexBarrel_rmax" value="12.6*cm"/> - - <comment> Main parameters for the SiBarrel layer geometry </comment> - <constant name="SiBarrel1_rmin" value="27.0*cm"/> - <constant name="SiBarrel2_rmin" value="42.0*cm"/> - <constant name="SiBarrel_angle" value="TrackerPrimaryAngle"/> - <constant name="SiBarrel_dz" value="2*cm"/> - <comment> barrel length: 2R/tan(angle) - dz </comment> - - <comment> Main parameters for the MPGD layer geometries </comment> - <constant name="InnerMPGDBarrel_rmin" value="55.0*cm"/> - <constant name="InnerMPGDBarrel_dz" value="8.0*cm"/> - <constant name="InnerMPGDBarrel_length" value="2*InnerMPGDBarrel_rmin / tan(TrackerBackwardAngle) - InnerMPGDBarrel_dz"/> - <constant name="InnerMPGDBarrel_zmin" value="InnerMPGDBarrel_length/2"/> <comment> -z </comment> - <constant name="InnerMPGDBarrel_zmax" value="InnerMPGDBarrel_length/2"/> <comment> +z </comment> - <constant name="InnerMPGDBarrel_zoffset" value="InnerMPGDBarrel_zmax - InnerMPGDBarrel_zmin"/> - <comment> barrel length: 2R/tan(angle) - dz </comment> - - <comment> Main parameters for Barrel TOF layers </comment> - <comment> Barrel TOF region </comment> - <constant name="BarrelTOF_zmin" value="120.0*cm"/> - <constant name="BarrelTOF_zmax" value="120.0*cm"/> - <constant name="BarrelTOF_radius_design" value="64.6*cm"/> - - <comment> Forward TOF region </comment> - <constant name="ForwardTOFRegion_zmin" value="ForwardPIDRegion_zmin" /> - <constant name="ForwardTOFRegion_tan" value="CentralTrackingRegionP_tan" /> - <constant name="ForwardTOFRegion_minR" value="8*cm" /> - <constant name="ForwardTOFRegion_maxR" value="67*cm" /> - <constant name="ForwardTOF_xOffset" value="-2.75*cm" /> - <constant name="ForwardTOF_det_height" value="2.0*cm" /> - <constant name="ForwardTOF_length" value="min(ForwardTOFRegion_length, 2.*cm)"/> - <constant name="ForwardTOF_zmin" value="ForwardTOFRegion_zmin + ForwardTOFRegion_length - ForwardTOF_length - 1*cm"/> - - <comment> Service/Support setup </comment> - <constant name="VertexSupportCyl2_thickness" value="0.3*cm"/> - <constant name="VertexSupportCylCF_thickness" value="100.0*um" /> - <constant name="TrackerSupportCyl_rmin" value="44.0*cm"/> - <comment> These may belong in definitions.xml </comment> - <constant name="InnerTrackerEndcapP_zmax" value="CentralTrackingRegionP_zmax"/> - <constant name="InnerTrackerEndcapN_zmax" value="CentralTrackingRegionN_zmax"/> - <comment> Endcap structures </comment> - <comment> The forward outer cone is projective from the starting rmin1 </comment> - <constant name="ForwardEndcapSupportCone_rmin1" value="85*cm" /> - <constant name="ForwardEndcapSupportCone_zmax" value="190*cm" /> - <comment> Discontinuity for the cone to the cylinder to avoid overlaps FIXME </comment> - <constant name="BackwardEndcapSupportCyl_rmin" value="65*cm" /> - <constant name="BackwardEndcapSupportCyl_zmin" value="BackwardPIDRegion_zmin + 5*cm" /> - <constant name="BackwardEndcapSupportCyl_zmax" value="BackwardPIDRegion_zmax" /> - - <comment> Main parameters for the positive silicon disks </comment> - <comment> assume the disk are centered along z. The inner radii are larger than designed to account for the beampipe offset. Need to be fixed later </comment> - <constant name="Beampipe_bakeout_buffer" value="5*mm" /> - - <constant name="InnerTrackerEndcapP_zmin" value="25.0*cm" /> - <constant name="InnerTrackerEndcapP_rmin" value="Beampipe_rmax + Beampipe_bakeout_buffer" /> - <constant name="InnerTrackerEndcapP_rmax" value="24.0*cm" /> - <constant name="TrackerEndcapPDisk1_zmin" value="45.0*cm" /> - <constant name="TrackerEndcapPDisk1_rmin" value="Beampipe_rmax + Beampipe_bakeout_buffer" /> - <constant name="TrackerEndcapPDisk1_rmax" value="TrackerSupportCyl_rmin - 15*mm" /> - <constant name="TrackerEndcapPDisk2_zmin" value="70.0*cm" /> - <constant name="TrackerEndcapPDisk2_rmin" value="32.86*mm + Beampipe_bakeout_buffer + 0.6*mm" /> - <constant name="TrackerEndcapPDisk2_rmax" value="TrackerSupportCyl_rmin * .98" /> - <constant name="TrackerEndcapPDisk3_zmin" value="100.0*cm" /> - <constant name="TrackerEndcapPDisk3_rmin" value="40.58*mm + Beampipe_bakeout_buffer + 7.85*mm" /> - <constant name="TrackerEndcapPDisk3_rmax" value="TrackerSupportCyl_rmin * .98" /> - <constant name="TrackerEndcapPDisk4_zmin" value="135.0*cm" /> - <constant name="TrackerEndcapPDisk4_rmin" value="49.12*mm + Beampipe_bakeout_buffer + 16.02*mm" /> - <constant name="TrackerEndcapPDisk4_rmax" value="TrackerSupportCyl_rmin * .98" /> - - <comment> Main parameters for the negative silicon disks (will be reflected, so positive z-values here) - </comment> - <constant name="InnerTrackerEndcapN_zmin" value="InnerTrackerEndcapP_zmin" /> - <constant name="InnerTrackerEndcapN_rmin" value="InnerTrackerEndcapP_rmin" /> - <constant name="InnerTrackerEndcapN_rmax" value="InnerTrackerEndcapP_rmax" /> - <constant name="TrackerEndcapNDisk1_zmin" value="TrackerEndcapPDisk1_zmin" /> - <constant name="TrackerEndcapNDisk1_rmin" value="TrackerEndcapPDisk1_rmin" /> - <constant name="TrackerEndcapNDisk1_rmax" value="TrackerEndcapPDisk1_rmax" /> - <constant name="TrackerEndcapNDisk2_zmin" value="65*cm" /> - <constant name="TrackerEndcapNDisk2_rmin" value="Beampipe_rmax + Beampipe_bakeout_buffer" /> - <constant name="TrackerEndcapNDisk2_rmax" value="TrackerEndcapPDisk2_rmax" /> - <constant name="TrackerEndcapNDisk3_zmin" value="90*cm" /> - <constant name="TrackerEndcapNDisk3_rmin" value="34.244*mm + Beampipe_bakeout_buffer + 0.817*mm" /> - <constant name="TrackerEndcapNDisk3_rmax" value="TrackerEndcapPDisk3_rmax" /> - <constant name="TrackerEndcapNDisk4_zmin" value="115*cm" /> - <constant name="TrackerEndcapNDisk4_rmin" value="38.043*mm + Beampipe_bakeout_buffer + 3.310*mm" /> - <constant name="TrackerEndcapNDisk4_rmax" value="TrackerEndcapPDisk4_rmax" /> - </define> - <detectors> - <detector id="VertexSubAssembly_0_ID" - name="VertexBarrelSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="VertexBarrel" /> - </detector> - <detector id="TrackerSubAssembly_0_ID" - name="InnerSiTrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="InnerTrackerEndcapN"/> - <composite name="InnerTrackerEndcapP"/> - </detector> - <detector id="TrackerSubAssembly_1_ID" - name="MiddleSiTrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="MiddleTrackerEndcapN"/> - <composite name="SagittaSiBarrel"/> - <composite name="MiddleTrackerEndcapP"/> - </detector> - <detector id="TrackerSubAssembly_2_ID" - name="OuterSiTrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="OuterTrackerEndcapN"/> - <composite name="OuterSiBarrel"/> - <composite name="OuterTrackerEndcapP"/> - </detector> - <comment>the following two could probably be merged, but we are keeping space for the TOF to be integrated (hence the skip over one ID number) </comment> - <detector id="TrackerSubAssembly_3_ID" - name="InnerMPGDSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="InnerMPGDBarrel"/> - </detector> - <detector id="TrackerSubAssembly_4_ID" - name="BarrelTOFSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="BarrelTOF"/> - </detector> - <detector id="TrackerSubAssembly_6_ID" - name="EndcapTOFSubSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="ForwardTOF"/> - <composite name="BackwardTOF"/> - </detector> - <detector id="B0TrackerSubAssembly_ID" - name="B0TrackerSubAssembly" - type="DD4hep_SubdetectorAssembly" - vis="TrackerSubAssemblyVis"> - <composite name="B0Tracker"/> - <composite name="B0TrackerCompanion"/> - </detector> - </detectors> - - <documentation> - ### Material map for ACTS - https://eicweb.phy.anl.gov/EIC/detectors/athena/-/issues/127 - </documentation> - <plugins> - <plugin name="epic_FileLoader"> - <arg value="cache:$DETECTOR_PATH:/opt/detector"/> - <arg value="file:calibrations/materials-map.cbor"/> - <arg value="url:https://eicweb.phy.anl.gov/EIC/detectors/athena/uploads/77bd16bef5d811f31256279a3601c9d5/material-maps.cbor"/> - </plugin> - </plugins> - -</lccdd> diff --git a/compact/tracking/support_service_assembly.xml b/compact/tracking/support_service_assembly.xml deleted file mode 100644 index 317a587b9..000000000 --- a/compact/tracking/support_service_assembly.xml +++ /dev/null @@ -1,236 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Sylvester Joosten, Shujie Li --> - -<lccdd> - <comment> - Tracker support optimized from ECCE proposal. - </comment> - <define> - <comment> Inner vertex Support</comment> - - <comment> Vertex Support Barrel to the 2nd vertex layer</comment> - <constant name="VertexSupportCyl2_zmax" value="VertexBarrel_length/2.0" /> - <constant name="VertexSupportCyl2_rmin" value="VertexSupportCyl2_zmax*tan(TrackerPrimaryAngle)"/> - <constant name="VertexSupportCyl2_length" value="VertexSupportCyl2_zmax*2.0" /> - - <comment> use a disk to connect vertex barrels to cone</comment> - <constant name="VertexSupportRingCF_thickness" value="2.0*mm" /> - <constant name="VertexSupportRingAl_thickness" value="1.0*mm" /> - <constant name="VertexSupportRing_thickness" value="VertexSupportRingCF_thickness+VertexSupportRingAl_thickness+2*um" /> - <constant name="VertexSupportRing_zmin" value="VertexBarrel_length/2.+ 2*um" /> - <constant name="VertexSupportRing_zmax" value="VertexSupportRing_zmin + VertexSupportRing_thickness" /> - <constant name="VertexSupportRing_rmin" value="VertexBarrel_rmin+2*um" /> - <constant name="VertexSupportRing_rmax" value="VertexSupportCyl2_rmin-2*um" /> - <constant name="VertexSupportRing_z" value="0.5*(VertexSupportRing_zmin + VertexSupportRing_zmax)" /> - - - <comment> Inner tracker service/support cone </comment> - <constant name="InnerSupportConeCF_thickness" value="2.0*mm" /> - <comment> Effective Aluminum for services for now </comment> - <constant name="InnerSupportConeAl_thickness" value="2.0*mm" /> - <constant name="InnerSupportCone_thickness" value="InnerSupportConeAl_thickness + InnerSupportConeCF_thickness" /> - <constant name="InnerSupportCone_rmin2" value="TrackerSupportCyl_rmin-InnerSupportCone_thickness" /> - <constant name="InnerSupportCone_zmin" value="VertexSupportCyl2_zmax+2*um" /> - <constant name="InnerSupportCone_zmax" value="InnerSupportCone_rmin2/tan(TrackerPrimaryAngle)" /> - <constant name="InnerSupportCone_z" value="0.5*(InnerSupportCone_zmax + InnerSupportCone_zmin)" /> - <constant name="InnerSupportCone_length" value="InnerSupportCone_zmax - InnerSupportCone_zmin" /> - <constant name="InnerSupportCone_rmin1" value="InnerSupportCone_zmin/tan(TrackerPrimaryAngle)" /> - - <comment> Tracker disk support cylinder </comment> - <constant name="TrackerSupportCyl_zmin" value="InnerSupportCone_zmax" /> - <constant name="TrackerSupportCylEndcapP_zmax" value="TrackerSupportCyl_rmin/tan(TrackerForwardAngle)" /> - <constant name="TrackerSupportCylEndcapN_zmax" value="TrackerSupportCyl_rmin/tan(TrackerBackwardAngle)" /> - <constant name="TrackerSupportCylEndcapP_z" value="0.5*(TrackerSupportCyl_zmin + TrackerSupportCylEndcapP_zmax)" /> - <constant name="TrackerSupportCylEndcapN_z" value="0.5*(TrackerSupportCyl_zmin + TrackerSupportCylEndcapN_zmax)" /> - <constant name="TrackerSupportCylEndcapP_length" value="TrackerSupportCylEndcapP_zmax - TrackerSupportCyl_zmin" /> - <constant name="TrackerSupportCylEndcapN_length" value="TrackerSupportCylEndcapN_zmax - TrackerSupportCyl_zmin" /> - <constant name="TrackerSupportCylCF_thickness" value="InnerSupportConeCF_thickness" /> - <comment> Effective Aluminum for services for now </comment> - <constant name="TrackerSupportCylAl_thickness" value="5.0*mm" /> - <constant name="TrackerSupportCyl_thickness" value="TrackerSupportCylAl_thickness + TrackerSupportCylCF_thickness" /> - - <comment> Tracker endcap cones </comment> - <constant name="TrackerSupportConeEndcapP_zmin" value="TrackerSupportCylEndcapP_zmax" /> - <constant name="TrackerSupportConeEndcapN_zmin" value="TrackerSupportCylEndcapN_zmax" /> - <constant name="TrackerSupportConeEndcapP_zmax" value="ForwardRICHRegion_zmin" /> - <constant name="TrackerSupportConeEndcapN_zmax" value="InnerTrackerEndcapN_zmax" /> - <constant name="TrackerSupportConeEndcapP_rmin1" value="TrackerSupportCyl_rmin" /> - <constant name="TrackerSupportConeEndcapN_rmin1" value="TrackerSupportCyl_rmin" /> - <constant name="TrackerSupportConeEndcapP_rmin2" value="TrackerSupportConeEndcapP_zmax * tan(TrackerForwardAngle)" /> - <constant name="TrackerSupportConeEndcapN_rmin2" value="TrackerSupportConeEndcapN_zmax * tan(TrackerBackwardAngle)" /> - <constant name="TrackerSupportConeCF_thickness" value="TrackerSupportCylCF_thickness" /> - <comment> Effective Aluminum for services for now </comment> - <constant name="TrackerSupportConeAl_thickness" value="5.0*mm" /> - <constant name="TrackerSupportCone_thickness" value="TrackerSupportConeAl_thickness + TrackerSupportConeCF_thickness" /> - <constant name="TrackerSupportConeEndcapP_z" value="0.5*(TrackerSupportConeEndcapP_zmin + TrackerSupportConeEndcapP_zmax)" /> - <constant name="TrackerSupportConeEndcapN_z" value="0.5*(TrackerSupportConeEndcapN_zmin + TrackerSupportConeEndcapN_zmax)" /> - <constant name="TrackerSupportConeEndcapP_length" value="TrackerSupportConeEndcapP_zmax - TrackerSupportConeEndcapP_zmin" /> - <constant name="TrackerSupportConeEndcapN_length" value="TrackerSupportConeEndcapN_zmax - TrackerSupportConeEndcapN_zmin" /> - - <comment> Endcap support/service thicknesses </comment> - <constant name="EndcapSupportCF_thickness" value="TrackerSupportCylCF_thickness" /> - <comment> Effective Aluminum for services for now </comment> - <constant name="EndcapSupportAl_thickness" value="TrackerSupportCylAl_thickness" /> - <constant name="EndcapSupport_thickness" value="EndcapSupportAl_thickness + EndcapSupportCF_thickness" /> - - <comment> Forward expansion ring and cone </comment> - <comment> Ring and cone are disabled for now - <constant name="ForwardEndcapSupportRing_zmin" value="TrackerSupportConeEndcapP_zmax" /> - <constant name="ForwardEndcapSupportRing_zmax" value="ForwardEndcapSupportRing_zmin + EndcapSupport_thickness" /> - <constant name="ForwardEndcapSupportRing_rmin" value="TrackerSupportConeEndcapP_rmin2" /> - <constant name="ForwardEndcapSupportRing_rmax" value="ForwardEndcapSupportCone_rmin1" /> - <constant name="ForwardEndcapSupportRing_z" value="0.5*(ForwardEndcapSupportRing_zmin + ForwardEndcapSupportRing_zmax)" /> - - <constant name="ForwardEndcapSupportCone_zmin" value="ForwardEndcapSupportRing_zmax" /> - <constant name="ForwardEndcapSupportCone_z" value="0.5*(ForwardEndcapSupportCone_zmin + ForwardEndcapSupportCone_zmax)" /> - <constant name="ForwardEndcapSupportCone_rmin2" value="ForwardEndcapSupportCone_zmax*tan(atan2(ForwardEndcapSupportCone_rmin1, ForwardEndcapSupportCone_zmin))" /> - <constant name="ForwardEndcapSupportCone_length" value="ForwardEndcapSupportCone_zmax - ForwardEndcapSupportCone_zmin" /> - </comment> - - <comment> Backward service cylinder </comment> - <!--constant name="BackwardEndcapSupportCyl_zmin" value="TrackerSupportConeEndcapN_zmax" /--> - <constant name="BackwardEndcapSupportCyl_z" value="0.5*(BackwardEndcapSupportCyl_zmin+BackwardEndcapSupportCyl_zmax)" /> - <constant name="BackwardEndcapSupportCyl_length" value="BackwardEndcapSupportCyl_zmax-BackwardEndcapSupportCyl_zmin" /> - <!--constant name="BackwardEndcapSupportCyl_rmin" value="TrackerSupportConeEndcapN_rmin2" /--> - - - - </define> - - <detectors> - <detector type="epic_SupportServiceMaterial" - name="InnerTrackerSupport" - id="TrackerSupport_0_ID" - > - <comment> Forward </comment> - <support type="Disk" - name="VertexSupportRingForward" - vis="TrackerSupportVis" - rmin="VertexSupportRing_rmin" - rmax="VertexSupportRing_rmax" - thickness="VertexSupportRing_thickness"> - <position x="0*cm" y="0*cm" z="VertexSupportRing_z" /> - <component material="CarbonFiber" thickness="VertexSupportRingCF_thickness" name="Support" vis="TrackerSupportVis"/> - <component material="Aluminum" thickness="VertexSupportRingAl_thickness" name="Services" vis="TrackerServiceVis" /> - </support> - <comment> Backward </comment> - <support type="Disk" - name="VertexSupportRingBackward" - vis="TrackerSupportVis" - rmin="VertexSupportRing_rmin" - rmax="VertexSupportRing_rmax" - thickness="VertexSupportRing_thickness"> - <position x="0*cm" y="0*cm" z="-VertexSupportRing_z" /> - <component material="Aluminum" thickness="VertexSupportRingAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="VertexSupportRingCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - <support type="Cylinder" - name="VertexSupportCyl2" - vis="TrackerSupportVis" - rmin="VertexSupportCyl2_rmin" - length="VertexSupportCyl2_length" - thickness="VertexSupportCyl2_thickness"> - <position x="0*cm" y="0*cm" z="0*cm" /> - <component material="CarbonFiber" thickness="VertexSupportCylCF_thickness" name="Carbon Fiber Shell" vis="TrackerSupportVis"/> - </support> - <support type="Cone" - name="InnerSupportConeEndcapN" - vis="TrackerSupportVis" - rmin1="InnerSupportCone_rmin2" - rmin2="InnerSupportCone_rmin1" - length="InnerSupportCone_length" - thickness="InnerSupportCone_thickness"> - <position x="0*cm" y="0*cm" z="-InnerSupportCone_z" /> - <component material="Aluminum" thickness="InnerSupportConeAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="InnerSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - <support type="Cone" - name="InnerSupportConeEndcapP" - vis="TrackerSupportVis" - rmin1="InnerSupportCone_rmin1" - rmin2="InnerSupportCone_rmin2" - length="InnerSupportCone_length" - thickness="InnerSupportCone_thickness"> - <position x="0*cm" y="0*cm" z="InnerSupportCone_z" /> - <component material="Aluminum" thickness="InnerSupportConeAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="InnerSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - <support type="Cylinder" - name="TrackerSupportCylEndcapN" - vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin" - length="TrackerSupportCylEndcapN_length" - thickness="TrackerSupportCyl_thickness"> - <position x="0*cm" y="0*cm" z="-TrackerSupportCylEndcapN_z" /> - <component material="Aluminum" thickness="TrackerSupportCylAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="TrackerSupportCylCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - <support type="Cylinder" - name="TrackerSupportCylEndcapP" - vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin" - length="TrackerSupportCylEndcapP_length" - thickness="TrackerSupportCyl_thickness"> - <position x="0*cm" y="0*cm" z="TrackerSupportCylEndcapP_z" /> - <component material="Aluminum" thickness="TrackerSupportCylAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="TrackerSupportCylCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - <support type="Cone" - name="TrackerSupportConeEndcapN" - vis="TrackerSupportVis" - rmin1="TrackerSupportConeEndcapN_rmin2" - rmin2="TrackerSupportConeEndcapN_rmin1" - length="TrackerSupportConeEndcapN_length" - thickness="TrackerSupportCone_thickness"> - <position x="0*cm" y="0*cm" z="-TrackerSupportConeEndcapN_z" /> - <component material="Aluminum" thickness="TrackerSupportConeAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="TrackerSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - <support type="Cone" - name="TrackerSupportConeEndcapP" - vis="TrackerSupportVis" - rmin1="TrackerSupportConeEndcapP_rmin1" - rmin2="TrackerSupportConeEndcapP_rmin2" - length="TrackerSupportConeEndcapP_length" - thickness="TrackerSupportCone_thickness"> - <position x="0*cm" y="0*cm" z="TrackerSupportConeEndcapP_z" /> - <component material="Aluminum" thickness="TrackerSupportConeAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="TrackerSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - <comment> Disabled forward ring and final cone - <support type="Disk" - name="ForwardEndcapSupportRing" - vis="TrackerSupportVis" - rmin="ForwardEndcapSupportRing_rmin" - rmax="ForwardEndcapSupportRing_rmax" - thickness="EndcapSupport_thickness"> - <position x="0*cm" y="0*cm" z="ForwardEndcapSupportRing_z" /> - <component material="CarbonFiber" thickness="EndcapSupportCF_thickness" name="Support" vis="TrackerSupportVis"/> - <component material="Aluminum" thickness="EndcapSupportAl_thickness" name="Services" vis="TrackerServiceVis" /> - </support> - <support type="Cone" - name="ForwardEndcapSupportCone" - vis="TrackerSupportVis" - rmin1="ForwardEndcapSupportCone_rmin1" - rmin2="ForwardEndcapSupportCone_rmin2" - length="ForwardEndcapSupportCone_length" - thickness="EndcapSupport_thickness"> - <position x="0*cm" y="0*cm" z="ForwardEndcapSupportCone_z" /> - <component material="Aluminum" thickness="EndcapSupportAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="EndcapSupportCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - </comment> - <support type="Cylinder" - name="BackwardEndcapSupportCyl" - vis="TrackerSupportVis" - rmin="BackwardEndcapSupportCyl_rmin" - length="BackwardEndcapSupportCyl_length" - thickness="EndcapSupport_thickness"> - <position x="0*cm" y="0*cm" z="-BackwardEndcapSupportCyl_z" /> - <component material="Aluminum" thickness="EndcapSupportAl_thickness" name="Services" vis="TrackerServiceVis" /> - <component material="CarbonFiber" thickness="EndcapSupportCF_thickness" name="Support" vis="TrackerSupportVis"/> - </support> - </detector> - </detectors> - -</lccdd> diff --git a/configurations/brycecanyon.yml b/configurations/brycecanyon.yml deleted file mode 100644 index 4e0cd3e8c..000000000 --- a/configurations/brycecanyon.yml +++ /dev/null @@ -1,33 +0,0 @@ -ebeam: 5 -pbeam: 41 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - backward_endcap_flux: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/brycecanyon_10x100.yml b/configurations/brycecanyon_10x100.yml deleted file mode 100644 index 0ed14e415..000000000 --- a/configurations/brycecanyon_10x100.yml +++ /dev/null @@ -1,32 +0,0 @@ -ebeam: 10 -pbeam: 100 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/brycecanyon_18x110_Au.yml b/configurations/brycecanyon_18x110_Au.yml deleted file mode 100644 index 50d183587..000000000 --- a/configurations/brycecanyon_18x110_Au.yml +++ /dev/null @@ -1,32 +0,0 @@ -ebeam: 18 -pbeam: 110_Au -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/brycecanyon_18x275.yml b/configurations/brycecanyon_18x275.yml deleted file mode 100644 index 108cc8e72..000000000 --- a/configurations/brycecanyon_18x275.yml +++ /dev/null @@ -1,32 +0,0 @@ -ebeam: 18 -pbeam: 275 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/brycecanyon_5x41.yml b/configurations/brycecanyon_5x41.yml deleted file mode 100644 index 5da9620da..000000000 --- a/configurations/brycecanyon_5x41.yml +++ /dev/null @@ -1,32 +0,0 @@ -ebeam: 5 -pbeam: 41 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/brycecanyon_no_pfrich.yml b/configurations/brycecanyon_no_pfrich.yml deleted file mode 100644 index afa74e9df..000000000 --- a/configurations/brycecanyon_no_pfrich.yml +++ /dev/null @@ -1,32 +0,0 @@ -ebeam: 5 -pbeam: 41 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - #pfrich_gdml: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/brycecanyon_pfrich_gdml.yml b/configurations/brycecanyon_pfrich_gdml.yml deleted file mode 100644 index b9ac13156..000000000 --- a/configurations/brycecanyon_pfrich_gdml.yml +++ /dev/null @@ -1,32 +0,0 @@ -ebeam: 5 -pbeam: 41 -features: - beampipe: - tracking: - definitions: - vertex_barrel: - silicon_barrel: - mpgd_barrel: - silicon_disks: - support_service_assembly: - tof_barrel: - tof_endcap: - pid: - dirc: - pfrich_gdml: - drich: - ecal: - forward_homogeneous: - forward_insert_homogeneous: - barrel_interlayers: - backward_PbWO4: - solenoid: - hcal: - lfhcal_with_space_for_insert: - forward_insert: - barrel_gdml: - backward: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/forward_detectors.yml b/configurations/forward_detectors.yml index ea16fe090..31f32e017 100644 --- a/configurations/forward_detectors.yml +++ b/configurations/forward_detectors.yml @@ -1,12 +1,12 @@ features: beampipe: tracking: - definitions: + definitions_craterlake: vertex_barrel: silicon_barrel: mpgd_barrel: silicon_disks: - support_service_assembly: + support_service_craterlake: tof_barrel: tof_endcap: pid: diff --git a/configurations/forward_detectors_with_inserts.yml b/configurations/forward_detectors_with_inserts.yml index 8d0f5c6e3..fadbb50a8 100644 --- a/configurations/forward_detectors_with_inserts.yml +++ b/configurations/forward_detectors_with_inserts.yml @@ -1,12 +1,12 @@ features: beampipe: tracking: - definitions: + definitions_craterlake: vertex_barrel: silicon_barrel: mpgd_barrel: silicon_disks: - support_service_assembly: + support_service_craterlake: tof_barrel: tof_endcap: pid: diff --git a/configurations/ip6_arches.yml b/configurations/ip6_arches.yml deleted file mode 100644 index d9eed3ef8..000000000 --- a/configurations/ip6_arches.yml +++ /dev/null @@ -1,8 +0,0 @@ -ebeam: 18 -pbeam: 275 -features: - beampipe: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/ip6_brycecanyon.yml b/configurations/ip6_brycecanyon.yml deleted file mode 100644 index 85531324f..000000000 --- a/configurations/ip6_brycecanyon.yml +++ /dev/null @@ -1,8 +0,0 @@ -ebeam: 5 -pbeam: 41 -features: - beampipe: - far_forward: - far_forward: - far_backward: - far_backward: diff --git a/configurations/tof_endcap_only.yml b/configurations/tof_endcap_only.yml index 6739a9880..353b18ea0 100644 --- a/configurations/tof_endcap_only.yml +++ b/configurations/tof_endcap_only.yml @@ -2,5 +2,5 @@ features: fields: marco: tracking: - definitions: + definitions_craterlake: tof_endcap: diff --git a/configurations/tof_only.yml b/configurations/tof_only.yml index cce2830ae..0ef678964 100644 --- a/configurations/tof_only.yml +++ b/configurations/tof_only.yml @@ -2,6 +2,6 @@ features: fields: marco: tracking: - definitions: + definitions_craterlake: tof_endcap: tof_barrel: diff --git a/configurations/vertex_only.yml b/configurations/vertex_only.yml index 568fd2029..1a712ffb6 100644 --- a/configurations/vertex_only.yml +++ b/configurations/vertex_only.yml @@ -2,5 +2,5 @@ features: fields: marco: tracking: - definitions: + definitions_craterlake: vertex_barrel: diff --git a/reports/arches_views.md b/reports/arches_views.md deleted file mode 100644 index c1321327d..000000000 --- a/reports/arches_views.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -layout: default -title: Views (arches) -permalink: /arches_views ---- -{% for image in site.static_files %} - {% if image.path contains 'epic_arches_views/' %} -<p><a href="{{ site.baseurl }}/{{ image.path }}">{{ image.path }}</a></p> - {% if image.extname contains 'png' %} -<img src="{{ site.baseurl }}/{{ image.path }}" width="400px"/> - {% endif %} - {% endif %} -{% endfor %} diff --git a/reports/brycecanyon_views.md b/reports/brycecanyon_views.md deleted file mode 100644 index 000538505..000000000 --- a/reports/brycecanyon_views.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -layout: default -title: Views (brycecanyon) -permalink: /brycecayon_views ---- -{% for image in site.static_files %} - {% if image.path contains 'epic_brycecanyon_views/' %} -<p><a href="{{ site.baseurl }}/{{ image.path }}">{{ image.path }}</a></p> - {% if image.extname contains 'png' %} -<img src="{{ site.baseurl }}/{{ image.path }}" width="400px"/> - {% endif %} - {% endif %} -{% endfor %} diff --git a/scripts/subdetector_tests/draw_bemc_scfi_grids.py b/scripts/subdetector_tests/draw_bemc_scfi_grids.py index 59ca58e7b..29d29ec61 100644 --- a/scripts/subdetector_tests/draw_bemc_scfi_grids.py +++ b/scripts/subdetector_tests/draw_bemc_scfi_grids.py @@ -3,7 +3,7 @@ ''' A script to visualize the fibers of some grids from BEMC ScFi part use case: - python scripts/subdetector_tests/draw_bemc_scfi_grids.py -c epic_brycecanyon.xml + python scripts/subdetector_tests/draw_bemc_scfi_grids.py -c epic_craterlake.xml ''' import os import ROOT diff --git a/scripts/subdetector_tests/material_scan.py b/scripts/subdetector_tests/material_scan.py index dd1afe3ee..62f93c91b 100644 --- a/scripts/subdetector_tests/material_scan.py +++ b/scripts/subdetector_tests/material_scan.py @@ -39,8 +39,8 @@ # FIXME: this is a work-around to an issue of dd4hep::rec::MaterialManager::placementsBetween # As of 04/21/2023, at negative eta (eta < 0.), the scan will miss the first material layer (vacuum, 2.8 cm) # To reporduce this issue, check the difference between: -# materialScan epic_brycecanyon.xml 0 0 0 100 40 -0.01 | grep Vacuum -# materialScan epic_brycecanyon.xml 0 0 0 100 40 0.01 | grep Vacuum +# materialScan epic_craterlake.xml 0 0 0 100 40 -0.01 | grep Vacuum +# materialScan epic_craterlake.xml 0 0 0 100 40 0.01 | grep Vacuum # It is GEOMETRY DEPENDENT (the thickness of the first vacuum material layer) # This helper class can be removed once the issue is fixed # Plan to file a bug report for this (as of 04/21/2023) From dc00fc3b592b3ae0366d4081465b471c47a6feeb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sun, 24 Mar 2024 16:20:09 -0500 Subject: [PATCH 052/113] fix(ci): rm unused lcg workflow (#682) ### Briefly, what does this PR introduce? This PR removes the unused LCG workflow. While using a standard environment like LCG is a nice idea, LCG runs too far behind the releases of DD4hep. We routinely contribute changes to DD4hep and want to use them sooner than 2 years later when they become available in LCG. ### What kind of change does this PR introduce? - [x] Bug fix (issue: unused code) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. Workflow was already disabled. --- .github/workflows/linux-lcg.yml | 42 --------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/linux-lcg.yml diff --git a/.github/workflows/linux-lcg.yml b/.github/workflows/linux-lcg.yml deleted file mode 100644 index fc2794fe4..000000000 --- a/.github/workflows/linux-lcg.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: linux-lcg - -on: - push: - branches: - - main - tags: - - '*' - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-lcg-ubuntu-2004: - runs-on: ubuntu-20.04 - if: ${{ false }} # Note: disabled until LCG has at least DD4hep 1.21 (LCG_103 or beyond) - strategy: - fail-fast: false - matrix: - LCG: ["LCG_101/x86_64-ubuntu2004-gcc9-opt"] - steps: - - uses: actions/checkout@v4 - - uses: cvmfs-contrib/github-action-cvmfs@v4 - with: - cvmfs_repositories: 'sft.cern.ch,geant4.cern.ch' - - uses: aidasoft/run-lcg-view@v4 - with: - release-platform: ${{ matrix.LCG }} - run: | - PREFIX=${PWD}/install - cmake -B build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} - cmake --build build -- install - # check geometry - source ${PREFIX}/setup.sh - checkGeometry -c ${DETECTOR_PATH}/${DETECTOR}.xml - - uses: actions/upload-artifact@v4 - with: - name: build-lcg-ubuntu2004 - path: install/ - if-no-files-found: error From ae2e7e5113c7ab3cb2041b02fdfad91e7f7e8b35 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sun, 24 Mar 2024 16:47:10 -0500 Subject: [PATCH 053/113] feat: export simulation geometry to CAD models (STEP) (#667) ### Briefly, what does this PR introduce? This PR exports the geometry to STEP files for CAD import and dimensioning. There are no real settings to tweak, but to increase the level at which volumes are exported, hints can be added to the yaml file. Detectors can also be removed (currently only the ACTS subassemblies are removed since they don't do anything). There are 'issues' that need to be addressed, but they have to be addressed in npsim: - units are off (npdet_to_step use the cm value from TGeo and writes them as inch values in STEP) https://github.com/eic/npsim/issues/20, - some shapes cannot be exported; not sure yet which ones and it makes more sense to bypass them in npsim https://github.com/eic/npsim/issues/21. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/linux-eic-shell.yml | 36 ++++++++++++++++++++++++++ configurations/craterlake_no_bhcal.yml | 35 +++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 configurations/craterlake_no_bhcal.yml diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 95d847ebf..fe7a81a42 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -249,6 +249,42 @@ jobs: path: "*.root" if-no-files-found: error + convert-to-step: + runs-on: ubuntu-latest + needs: + - build + strategy: + matrix: + detector_config: [epic_craterlake_no_bhcal, epic_craterlake_tracking_only, epic_dirc_only, epic_drich_only, epic_imaging_only, epic_ip6, epic_lfhcal_with_insert] + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: build-gcc-fast-eic-shell + path: install/ + - uses: cvmfs-contrib/github-action-cvmfs@v4 + - uses: eic/run-cvmfs-osg-eic-shell@main + with: + platform-release: "jug_xl:nightly" + network_types: "none" + setup: install/setup.sh + run: | + # For some reason npdet_to_step really wants a space in IFS + IFS=$' \n\t' + # First get all detectors (except world) + declare -A detectors + while read d ; do detectors[$d]='-l 3' ; done <<< $(npdet_to_step list $DETECTOR_PATH/${{matrix.detector_config}}.xml | sed '/world/d;s/.*(vol: \(.*\)).*/\1/g') + # Then tweak the levels (default is 1) + detectors[LFHCAL]='-l 2' + detectors[OuterBarrelMPGDSubAssembly]='-l 4' + # Export to one STEP file + npdet_to_step $(for d in ${!detectors[@]} ; do echo part ${detectors[$d]} $d ; done) -o ${{matrix.detector_config}} $DETECTOR_PATH/${{matrix.detector_config}}.xml 2>&1 | sed '/TGeoMatrix::dtor/d' + - uses: actions/upload-artifact@v4 + with: + name: ${{matrix.detector_config}}.stp + path: ${{matrix.detector_config}}.stp + if-no-files-found: error + dump-constants: runs-on: ubuntu-latest needs: build diff --git a/configurations/craterlake_no_bhcal.yml b/configurations/craterlake_no_bhcal.yml new file mode 100644 index 000000000..12fa99f03 --- /dev/null +++ b/configurations/craterlake_no_bhcal.yml @@ -0,0 +1,35 @@ +ebeam: 5 +pbeam: 41 +features: + beampipe: + tracking: + definitions_craterlake: + vertex_barrel: + silicon_barrel: + mpgd_barrel: + support_service_craterlake: + mpgd_outerbarrel: + mpgd_forward_endcap: + mpgd_backward_endcap: + silicon_disks: + tof_barrel: + tof_endcap: + pid: + dirc: + pfrich: + drich: + ecal: + forward_homogeneous: + forward_insert_homogeneous: + barrel_interlayers: + backward_PbWO4: + solenoid: + hcal: + lfhcal_with_space_for_insert: + forward_insert: + backward: + backward_endcap_flux: + far_forward: + far_forward: + far_backward: + far_backward: From 22764e68d5e4d4721fd2f73fb8985b475b743629 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Wed, 27 Mar 2024 08:30:24 -0500 Subject: [PATCH 054/113] fix: rotate DRICH by 30 degrees (#683) ### Briefly, what does this PR introduce? This PR rotates the DRICH by 30 degrees. Per Marco's slides at https://indico.bnl.gov/event/22417/, e.g. slides 9 and 10, the DRICH has a readout box at the top, bottom, and at 2 and 4 o'clock, and 8 and 10 o'clock. That's different from where we had it before which was 0 degrees in phi, i.e. X axis, which is 9 o'clock. For an interaction region with a crossing angle, this matters, of course. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, it rotates the DRICH by 30 degrees. --- src/DRICH_geo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index 45c9066a0..aeb09912c 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -346,7 +346,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec continue; // sector rotation about z axis - RotationZ sectorRotation(isec * 2 * M_PI / nSectors); + RotationZ sectorRotation((isec + 0.5) * 2 * M_PI / nSectors); std::string secName = "sec" + std::to_string(isec); // BUILD MIRRORS ==================================================================== From 237431eb5ae35cb079c8b98da93c63a19c453f13 Mon Sep 17 00:00:00 2001 From: billlee77 <wenliang.billlee@gmail.com> Date: Wed, 27 Mar 2024 11:33:34 -0400 Subject: [PATCH 055/113] 637 adetailed dd4hep description of pfrich (#664) ### Briefly, what does this PR introduce? ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? This pull request bringing the new description of pfRICH. Local and global overlap is checked to be good ### Does this PR change default behavior? No --------- Co-authored-by: karthik18495 <karthik18495@gmail.com> Co-authored-by: karthik suresh <44040295+karthik18495@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> --- compact/pid/pfrich.gdml | 2518 --------------------------- compact/pid/pfrich.xml | 159 +- compact/pid/pfrich_gdml.xml | 11 - configurations/pfrich_gdml_only.yml | 6 - src/PFRICH_geo.cpp | 1001 +++++++---- 5 files changed, 772 insertions(+), 2923 deletions(-) delete mode 100644 compact/pid/pfrich.gdml delete mode 100644 compact/pid/pfrich_gdml.xml delete mode 100644 configurations/pfrich_gdml_only.yml diff --git a/compact/pid/pfrich.gdml b/compact/pid/pfrich.gdml deleted file mode 100644 index f11c3b8e2..000000000 --- a/compact/pid/pfrich.gdml +++ /dev/null @@ -1,2518 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd"> - - <define> - <matrix coldim="2" name="RINDEX0x32ccdb0" values="1.675e-06 1.04354 1.85e-06 1.04367 2.025e-06 1.04381 2.2e-06 1.04398 2.375e-06 1.04415 2.55e-06 1.04434 2.725e-06 1.04455 2.9e-06 1.04477 3.075e-06 1.04501 3.25e-06 1.04526 3.425e-06 1.04553 3.6e-06 1.04582 3.775e-06 1.04613 3.95e-06 1.04646 4.125e-06 1.0468 4.3e-06 1.04717 4.475e-06 1.04756 4.65e-06 1.04797 4.825e-06 1.0484 5e-06 1.04886 5.175e-06 1.04914 5.35e-06 1.04975 5.525e-06 1.05023 5.7e-06 1.05074 5.875e-06 1.05126 6.05e-06 1.0518 6.225e-06 1.05236 6.4e-06 1.05294 6.575e-06 1.05353 6.75e-06 1.05414 6.925e-06 1.05477"/> - <matrix coldim="2" name="GROUPVEL0x32cd090" values="1.675e-06 286.924 1.7625e-06 286.907 1.9375e-06 286.803 2.1125e-06 286.623 2.2875e-06 286.53 2.4625e-06 286.357 2.6375e-06 286.168 2.8125e-06 286.008 2.9875e-06 285.793 3.1625e-06 285.611 3.3375e-06 285.369 3.5125e-06 285.111 3.6875e-06 284.837 3.8625e-06 284.547 4.0375e-06 284.305 4.2125e-06 283.924 4.3875e-06 283.588 4.5625e-06 283.236 4.7375e-06 282.87 4.9125e-06 282.412 5.0875e-06 283.588 5.2625e-06 280.761 5.4375e-06 281.521 5.6125e-06 281.01 5.7875e-06 280.653 5.9625e-06 280.199 6.1375e-06 279.731 6.3125e-06 279.248 6.4875e-06 278.849 6.6625e-06 278.344 6.925e-06 277.744"/> - <matrix coldim="2" name="RAYLEIGH0x32d0160" values="1.675e-06 368.992 1.85e-06 276.148 2.025e-06 208.91 2.2e-06 159.28 2.375e-06 122.311 2.55e-06 94.4909 2.725e-06 73.5915 2.9e-06 58.2796 3.075e-06 46.5131 3.25e-06 37.2842 3.425e-06 30.1133 3.6e-06 24.4282 3.775e-06 19.774 3.95e-06 16.1085 4.125e-06 13.0108 4.3e-06 10.6804 4.475e-06 8.74212 4.65e-06 7.22615 4.825e-06 6.0307 5e-06 5.02443 5.175e-06 4.3785 5.35e-06 3.8331 5.525e-06 3.3701 5.7e-06 2.9749 5.875e-06 2.6359 6.05e-06 2.3439 6.225e-06 2.0913 6.4e-06 1.8717 6.575e-06 1.6803 6.75e-06 1.5127 6.925e-06 1.3655"/> - <matrix coldim="2" name="ABSLENGTH0x32ce2a0" values="1.6319e-06 178.646 1.73105e-06 177.265 1.8568e-06 178.447 2.02323e-06 179.624 2.19992e-06 182.134 2.42725e-06 187.362 2.63718e-06 184.58 2.84431e-06 192.689 3.07036e-06 205.574 3.31636e-06 217.744 3.52495e-06 201.034 3.74539e-06 177.724 3.95e-06 139.95 4.09951e-06 104.014 4.26089e-06 72.9579 4.3907e-06 50.0776 4.6747e-06 36.9479 4.96937e-06 27.6585 5.17722e-06 21.314 5.42017e-06 15.8411 5.91945e-06 11.8578 6.88889e-06 5.77248"/> - <matrix coldim="2" name="RINDEX0x32d9110" values="4.13281e-06 1.5017 4.22099e-06 1.5017 4.30916e-06 1.5017 4.39734e-06 1.5017 4.48552e-06 1.5017 4.57369e-06 1.5017 4.66187e-06 1.5017 4.75005e-06 1.5017 4.83822e-06 1.5017 4.9264e-06 1.5017 5.01458e-06 1.5017 5.10275e-06 1.5017 5.19093e-06 1.5017 5.27911e-06 1.5017 5.36728e-06 1.5017 5.45546e-06 1.5017 5.54364e-06 1.5017 5.63181e-06 1.5017 5.71999e-06 1.5017 5.80817e-06 1.5017 5.89634e-06 1.5017 5.98452e-06 1.5017 6.0727e-06 1.5017 6.16087e-06 1.5017 6.24905e-06 1.5017 6.33723e-06 1.5017 6.4254e-06 1.5017 6.51358e-06 1.5017 6.60176e-06 1.5017 6.68993e-06 1.5017 6.77811e-06 1.5017 6.86629e-06 1.5017 6.95446e-06 1.5017 7.04264e-06 1.5017 7.13082e-06 1.5017 7.21899e-06 1.5017 7.30717e-06 1.5017 7.39535e-06 1.5017 7.48353e-06 1.5017 7.5717e-06 1.5017 7.65988e-06 1.5017 7.74806e-06 1.5017 7.83623e-06 1.5017 7.92441e-06 1.5017 8.01259e-06 1.5017 8.10076e-06 1.5017 8.18894e-06 1.5017 8.27712e-06 1.5017 8.36529e-06 1.5017 8.45347e-06 1.5017"/> - <matrix coldim="2" name="GROUPVEL0x32d94f0" values="4.13281e-06 199.635 4.1769e-06 199.635 4.26507e-06 199.635 4.35325e-06 199.635 4.44143e-06 199.635 4.5296e-06 199.635 4.61778e-06 199.635 4.70596e-06 199.635 4.79413e-06 199.635 4.88231e-06 199.635 4.97049e-06 199.635 5.05866e-06 199.635 5.14684e-06 199.635 5.23502e-06 199.635 5.32319e-06 199.635 5.41137e-06 199.635 5.49955e-06 199.635 5.58772e-06 199.635 5.6759e-06 199.635 5.76408e-06 199.635 5.85225e-06 199.635 5.94043e-06 199.635 6.02861e-06 199.635 6.11678e-06 199.635 6.20496e-06 199.635 6.29314e-06 199.635 6.38131e-06 199.635 6.46949e-06 199.635 6.55767e-06 199.635 6.64584e-06 199.635 6.73402e-06 199.635 6.8222e-06 199.635 6.91037e-06 199.635 6.99855e-06 199.635 7.08673e-06 199.635 7.1749e-06 199.635 7.26308e-06 199.635 7.35126e-06 199.635 7.43944e-06 199.635 7.52761e-06 199.635 7.61579e-06 199.635 7.70397e-06 199.635 7.79214e-06 199.635 7.88032e-06 199.635 7.9685e-06 199.635 8.05667e-06 199.635 8.14485e-06 199.635 8.23303e-06 199.635 8.3212e-06 199.635 8.45347e-06 199.635"/> - <matrix coldim="2" name="RAYLEIGH0x32da170" values="4.13281e-06 1e+06 4.22099e-06 1e+06 4.30916e-06 1e+06 4.39734e-06 1e+06 4.48552e-06 1e+06 4.57369e-06 1e+06 4.66187e-06 1e+06 4.75005e-06 1e+06 4.83822e-06 1e+06 4.9264e-06 1e+06 5.01458e-06 1e+06 5.10275e-06 1e+06 5.19093e-06 1e+06 5.27911e-06 1e+06 5.36728e-06 1e+06 5.45546e-06 1e+06 5.54364e-06 1e+06 5.63181e-06 1e+06 5.71999e-06 1e+06 5.80817e-06 1e+06 5.89634e-06 1e+06 5.98452e-06 1e+06 6.0727e-06 1e+06 6.16087e-06 1e+06 6.24905e-06 1e+06 6.33723e-06 1e+06 6.4254e-06 1e+06 6.51358e-06 1e+06 6.60176e-06 1e+06 6.68993e-06 1e+06 6.77811e-06 1e+06 6.86629e-06 1e+06 6.95446e-06 1e+06 7.04264e-06 1e+06 7.13082e-06 1e+06 7.21899e-06 1e+06 7.30717e-06 1e+06 7.39535e-06 1e+06 7.48353e-06 1e+06 7.5717e-06 1e+06 7.65988e-06 1e+06 7.74806e-06 1e+06 7.83623e-06 1e+06 7.92441e-06 1e+06 8.01259e-06 1e+06 8.10076e-06 1e+06 8.18894e-06 1e+06 8.27712e-06 1e+06 8.36529e-06 1e+06 8.45347e-06 1e+06"/> - <matrix coldim="2" name="ABSLENGTH0x32d84d0" values="4.13281e-06 82.0704 4.22099e-06 36.9138 4.30916e-06 13.3325 4.39734e-06 5.03627 4.48552e-06 2.3393 4.57369e-06 1.36177 4.66187e-06 0.933192 4.75005e-06 0.708268 4.83822e-06 0.573082 4.9264e-06 0.483641 5.01458e-06 0.420282 5.10275e-06 0.373102 5.19093e-06 0.33662 5.27911e-06 0.307572 5.36728e-06 0.283902 5.45546e-06 0.264235 5.54364e-06 0.247641 5.63181e-06 0.233453 5.71999e-06 0.221177 5.80817e-06 0.210456 5.89634e-06 0.201012 5.98452e-06 0.192627 6.0727e-06 0.185134 6.16087e-06 0.178399 6.24905e-06 0.172309 6.33723e-06 0.166779 6.4254e-06 0.166779 6.51358e-06 0.166779 6.60176e-06 0.166779 6.68993e-06 0.166779 6.77811e-06 0.166779 6.86629e-06 0.166779 6.95446e-06 0.166779 7.04264e-06 0.166779 7.13082e-06 0.166779 7.21899e-06 0.166779 7.30717e-06 0.166779 7.39535e-06 0.166779 7.48353e-06 0.166779 7.5717e-06 0.166779 7.65988e-06 0.166779 7.74806e-06 0.166779 7.83623e-06 0.166779 7.92441e-06 0.166779 8.01259e-06 0.166779 8.10076e-06 0.166779 8.18894e-06 0.166779 8.27712e-06 0.166779 8.36529e-06 0.166779 8.45347e-06 0.166779"/> - <matrix coldim="2" name="RINDEX0x32574d0" values="1.54975e-06 1.0003 1.77114e-06 1.0003 1.99254e-06 1.0003 2.21393e-06 1.0003 2.43532e-06 1.0003 2.65671e-06 1.0003 2.87811e-06 1.0003 3.0995e-06 1.0003 3.32089e-06 1.00031 3.54229e-06 1.00031 3.76368e-06 1.00031 3.98507e-06 1.00031 4.20646e-06 1.00031 4.42786e-06 1.00032 4.64925e-06 1.00032 4.87064e-06 1.00032 5.09204e-06 1.00032 5.31343e-06 1.00033 5.53482e-06 1.00033 5.75621e-06 1.00033 5.97761e-06 1.00034 6.199e-06 1.00034 6.42039e-06 1.00035 6.64179e-06 1.00035 6.86318e-06 1.00035 7.08457e-06 1.00036"/> - <matrix coldim="2" name="GROUPVEL0x3257bf0" values="1.54975e-06 299.702 1.66045e-06 299.702 1.88184e-06 299.701 2.10323e-06 299.7 2.32462e-06 299.699 2.54602e-06 299.698 2.76741e-06 299.697 2.9888e-06 299.696 3.2102e-06 299.694 3.43159e-06 299.693 3.65298e-06 299.691 3.87437e-06 299.689 4.09577e-06 299.687 4.31716e-06 299.685 4.53855e-06 299.682 4.75995e-06 299.68 4.98134e-06 299.677 5.20273e-06 299.674 5.42412e-06 299.67 5.64552e-06 299.667 5.86691e-06 299.663 6.0883e-06 299.658 6.3097e-06 299.654 6.53109e-06 299.648 6.75248e-06 299.643 7.08457e-06 299.636"/> - <matrix coldim="2" name="REFLECTIVITY0x33615e0" values="1.54975e-06 0.9 1.77114e-06 0.9 1.99254e-06 0.9 2.21393e-06 0.9 2.43532e-06 0.9 2.65671e-06 0.9 2.87811e-06 0.9 3.0995e-06 0.9 3.32089e-06 0.9 3.54229e-06 0.9 3.76368e-06 0.9 3.98507e-06 0.9 4.20646e-06 0.9 4.42786e-06 0.9 4.64925e-06 0.9 4.87064e-06 0.9 5.09204e-06 0.9 5.31343e-06 0.9 5.53482e-06 0.9 5.75621e-06 0.9 5.97761e-06 0.9 6.199e-06 0.9 6.42039e-06 0.9 6.64179e-06 0.9 6.86318e-06 0.9 7.08457e-06 0.9"/> - <matrix coldim="2" name="REFLECTIVITY0x3363220" values="1.54975e-06 0.9 1.77114e-06 0.9 1.99254e-06 0.9 2.21393e-06 0.9 2.43532e-06 0.9 2.65671e-06 0.9 2.87811e-06 0.9 3.0995e-06 0.9 3.32089e-06 0.9 3.54229e-06 0.9 3.76368e-06 0.9 3.98507e-06 0.9 4.20646e-06 0.9 4.42786e-06 0.9 4.64925e-06 0.9 4.87064e-06 0.9 5.09204e-06 0.9 5.31343e-06 0.9 5.53482e-06 0.9 5.75621e-06 0.9 5.97761e-06 0.9 6.199e-06 0.9 6.42039e-06 0.9 6.64179e-06 0.9 6.86318e-06 0.9 7.08457e-06 0.9"/> - <matrix coldim="2" name="RINDEX0x3259560" values="1.26531e-06 1.45067 1.37017e-06 1.45168 1.45523e-06 1.45247 1.45882e-06 1.4525 1.49398e-06 1.45282 1.58974e-06 1.45367 1.65333e-06 1.45424 1.78597e-06 1.45542 1.83323e-06 1.45585 1.85075e-06 1.45601 1.88938e-06 1.45637 1.90769e-06 1.45653 1.91624e-06 1.45661 1.92606e-06 1.45671 1.95276e-06 1.45695 1.95954e-06 1.45702 1.97452e-06 1.45716 2.02647e-06 1.45765 2.08719e-06 1.45824 2.10419e-06 1.4584 2.11028e-06 1.45846 2.14459e-06 1.4588 2.27065e-06 1.46008 2.28151e-06 1.46019 2.33083e-06 1.46071 2.41011e-06 1.46156 2.42852e-06 1.46176 2.4716e-06 1.46223 2.49748e-06 1.46252 2.54098e-06 1.46301 2.55092e-06 1.46313 2.58333e-06 1.4635 2.60231e-06 1.46372 2.62323e-06 1.46397 2.66209e-06 1.46443 2.70801e-06 1.46498 2.80797e-06 1.46622 2.84534e-06 1.4667 2.98077e-06 1.46847 3.064e-06 1.46961 3.40847e-06 1.47472 3.49591e-06 1.47612 3.53176e-06 1.47671 3.53276e-06 1.47672 3.67843e-06 1.47919 3.81538e-06 1.48164 4.02597e-06 1.48564 4.66165e-06 1.49968 4.8249e-06 1.50383 5e-06 1.50855 5.08197e-06 1.51086 6.42487e-06 1.56077"/> - <matrix coldim="2" name="GROUPVEL0x3259e20" values="1.26531e-06 204.867 1.31774e-06 204.796 1.4127e-06 204.61 1.45703e-06 204.684 1.4764e-06 204.483 1.54186e-06 204.368 1.62154e-06 204.151 1.71965e-06 203.924 1.8096e-06 203.65 1.84199e-06 203.559 1.87006e-06 203.44 1.89854e-06 203.52 1.91197e-06 203.324 1.92115e-06 203.081 1.93941e-06 203.35 1.95615e-06 202.949 1.96703e-06 203.184 2.0005e-06 203.074 2.05683e-06 202.846 2.09569e-06 202.831 2.10724e-06 202.674 2.12743e-06 202.602 2.20762e-06 202.309 2.27608e-06 202.127 2.30617e-06 201.912 2.37047e-06 201.67 2.41931e-06 201.48 2.45006e-06 201.376 2.48454e-06 201.174 2.51923e-06 201.049 2.54595e-06 200.685 2.56712e-06 200.85 2.59282e-06 200.71 2.61277e-06 200.521 2.64266e-06 200.465 2.68505e-06 200.281 2.75799e-06 199.887 2.82666e-06 199.494 2.91306e-06 199.111 3.02238e-06 198.481 3.23623e-06 197.215 3.45219e-06 195.855 3.51383e-06 195.4 3.53226e-06 198.293 3.6056e-06 194.786 3.74691e-06 193.735 3.92068e-06 192.41 4.34381e-06 188.735 4.74328e-06 184.792 4.91245e-06 182.956 5.04098e-06 181.499 6.42487e-06 169.028"/> - <matrix coldim="2" name="REFLECTIVITY0x3366850" values="1.54975e-06 0.8 1.77114e-06 0.8 1.99254e-06 0.8 2.21393e-06 0.8 2.43532e-06 0.8 2.65671e-06 0.8 2.87811e-06 0.8 3.0995e-06 0.8 3.32089e-06 0.8 3.54229e-06 0.8 3.76368e-06 0.8 3.98507e-06 0.8 4.20646e-06 0.8 4.42786e-06 0.8 4.64925e-06 0.8 4.87064e-06 0.8 5.09204e-06 0.8 5.31343e-06 0.8 5.53482e-06 0.8 5.75621e-06 0.8 5.97761e-06 0.8 6.199e-06 0.8 6.42039e-06 0.8 6.64179e-06 0.8 6.86318e-06 0.8 7.08457e-06 0.8"/> - <matrix coldim="2" name="SPECULARLOBECONSTANT0x3366100" values="1.54975e-06 1 1.77114e-06 1 1.99254e-06 1 2.21393e-06 1 2.43532e-06 1 2.65671e-06 1 2.87811e-06 1 3.0995e-06 1 3.32089e-06 1 3.54229e-06 1 3.76368e-06 1 3.98507e-06 1 4.20646e-06 1 4.42786e-06 1 4.64925e-06 1 4.87064e-06 1 5.09204e-06 1 5.31343e-06 1 5.53482e-06 1 5.75621e-06 1 5.97761e-06 1 6.199e-06 1 6.42039e-06 1 6.64179e-06 1 6.86318e-06 1 7.08457e-06 1"/> - <matrix coldim="2" name="RINDEX0x32db990" values="1.54975e-06 2.7 1.77114e-06 2.7 1.99254e-06 2.7 2.21393e-06 2.7 2.43532e-06 2.7 2.65671e-06 2.7 2.87811e-06 2.7 3.0995e-06 2.7 3.32089e-06 2.7 3.54229e-06 2.7 3.76368e-06 2.7 3.98507e-06 2.7 4.20646e-06 2.7 4.42786e-06 2.7 4.64925e-06 2.7 4.87064e-06 2.7 5.09204e-06 2.7 5.31343e-06 2.7 5.53482e-06 2.7 5.75621e-06 2.7 5.97761e-06 2.7 6.199e-06 2.7 6.42039e-06 2.7 6.64179e-06 2.7 6.86318e-06 2.7 7.08457e-06 2.7"/> - <matrix coldim="2" name="GROUPVEL0x32dc0b0" values="1.54975e-06 111.034 1.66045e-06 111.034 1.88184e-06 111.034 2.10323e-06 111.034 2.32462e-06 111.034 2.54602e-06 111.034 2.76741e-06 111.034 2.9888e-06 111.034 3.2102e-06 111.034 3.43159e-06 111.034 3.65298e-06 111.034 3.87437e-06 111.034 4.09577e-06 111.034 4.31716e-06 111.034 4.53855e-06 111.034 4.75995e-06 111.034 4.98134e-06 111.034 5.20273e-06 111.034 5.42412e-06 111.034 5.64552e-06 111.034 5.86691e-06 111.034 6.0883e-06 111.034 6.3097e-06 111.034 6.53109e-06 111.034 6.75248e-06 111.034 7.08457e-06 111.034"/> - </define> - - <materials> - <material Z="13" name="G4_Al0x3247b70" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="166"/> - <D unit="g/cm3" value="2.699"/> - <atom unit="g/mole" value="26.9815"/> - </material> - <isotope N="12" Z="6" name="C120x32415c0"> - <atom unit="g/mole" value="12"/> - </isotope> - <isotope N="13" Z="6" name="C130x3241630"> - <atom unit="g/mole" value="13.0034"/> - </isotope> - <element name="C0x3241360"> - <fraction n="0.9893" ref="C120x32415c0"/> - <fraction n="0.0107" ref="C130x3241630"/> - </element> - <material name="QuarterInchHoneycomb0x32de250" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="81"/> - <D unit="g/cm3" value="0.251859952406083"/> - <fraction n="1" ref="C0x3241360"/> - </material> - <isotope N="16" Z="8" name="O160x3241b40"> - <atom unit="g/mole" value="15.9949"/> - </isotope> - <isotope N="17" Z="8" name="O170x3241850"> - <atom unit="g/mole" value="16.9991"/> - </isotope> - <isotope N="18" Z="8" name="O180x3241bd0"> - <atom unit="g/mole" value="17.9992"/> - </isotope> - <element name="O0x32418e0"> - <fraction n="0.99757" ref="O160x3241b40"/> - <fraction n="0.00038" ref="O170x3241850"/> - <fraction n="0.00205" ref="O180x3241bd0"/> - </element> - <isotope N="1" Z="1" name="H10x3241270"> - <atom unit="g/mole" value="1.00782503081372"/> - </isotope> - <isotope N="2" Z="1" name="H20x3241300"> - <atom unit="g/mole" value="2.01410199966617"/> - </isotope> - <element name="H0x3241010"> - <fraction n="0.999885" ref="H10x3241270"/> - <fraction n="0.000115" ref="H20x3241300"/> - </element> - <isotope N="28" Z="14" name="Si280x3241f00"> - <atom unit="g/mole" value="27.9769"/> - </isotope> - <isotope N="29" Z="14" name="Si290x3241ab0"> - <atom unit="g/mole" value="28.9765"/> - </isotope> - <isotope N="30" Z="14" name="Si300x3241f90"> - <atom unit="g/mole" value="29.9738"/> - </isotope> - <element name="Si0x3241cd0"> - <fraction n="0.922296077703922" ref="Si280x3241f00"/> - <fraction n="0.0468319531680468" ref="Si290x3241ab0"/> - <fraction n="0.0308719691280309" ref="Si300x3241f90"/> - </element> - <material name="BelleIIAerogel10x32c8d50" state="solid"> - <property name="RINDEX" ref="RINDEX0x32ccdb0"/> - <property name="GROUPVEL" ref="GROUPVEL0x32cd090"/> - <property name="RAYLEIGH" ref="RAYLEIGH0x32d0160"/> - <property name="ABSLENGTH" ref="ABSLENGTH0x32ce2a0"/> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="119.057215163865"/> - <D unit="g/cm3" value="0.16"/> - <fraction n="0.48" ref="O0x32418e0"/> - <fraction n="0.01" ref="H0x3241010"/> - <fraction n="0.45" ref="Si0x3241cd0"/> - <fraction n="0.06" ref="C0x3241360"/> - </material> - <material name="Absorber0x32dc7b0" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="81"/> - <D unit="g/cm3" value="1"/> - <fraction n="1" ref="C0x3241360"/> - </material> - <material name="Acrylic0x32d5ab0" state="solid"> - <property name="RINDEX" ref="RINDEX0x32d9110"/> - <property name="GROUPVEL" ref="GROUPVEL0x32d94f0"/> - <property name="RAYLEIGH" ref="RAYLEIGH0x32da170"/> - <property name="ABSLENGTH" ref="ABSLENGTH0x32d84d0"/> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="68.6088807971963"/> - <D unit="g/cm3" value="1.18"/> - <fraction n="0.599841070879962" ref="C0x3241360"/> - <fraction n="0.319617088375753" ref="O0x32418e0"/> - <fraction n="0.0805418407442843" ref="H0x3241010"/> - </material> - <material name="HalfInchHoneyconb0x32dea40" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="81"/> - <D unit="g/cm3" value="0.158640127581702"/> - <fraction n="1" ref="C0x3241360"/> - </material> - <material name="CarbonFiber0x32df220" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="81"/> - <D unit="g/cm3" value="1.82465972504254"/> - <fraction n="1" ref="C0x3241360"/> - </material> - <isotope N="14" Z="7" name="N140x32418a0"> - <atom unit="g/mole" value="14.0031"/> - </isotope> - <isotope N="15" Z="7" name="N150x3241510"> - <atom unit="g/mole" value="15.0001"/> - </isotope> - <element name="N0x3241670"> - <fraction n="0.99632" ref="N140x32418a0"/> - <fraction n="0.00368" ref="N150x3241510"/> - </element> - <material name="Nitrogen0x3255cc0" state="gas"> - <property name="RINDEX" ref="RINDEX0x32574d0"/> - <property name="GROUPVEL" ref="GROUPVEL0x3257bf0"/> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="82"/> - <D unit="g/cm3" value="0.00125"/> - <fraction n="1" ref="N0x3241670"/> - </material> - <material name="FusedSilica0x3258030" state="solid"> - <property name="RINDEX" ref="RINDEX0x3259560"/> - <property name="GROUPVEL" ref="GROUPVEL0x3259e20"/> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="125.663004061076"/> - <D unit="g/cm3" value="2.2"/> - <fraction n="0.467433841791527" ref="Si0x3241cd0"/> - <fraction n="0.532566158208473" ref="O0x32418e0"/> - </material> - <isotope N="27" Z="13" name="Al270x3242230"> - <atom unit="g/mole" value="26.9815"/> - </isotope> - <element name="Al0x3242000"> - <fraction n="1" ref="Al270x3242230"/> - </element> - <isotope N="40" Z="20" name="Ca400x32424c0"> - <atom unit="g/mole" value="39.9626"/> - </isotope> - <isotope N="42" Z="20" name="Ca420x32421a0"> - <atom unit="g/mole" value="41.9586"/> - </isotope> - <isotope N="43" Z="20" name="Ca430x3242500"> - <atom unit="g/mole" value="42.9588"/> - </isotope> - <isotope N="44" Z="20" name="Ca440x32425a0"> - <atom unit="g/mole" value="43.9555"/> - </isotope> - <isotope N="46" Z="20" name="Ca460x3241c40"> - <atom unit="g/mole" value="45.9537"/> - </isotope> - <isotope N="48" Z="20" name="Ca480x32426f0"> - <atom unit="g/mole" value="47.9525"/> - </isotope> - <element name="Ca0x3242290"> - <fraction n="0.96941" ref="Ca400x32424c0"/> - <fraction n="0.00647" ref="Ca420x32421a0"/> - <fraction n="0.00135" ref="Ca430x3242500"/> - <fraction n="0.02086" ref="Ca440x32425a0"/> - <fraction n="4e-05" ref="Ca460x3241c40"/> - <fraction n="0.00187" ref="Ca480x32426f0"/> - </element> - <material name="Ceramic0x32dc4f0" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="123.32449358718"/> - <D unit="g/cm3" value="3.1"/> - <fraction n="0.5485" ref="O0x32418e0"/> - <fraction n="0.3009" ref="Al0x3242000"/> - <fraction n="0.0886" ref="Si0x3241cd0"/> - <fraction n="0.062" ref="Ca0x3242290"/> - </material> - <isotope N="107" Z="47" name="Ag1070x3252b20"> - <atom unit="g/mole" value="106.905"/> - </isotope> - <isotope N="109" Z="47" name="Ag1090x3252b90"> - <atom unit="g/mole" value="108.905"/> - </isotope> - <element name="Ag0x32528c0"> - <fraction n="0.51839" ref="Ag1070x3252b20"/> - <fraction n="0.48161" ref="Ag1090x3252b90"/> - </element> - <material name="G4_Ag0x32527d0" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="470"/> - <D unit="g/cm3" value="10.5"/> - <fraction n="1" ref="Ag0x32528c0"/> - </material> - <isotope N="23" Z="11" name="Na230x3242990"> - <atom unit="g/mole" value="22.9898"/> - </isotope> - <element name="Na0x3242730"> - <fraction n="1" ref="Na230x3242990"/> - </element> - <isotope N="39" Z="19" name="K390x3242c30"> - <atom unit="g/mole" value="38.9637"/> - </isotope> - <isotope N="40" Z="19" name="K400x3242920"> - <atom unit="g/mole" value="39.964"/> - </isotope> - <isotope N="41" Z="19" name="K410x3242cc0"> - <atom unit="g/mole" value="40.9618"/> - </isotope> - <element name="K0x3242d30"> - <fraction n="0.932581" ref="K390x3242c30"/> - <fraction n="0.000117" ref="K400x3242920"/> - <fraction n="0.067302" ref="K410x3242cc0"/> - </element> - <isotope N="121" Z="51" name="Sb1210x3247a80"> - <atom unit="g/mole" value="120.904"/> - </isotope> - <isotope N="123" Z="51" name="Sb1230x3247b10"> - <atom unit="g/mole" value="122.904"/> - </isotope> - <element name="Sb0x32429d0"> - <fraction n="0.5721" ref="Sb1210x3247a80"/> - <fraction n="0.4279" ref="Sb1230x3247b10"/> - </element> - <material name="Bialkali0x32da6f0" state="solid"> - <property name="RINDEX" ref="RINDEX0x32db990"/> - <property name="GROUPVEL" ref="GROUPVEL0x32dc0b0"/> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="302.073738954529"/> - <D unit="g/cm3" value="1"/> - <fraction n="0.222297973339624" ref="Na0x3242730"/> - <fraction n="0.189028859120033" ref="K0x3242d30"/> - <fraction n="0.588673167540343" ref="Sb0x32429d0"/> - </material> - <material name="FR40x32dfa00" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="81"/> - <D unit="g/cm3" value="2.20087822505131"/> - <fraction n="1" ref="C0x3241360"/> - </material> - <material name="G4_Si0x3255300" state="solid"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="173"/> - <D unit="g/cm3" value="2.33"/> - <fraction n="1" ref="Si0x3241cd0"/> - </material> - <material name="Air0x32559d0" state="gas"> - <T unit="K" value="293.15"/> - <MEE unit="eV" value="85.7025566408487"/> - <D unit="g/cm3" value="0.00129"/> - <fraction n="0.7" ref="N0x3241670"/> - <fraction n="0.3" ref="O0x32418e0"/> - </material> - </materials> - - <solids> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x332ee20" rmax="65.016" rmin="0" startphi="0" z="6.35"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x332ef00" rmax="34.716" rmin="0" startphi="0" z="6.35"/> - <union name="Tmp0x332f1c0"> - <first ref="FlangeEpipe0x332ee20"/> - <second ref="FlangeHpipe0x332ef00"/> - <position name="Tmp0x332f1c0_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x332efe0" phi="0" theta="0" x1="116.238315670544" x2="62.0667122987972" x3="116.238315670544" x4="62.0667122987972" y1="54.0187869822485" y2="54.0187869822485" z="6.35"/> - <union name="Tmp0x332f3b0"> - <first ref="Tmp0x332f1c0"/> - <second ref="FlangeWedge0x332efe0"/> - <position name="Tmp0x332f3b0_pos" unit="mm" x="-56.1511804733728" y="0" z="0"/> - <rotation name="Tmp0x332f3b0_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x332f700" rmax="57.65" rmin="0" startphi="0" z="7.35"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x332f810" rmax="27.35" rmin="0" startphi="0" z="7.35"/> - <union name="Tmp0x332fb60"> - <first ref="FlangeEpipe0x332f700"/> - <second ref="FlangeHpipe0x332f810"/> - <position name="Tmp0x332fb60_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x332f920" phi="0" theta="0" x1="103.069073741954" x2="48.8974703702069" x3="103.069073741954" x4="48.8974703702069" y1="54.0187869822485" y2="54.0187869822485" z="7.35"/> - <union name="Tmp0x332fc70"> - <first ref="Tmp0x332fb60"/> - <second ref="FlangeWedge0x332f920"/> - <position name="Tmp0x332fc70_pos" unit="mm" x="-52.8495562130177" y="0" z="0"/> - <rotation name="Tmp0x332fc70_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="InnerWallAluRing0x332ff70"> - <first ref="Tmp0x332f3b0"/> - <second ref="Tmp0x332fc70"/> - </subtraction> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x32e8760" rmax="65.016" rmin="0" startphi="0" z="481.134"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x32e8870" rmax="34.716" rmin="0" startphi="0" z="481.134"/> - <union name="Tmp0x32e8bc0"> - <first ref="FlangeEpipe0x32e8760"/> - <second ref="FlangeHpipe0x32e8870"/> - <position name="Tmp0x32e8bc0_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x32e8980" phi="0" theta="0" x1="116.238315670544" x2="62.0667122987972" x3="116.238315670544" x4="62.0667122987972" y1="54.0187869822485" y2="54.0187869822485" z="481.134"/> - <union name="Tmp0x32e8db0"> - <first ref="Tmp0x32e8bc0"/> - <second ref="FlangeWedge0x32e8980"/> - <position name="Tmp0x32e8db0_pos" unit="mm" x="-56.1511804733728" y="0" z="0"/> - <rotation name="Tmp0x32e8db0_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x32e90e0" rmax="57.65" rmin="0" startphi="0" z="482.134"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x32e91f0" rmax="27.35" rmin="0" startphi="0" z="482.134"/> - <union name="Tmp0x32e9540"> - <first ref="FlangeEpipe0x32e90e0"/> - <second ref="FlangeHpipe0x32e91f0"/> - <position name="Tmp0x32e9540_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x32e9300" phi="0" theta="0" x1="103.069073741954" x2="48.8974703702069" x3="103.069073741954" x4="48.8974703702069" y1="54.0187869822485" y2="54.0187869822485" z="482.134"/> - <union name="Tmp0x32e9650"> - <first ref="Tmp0x32e9540"/> - <second ref="FlangeWedge0x32e9300"/> - <position name="Tmp0x32e9650_pos" unit="mm" x="-52.8495562130177" y="0" z="0"/> - <rotation name="Tmp0x32e9650_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="InnerWall0x32e9950"> - <first ref="Tmp0x32e8db0"/> - <second ref="Tmp0x32e9650"/> - </subtraction> - <tube aunit="deg" deltaphi="39.8220003646385" lunit="mm" name="Tmp0x334e260" rmax="253.438666666667" rmin="67.016" startphi="0" z="20"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x297c980" rmax="66.016" rmin="0" startphi="0" z="485.134"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x297ca90" rmax="35.716" rmin="0" startphi="0" z="485.134"/> - <union name="Tmp0x334dd50"> - <first ref="FlangeEpipe0x297c980"/> - <second ref="FlangeHpipe0x297ca90"/> - <position name="Tmp0x334dd50_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x334db10" phi="0" theta="0" x1="118.026157365981" x2="63.8545539942344" x3="118.026157365981" x4="63.8545539942344" y1="54.0187869822485" y2="54.0187869822485" z="485.134"/> - <union name="Tmp0x334df40"> - <first ref="Tmp0x334dd50"/> - <second ref="FlangeWedge0x334db10"/> - <position name="Tmp0x334df40_pos" unit="mm" x="-56.5994053254438" y="0" z="0"/> - <rotation name="Tmp0x334df40_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="BelleIIAerogel1-0-000x334e5e0"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - </subtraction> - <tube aunit="deg" deltaphi="0.177999635361492" lunit="mm" name="Tmp0x334e370" rmax="253.438666666667" rmin="67.016" startphi="39.8220003646385" z="20"/> - <subtraction name="A-Spacer--0-000x334e970"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-010x334f4a0"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-010x334f4a0_rot" unit="deg" x="0" y="0" z="40"/> - </subtraction> - <subtraction name="A-Spacer--0-010x334f7d0"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-010x334f7d0_rot" unit="deg" x="0" y="0" z="40"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-020x297cba0"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-020x297cba0_rot" unit="deg" x="0" y="0" z="80"/> - </subtraction> - <subtraction name="A-Spacer--0-020x32e0360"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-020x32e0360_rot" unit="deg" x="0" y="0" z="80"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-030x3351a10"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-030x3351a10_rot" unit="deg" x="0" y="0" z="120"/> - </subtraction> - <subtraction name="A-Spacer--0-030x3351d40"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-030x3351d40_rot" unit="deg" x="0" y="0" z="120"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-040x33522e0"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-040x33522e0_rot" unit="deg" x="0" y="0" z="160"/> - </subtraction> - <subtraction name="A-Spacer--0-040x3352610"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-040x3352610_rot" unit="deg" x="0" y="0" z="160"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-050x3352b90"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-050x3352b90_rot" unit="deg" x="0" y="0" z="-160"/> - </subtraction> - <subtraction name="A-Spacer--0-050x3352ec0"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-050x3352ec0_rot" unit="deg" x="0" y="0" z="-160"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-060x3353420"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-060x3353420_rot" unit="deg" x="0" y="0" z="-120"/> - </subtraction> - <subtraction name="A-Spacer--0-060x3353750"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-060x3353750_rot" unit="deg" x="0" y="0" z="-120"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-070x3353cb0"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-070x3353cb0_rot" unit="deg" x="0" y="0" z="-80"/> - </subtraction> - <subtraction name="A-Spacer--0-070x3353fe0"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-070x3353fe0_rot" unit="deg" x="0" y="0" z="-80"/> - </subtraction> - <subtraction name="BelleIIAerogel1-0-080x33545c0"> - <first ref="Tmp0x334e260"/> - <second ref="Tmp0x334df40"/> - <rotation name="BelleIIAerogel1-0-080x33545c0_rot" unit="deg" x="0" y="0" z="-40"/> - </subtraction> - <subtraction name="A-Spacer--0-080x33548f0"> - <first ref="Tmp0x334e370"/> - <second ref="Tmp0x334df40"/> - <rotation name="A-Spacer--0-080x33548f0_rot" unit="deg" x="0" y="0" z="-40"/> - </subtraction> - <tube aunit="deg" deltaphi="25.632026615449" lunit="mm" name="BelleIIAerogel1-1-000x3354e40" rmax="440.361333333333" rmin="253.938666666667" startphi="0" z="20"/> - <tube aunit="deg" deltaphi="0.0822590988367624" lunit="mm" name="A-Spacer--1-000x3354f50" rmax="440.361333333333" rmin="253.938666666667" startphi="25.632026615449" z="20"/> - <tube aunit="deg" deltaphi="17.9465189406057" lunit="mm" name="BelleIIAerogel1-2-000x3358d30" rmax="627.284" rmin="440.861333333333" startphi="0" z="20"/> - <tube aunit="deg" deltaphi="0.0534810593943467" lunit="mm" name="A-Spacer--2-000x3358e40" rmax="627.284" rmin="440.861333333333" startphi="17.9465189406057" z="20"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="Tmp0x334e7f0" rmax="67.016" rmin="66.016" startphi="0" z="20"/> - <subtraction name="R-Spacer--0-000x334e520"> - <first ref="Tmp0x334e7f0"/> - <second ref="Tmp0x334df40"/> - </subtraction> - <tube aunit="deg" deltaphi="360" lunit="mm" name="R-Spacer--1-000x335eb50" rmax="253.938666666667" rmin="253.438666666667" startphi="0" z="20"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="R-Spacer--2-000x335ee00" rmax="440.861333333333" rmin="440.361333333333" startphi="0" z="20"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="R-Spacer--3-000x32e69b0" rmax="628.284" rmin="627.284" startphi="0" z="20"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="Tmp0x335e740" rmax="628.284" rmin="66.016" startphi="0" z="3"/> - <subtraction name="Acrylic0x335f6d0"> - <first ref="Tmp0x335e740"/> - <second ref="Tmp0x334df40"/> - </subtraction> - <cone aunit="deg" deltaphi="360" lunit="mm" name="InnerMirror0x33602c0" rmax1="66.016" rmax2="120" rmin1="58.65" rmin2="112.634" startphi="0" z="453.134"/> - <subtraction name="InnerMirror0x33603e0"> - <first ref="InnerMirror0x33602c0"/> - <second ref="Tmp0x334df40"/> - </subtraction> - <cone aunit="deg" deltaphi="360" lunit="mm" name="OuterMirror0x3361f50" rmax1="642" rmax2="553.716" rmin1="628.284" rmin2="540" startphi="0" z="453.134"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="GasVolume0x32e7a20" rmax="629.284" rmin="0" startphi="0" z="484.134"/> - <intersection name="OuterMirror0x3362070"> - <first ref="OuterMirror0x3361f50"/> - <second ref="GasVolume0x32e7a20"/> - </intersection> - <box lunit="mm" name="Dummy0x3367fa0" x="121.5" y="121.5" z="3"/> - <box lunit="mm" name="Dummy0x3368030" x="109.5" y="109.5" z="3.02"/> - <subtraction name="SupportGridBar0x33680c0"> - <first ref="Dummy0x3367fa0"/> - <second ref="Dummy0x3368030"/> - </subtraction> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x32e7b60" rmax="57.65" rmin="0" startphi="0" z="485.134"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x32e7c70" rmax="27.35" rmin="0" startphi="0" z="485.134"/> - <union name="Tmp0x32e7fc0"> - <first ref="FlangeEpipe0x32e7b60"/> - <second ref="FlangeHpipe0x32e7c70"/> - <position name="Tmp0x32e7fc0_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x32e7d80" phi="0" theta="0" x1="103.069073741954" x2="48.8974703702069" x3="103.069073741954" x4="48.8974703702069" y1="54.0187869822485" y2="54.0187869822485" z="485.134"/> - <union name="Tmp0x32e81b0"> - <first ref="Tmp0x32e7fc0"/> - <second ref="FlangeWedge0x32e7d80"/> - <position name="Tmp0x32e81b0_pos" unit="mm" x="-52.8495562130177" y="0" z="0"/> - <rotation name="Tmp0x32e81b0_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="GasVolume0x32e84b0"> - <first ref="GasVolume0x32e7a20"/> - <second ref="Tmp0x32e81b0"/> - </subtraction> - <opticalsurface finish="0" model="1" name="InnerMirror0x33609b0" type="0" value="0"> - <property name="REFLECTIVITY" ref="REFLECTIVITY0x33615e0"/> - </opticalsurface> - <opticalsurface finish="0" model="1" name="OuterMirror0x33625f0" type="0" value="0"> - <property name="REFLECTIVITY" ref="REFLECTIVITY0x3363220"/> - </opticalsurface> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x3331050" rmax="64" rmin="0" startphi="0" z="7.366"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x3331160" rmax="33.7" rmin="0" startphi="0" z="7.366"/> - <union name="Tmp0x33314b0"> - <first ref="FlangeEpipe0x3331050"/> - <second ref="FlangeHpipe0x3331160"/> - <position name="Tmp0x33314b0_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x3331270" phi="0" theta="0" x1="114.42186850798" x2="60.2502651362331" x3="114.42186850798" x4="60.2502651362331" y1="54.0187869822485" y2="54.0187869822485" z="7.366"/> - <union name="Tmp0x33316a0"> - <first ref="Tmp0x33314b0"/> - <second ref="FlangeWedge0x3331270"/> - <position name="Tmp0x33316a0_pos" unit="mm" x="-55.6957840236686" y="0" z="0"/> - <rotation name="Tmp0x33316a0_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x33319e0" rmax="57.65" rmin="0" startphi="0" z="8.366"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x3331af0" rmax="27.35" rmin="0" startphi="0" z="8.366"/> - <union name="Tmp0x3331e40"> - <first ref="FlangeEpipe0x33319e0"/> - <second ref="FlangeHpipe0x3331af0"/> - <position name="Tmp0x3331e40_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x3331c00" phi="0" theta="0" x1="103.069073741954" x2="48.8974703702069" x3="103.069073741954" x4="48.8974703702069" y1="54.0187869822485" y2="54.0187869822485" z="8.366"/> - <union name="Tmp0x3331f50"> - <first ref="Tmp0x3331e40"/> - <second ref="FlangeWedge0x3331c00"/> - <position name="Tmp0x3331f50_pos" unit="mm" x="-52.8495562130177" y="0" z="0"/> - <rotation name="Tmp0x3331f50_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="FrontWallAluRing10x3332250"> - <first ref="Tmp0x33316a0"/> - <second ref="Tmp0x3331f50"/> - </subtraction> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FrontWallAluRing20x3332530" rmax="643" rmin="630.3" startphi="0" z="7.366"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FrontWall0x3330310" rmax="643" rmin="0" startphi="0" z="7.366"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x3330450" rmax="57.65" rmin="0" startphi="0" z="8.366"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x3330560" rmax="27.35" rmin="0" startphi="0" z="8.366"/> - <union name="Tmp0x33308b0"> - <first ref="FlangeEpipe0x3330450"/> - <second ref="FlangeHpipe0x3330560"/> - <position name="Tmp0x33308b0_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x3330670" phi="0" theta="0" x1="103.069073741954" x2="48.8974703702069" x3="103.069073741954" x4="48.8974703702069" y1="54.0187869822485" y2="54.0187869822485" z="8.366"/> - <union name="Tmp0x3330aa0"> - <first ref="Tmp0x33308b0"/> - <second ref="FlangeWedge0x3330670"/> - <position name="Tmp0x3330aa0_pos" unit="mm" x="-52.8495562130177" y="0" z="0"/> - <rotation name="Tmp0x3330aa0_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="FrontWall0x3330da0"> - <first ref="FrontWall0x3330310"/> - <second ref="Tmp0x3330aa0"/> - </subtraction> - <tube aunit="deg" deltaphi="360" lunit="mm" name="OuterWallAluRing0x3332b10" rmax="643" rmin="629.284" startphi="0" z="12.7"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="OuterWall0x3332820" rmax="643" rmin="629.284" startphi="0" z="484.134"/> - <box lunit="mm" name="QuartzWindow0x3363d20" x="120" y="120" z="5"/> - <opticalsurface finish="3" model="1" name="WindowMetallization0x3365490" type="0" value="0.05"> - <property name="REFLECTIVITY" ref="REFLECTIVITY0x3366850"/> - <property name="SPECULARLOBECONSTANT" ref="SPECULARLOBECONSTANT0x3366100"/> - </opticalsurface> - <box lunit="mm" name="CeramicBox0x3364420" x="120" y="120" z="9"/> - <box lunit="mm" name="CeramicCut0x33644b0" x="114" y="114" z="9"/> - <subtraction name="CeramicBody0x3364540"> - <first ref="CeramicBox0x3364420"/> - <second ref="CeramicCut0x33644b0"/> - <position name="CeramicBody0x3364540_pos" unit="mm" x="0" y="0" z="-3"/> - </subtraction> - <box lunit="mm" name="Plating0x33648d0" x="114" y="114" z="0.06"/> - <box lunit="mm" name="MCP0x3364a60" x="114" y="114" z="0.36"/> - <box lunit="mm" name="PhotoDetector0x3364f10" x="108" y="108" z="0.01"/> - <box lunit="mm" name="PCB0x3364bf0" x="112" y="112" z="2"/> - <box lunit="mm" name="ASIC0x3364d80" x="16" y="16" z="1"/> - <box lunit="mm" name="HRPPD0x3363b90" x="120" y="120" z="30"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="AluFrame0x3366f80" rmax="643" rmin="0" startphi="0" z="9.7"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x33670c0" rmax="57.65" rmin="0" startphi="0" z="10.7"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x33671d0" rmax="27.35" rmin="0" startphi="0" z="10.7"/> - <union name="Tmp0x33674d0"> - <first ref="FlangeEpipe0x33670c0"/> - <second ref="FlangeHpipe0x33671d0"/> - <position name="Tmp0x33674d0_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x33672e0" phi="0" theta="0" x1="103.069073741954" x2="48.8974703702069" x3="103.069073741954" x4="48.8974703702069" y1="54.0187869822485" y2="54.0187869822485" z="10.7"/> - <union name="Tmp0x33676c0"> - <first ref="Tmp0x33674d0"/> - <second ref="FlangeWedge0x33672e0"/> - <position name="Tmp0x33676c0_pos" unit="mm" x="-52.8495562130177" y="0" z="0"/> - <rotation name="Tmp0x33676c0_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="AluFrame0x33679c0"> - <first ref="AluFrame0x3366f80"/> - <second ref="Tmp0x33676c0"/> - </subtraction> - <box lunit="mm" name="AluWndCut0x3367ad0" x="120.5" y="120.5" z="11.7"/> - <subtraction name="AluFrame0x3367b60"> - <first ref="AluFrame0x33679c0"/> - <second ref="AluWndCut0x3367ad0"/> - </subtraction> - <subtraction name="AluFrame0x3367d80"> - <first ref="AluFrame0x3367b60"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3367d80_pos" unit="mm" x="-40" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33686a0"> - <first ref="AluFrame0x3367d80"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33686a0_pos" unit="mm" x="-526" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x281ca00"> - <first ref="AluFrame0x33686a0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x281ca00_pos" unit="mm" x="-404.5" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3374b00"> - <first ref="AluFrame0x281ca00"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3374b00_pos" unit="mm" x="-283" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3375a00"> - <first ref="AluFrame0x3374b00"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3375a00_pos" unit="mm" x="-161.5" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33766b0"> - <first ref="AluFrame0x3375a00"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33766b0_pos" unit="mm" x="121.5" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3377410"> - <first ref="AluFrame0x33766b0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3377410_pos" unit="mm" x="243" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33780e0"> - <first ref="AluFrame0x3377410"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33780e0_pos" unit="mm" x="364.5" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3378d90"> - <first ref="AluFrame0x33780e0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3378d90_pos" unit="mm" x="486" y="0" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3379a40"> - <first ref="AluFrame0x3378d90"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3379a40_pos" unit="mm" x="-486" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x337a760"> - <first ref="AluFrame0x3379a40"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x337a760_pos" unit="mm" x="-364.5" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x337b480"> - <first ref="AluFrame0x337a760"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x337b480_pos" unit="mm" x="-243" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x337c130"> - <first ref="AluFrame0x337b480"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x337c130_pos" unit="mm" x="-121.5" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x337cde0"> - <first ref="AluFrame0x337c130"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x337cde0_pos" unit="mm" x="0" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33771b0"> - <first ref="AluFrame0x337cde0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33771b0_pos" unit="mm" x="121.5" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x337ed70"> - <first ref="AluFrame0x33771b0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x337ed70_pos" unit="mm" x="243" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x337fa20"> - <first ref="AluFrame0x337ed70"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x337fa20_pos" unit="mm" x="364.5" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33806d0"> - <first ref="AluFrame0x337fa20"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33806d0_pos" unit="mm" x="486" y="121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3381580"> - <first ref="AluFrame0x33806d0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3381580_pos" unit="mm" x="-486" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3382250"> - <first ref="AluFrame0x3381580"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3382250_pos" unit="mm" x="-364.5" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3382f00"> - <first ref="AluFrame0x3382250"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3382f00_pos" unit="mm" x="-243" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3383950"> - <first ref="AluFrame0x3382f00"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3383950_pos" unit="mm" x="-121.5" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3384b70"> - <first ref="AluFrame0x3383950"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3384b70_pos" unit="mm" x="0" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3385820"> - <first ref="AluFrame0x3384b70"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3385820_pos" unit="mm" x="121.5" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33864d0"> - <first ref="AluFrame0x3385820"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33864d0_pos" unit="mm" x="243" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3387180"> - <first ref="AluFrame0x33864d0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3387180_pos" unit="mm" x="364.5" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3387e30"> - <first ref="AluFrame0x3387180"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3387e30_pos" unit="mm" x="486" y="-121.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3388ae0"> - <first ref="AluFrame0x3387e30"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3388ae0_pos" unit="mm" x="-486" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3389790"> - <first ref="AluFrame0x3388ae0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3389790_pos" unit="mm" x="-364.5" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x338a440"> - <first ref="AluFrame0x3389790"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x338a440_pos" unit="mm" x="-243" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x337e000"> - <first ref="AluFrame0x338a440"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x337e000_pos" unit="mm" x="-121.5" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x338bea0"> - <first ref="AluFrame0x337e000"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x338bea0_pos" unit="mm" x="0" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x338cb50"> - <first ref="AluFrame0x338bea0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x338cb50_pos" unit="mm" x="121.5" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x338d800"> - <first ref="AluFrame0x338cb50"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x338d800_pos" unit="mm" x="243" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x338e6d0"> - <first ref="AluFrame0x338d800"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x338e6d0_pos" unit="mm" x="364.5" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x338f590"> - <first ref="AluFrame0x338e6d0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x338f590_pos" unit="mm" x="486" y="243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3390620"> - <first ref="AluFrame0x338f590"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3390620_pos" unit="mm" x="-486" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33912f0"> - <first ref="AluFrame0x3390620"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33912f0_pos" unit="mm" x="-364.5" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3391fa0"> - <first ref="AluFrame0x33912f0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3391fa0_pos" unit="mm" x="-243" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3392c50"> - <first ref="AluFrame0x3391fa0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3392c50_pos" unit="mm" x="-121.5" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3393900"> - <first ref="AluFrame0x3392c50"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3393900_pos" unit="mm" x="0" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33945b0"> - <first ref="AluFrame0x3393900"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33945b0_pos" unit="mm" x="121.5" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3395260"> - <first ref="AluFrame0x33945b0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3395260_pos" unit="mm" x="243" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3395f10"> - <first ref="AluFrame0x3395260"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3395f10_pos" unit="mm" x="364.5" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3397000"> - <first ref="AluFrame0x3395f10"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3397000_pos" unit="mm" x="486" y="-243" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3397ec0"> - <first ref="AluFrame0x3397000"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3397ec0_pos" unit="mm" x="-364.5" y="364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3398910"> - <first ref="AluFrame0x3397ec0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3398910_pos" unit="mm" x="-243" y="364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x3399e50"> - <first ref="AluFrame0x3398910"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x3399e50_pos" unit="mm" x="-121.5" y="364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x339ab00"> - <first ref="AluFrame0x3399e50"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x339ab00_pos" unit="mm" x="0" y="364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x339b7b0"> - <first ref="AluFrame0x339ab00"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x339b7b0_pos" unit="mm" x="121.5" y="364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x339c460"> - <first ref="AluFrame0x339b7b0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x339c460_pos" unit="mm" x="243" y="364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x339d110"> - <first ref="AluFrame0x339c460"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x339d110_pos" unit="mm" x="364.5" y="364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x339ddc0"> - <first ref="AluFrame0x339d110"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x339ddc0_pos" unit="mm" x="-364.5" y="-364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x339ea70"> - <first ref="AluFrame0x339ddc0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x339ea70_pos" unit="mm" x="-243" y="-364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x339f720"> - <first ref="AluFrame0x339ea70"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x339f720_pos" unit="mm" x="-121.5" y="-364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a03d0"> - <first ref="AluFrame0x339f720"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a03d0_pos" unit="mm" x="0" y="-364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a1080"> - <first ref="AluFrame0x33a03d0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a1080_pos" unit="mm" x="121.5" y="-364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a1d30"> - <first ref="AluFrame0x33a1080"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a1d30_pos" unit="mm" x="243" y="-364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a29e0"> - <first ref="AluFrame0x33a1d30"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a29e0_pos" unit="mm" x="364.5" y="-364.5" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a3690"> - <first ref="AluFrame0x33a29e0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a3690_pos" unit="mm" x="-243" y="486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a4340"> - <first ref="AluFrame0x33a3690"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a4340_pos" unit="mm" x="-121.5" y="486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a4ff0"> - <first ref="AluFrame0x33a4340"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a4ff0_pos" unit="mm" x="0" y="486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a5a70"> - <first ref="AluFrame0x33a4ff0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a5a70_pos" unit="mm" x="121.5" y="486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a6b70"> - <first ref="AluFrame0x33a5a70"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a6b70_pos" unit="mm" x="243" y="486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a7820"> - <first ref="AluFrame0x33a6b70"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a7820_pos" unit="mm" x="-243" y="-486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a84d0"> - <first ref="AluFrame0x33a7820"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a84d0_pos" unit="mm" x="-121.5" y="-486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33a99a0"> - <first ref="AluFrame0x33a84d0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33a99a0_pos" unit="mm" x="0" y="-486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33aa650"> - <first ref="AluFrame0x33a99a0"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33aa650_pos" unit="mm" x="121.5" y="-486" z="0"/> - </subtraction> - <subtraction name="AluFrame0x33ab300"> - <first ref="AluFrame0x33aa650"/> - <second ref="AluWndCut0x3367ad0"/> - <position name="AluFrame0x33ab300_pos" unit="mm" x="243" y="-486" z="0"/> - </subtraction> - <tube aunit="deg" deltaphi="360" lunit="mm" name="PFRICH0x32e6ce0" rmax="643" rmin="0" startphi="0" z="541.5"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeEpipe0x32e6e20" rmax="57.65" rmin="0" startphi="0" z="542.5"/> - <tube aunit="deg" deltaphi="360" lunit="mm" name="FlangeHpipe0x32e6f30" rmax="27.35" rmin="0" startphi="0" z="542.5"/> - <union name="Tmp0x32e7230"> - <first ref="FlangeEpipe0x32e6e20"/> - <second ref="FlangeHpipe0x32e6f30"/> - <position name="Tmp0x32e7230_pos" unit="mm" x="-67.6" y="0" z="0"/> - </union> - <trap alpha1="0" alpha2="0" aunit="deg" lunit="mm" name="FlangeWedge0x32e7040" phi="0" theta="0" x1="103.069073741954" x2="48.8974703702069" x3="103.069073741954" x4="48.8974703702069" y1="54.0187869822485" y2="54.0187869822485" z="542.5"/> - <union name="Tmp0x32e7420"> - <first ref="Tmp0x32e7230"/> - <second ref="FlangeWedge0x32e7040"/> - <position name="Tmp0x32e7420_pos" unit="mm" x="-52.8495562130177" y="0" z="0"/> - <rotation name="Tmp0x32e7420_rot" unit="deg" x="0" y="0" z="90"/> - </union> - <subtraction name="PFRICH0x32e7720"> - <first ref="PFRICH0x32e6ce0"/> - <second ref="Tmp0x32e7420"/> - </subtraction> - <tube aunit="deg" deltaphi="360" lunit="mm" name="PFRICH_World0x32dc1f0" rmax="950" rmin="0" startphi="0" z="5000"/> - </solids> - - <structure> - <volume name="InnerWallAluRing0x33300c0"> - <materialref ref="G4_Al0x3247b70"/> - <solidref ref="InnerWallAluRing0x332ff70"/> - </volume> - <volume name="InnerWall0x32e9a60"> - <materialref ref="QuarterInchHoneycomb0x32de250"/> - <solidref ref="InnerWall0x32e9950"/> - <physvol name="InnerWallAluRing0x33301d0"> - <volumeref ref="InnerWallAluRing0x33300c0"/> - <position name="InnerWallAluRing0x33301d0_pos" unit="mm" x="0" y="0" z="-237.392"/> - </physvol> - <physvol copynumber="1" name="InnerWallAluRing0x3330250"> - <volumeref ref="InnerWallAluRing0x33300c0"/> - <position name="InnerWallAluRing0x3330250_pos" unit="mm" x="0" y="0" z="237.392"/> - </physvol> - </volume> - <volume name="BelleIIAerogel1-0-000x334e720"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-000x334e5e0"/> - </volume> - <volume name="A-Spacer--0-000x334eb90"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-000x334e970"/> - </volume> - <volume name="BelleIIAerogel1-0-010x334f700"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-010x334f4a0"/> - </volume> - <volume name="A-Spacer--0-010x334f9f0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-010x334f7d0"/> - </volume> - <volume name="BelleIIAerogel1-0-020x32e0290"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-020x297cba0"/> - </volume> - <volume name="A-Spacer--0-020x33516e0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-020x32e0360"/> - </volume> - <volume name="BelleIIAerogel1-0-030x3351c70"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-030x3351a10"/> - </volume> - <volume name="A-Spacer--0-030x3351f60"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-030x3351d40"/> - </volume> - <volume name="BelleIIAerogel1-0-040x3352540"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-040x33522e0"/> - </volume> - <volume name="A-Spacer--0-040x3352830"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-040x3352610"/> - </volume> - <volume name="BelleIIAerogel1-0-050x3352df0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-050x3352b90"/> - </volume> - <volume name="A-Spacer--0-050x33530e0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-050x3352ec0"/> - </volume> - <volume name="BelleIIAerogel1-0-060x3353680"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-060x3353420"/> - </volume> - <volume name="A-Spacer--0-060x3353970"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-060x3353750"/> - </volume> - <volume name="BelleIIAerogel1-0-070x3353f10"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-070x3353cb0"/> - </volume> - <volume name="A-Spacer--0-070x3354200"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-070x3353fe0"/> - </volume> - <volume name="BelleIIAerogel1-0-080x3354820"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-0-080x33545c0"/> - </volume> - <volume name="A-Spacer--0-080x3354b10"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--0-080x33548f0"/> - </volume> - <volume name="BelleIIAerogel1-1-000x33550c0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x33551c0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3355500"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3355600"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3355940"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3355a40"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3355d80"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3355e80"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x33561c0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x33562c0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3356600"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3356700"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3356a40"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3356b40"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3356fb0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3357080"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3357450"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3357550"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3357890"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3357990"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3357cd0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3357dd0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3358110"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3358210"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3358550"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3358650"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-1-000x3358990"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-1-000x3354e40"/> - </volume> - <volume name="A-Spacer--1-000x3358a90"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--1-000x3354f50"/> - </volume> - <volume name="BelleIIAerogel1-2-000x3359000"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x3359100"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x3359440"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x3359540"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x3359880"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x3359980"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x3359cc0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x3359dc0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335a100"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335a200"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335a540"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335a640"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335a980"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335aa80"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335adc0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335aec0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335b200"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335b300"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x3356e80"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335b970"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335bda0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335bea0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335c1e0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335c2e0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335c620"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335c720"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335ca60"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335cb60"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335cea0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335cfa0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335d2e0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335d3e0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335d720"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335d820"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335db60"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335dc60"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335dfa0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335e0a0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="BelleIIAerogel1-2-000x335e3e0"> - <materialref ref="BelleIIAerogel10x32c8d50"/> - <solidref ref="BelleIIAerogel1-2-000x3358d30"/> - </volume> - <volume name="A-Spacer--2-000x335e4e0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="A-Spacer--2-000x3358e40"/> - </volume> - <volume name="R-Spacer--0-000x335e9b0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="R-Spacer--0-000x334e520"/> - </volume> - <volume name="R-Spacer--1-000x335ec60"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="R-Spacer--1-000x335eb50"/> - </volume> - <volume name="R-Spacer--2-000x335ef10"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="R-Spacer--2-000x335ee00"/> - </volume> - <volume name="R-Spacer--3-000x32e6ac0"> - <materialref ref="Absorber0x32dc7b0"/> - <solidref ref="R-Spacer--3-000x32e69b0"/> - </volume> - <volume name="Acrylic0x335f870"> - <materialref ref="Acrylic0x32d5ab0"/> - <solidref ref="Acrylic0x335f6d0"/> - </volume> - <volume name="InnerMirror0x3360600"> - <materialref ref="QuarterInchHoneycomb0x32de250"/> - <solidref ref="InnerMirror0x33603e0"/> - </volume> - <volume name="OuterMirror0x3362240"> - <materialref ref="HalfInchHoneyconb0x32dea40"/> - <solidref ref="OuterMirror0x3362070"/> - </volume> - <volume name="SupportGridBar0x3368180"> - <materialref ref="CarbonFiber0x32df220"/> - <solidref ref="SupportGridBar0x33680c0"/> - </volume> - <volume name="GasVolume0x32e85c0"> - <materialref ref="Nitrogen0x3255cc0"/> - <solidref ref="GasVolume0x32e84b0"/> - <physvol name="InnerWall0x32dfc70"> - <volumeref ref="InnerWall0x32e9a60"/> - <position name="InnerWall0x32dfc70_pos" unit="mm" x="0" y="0" z="-1.5"/> - </physvol> - <physvol name="BelleIIAerogel1-0-000x334f280"> - <volumeref ref="BelleIIAerogel1-0-000x334e720"/> - <position name="BelleIIAerogel1-0-000x334f280_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="A-Spacer--0-000x334f320"> - <volumeref ref="A-Spacer--0-000x334eb90"/> - <position name="A-Spacer--0-000x334f320_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="BelleIIAerogel1-0-010x334fb40"> - <volumeref ref="BelleIIAerogel1-0-010x334f700"/> - <position name="BelleIIAerogel1-0-010x334fb40_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-010x334fb40_rot" unit="deg" x="0" y="0" z="40"/> - </physvol> - <physvol name="A-Spacer--0-010x334fbe0"> - <volumeref ref="A-Spacer--0-010x334f9f0"/> - <position name="A-Spacer--0-010x334fbe0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-010x334fbe0_rot" unit="deg" x="0" y="0" z="40"/> - </physvol> - <physvol name="BelleIIAerogel1-0-020x3351820"> - <volumeref ref="BelleIIAerogel1-0-020x32e0290"/> - <position name="BelleIIAerogel1-0-020x3351820_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-020x3351820_rot" unit="deg" x="0" y="0" z="80"/> - </physvol> - <physvol name="A-Spacer--0-020x33518c0"> - <volumeref ref="A-Spacer--0-020x33516e0"/> - <position name="A-Spacer--0-020x33518c0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-020x33518c0_rot" unit="deg" x="0" y="0" z="80"/> - </physvol> - <physvol name="BelleIIAerogel1-0-030x33520b0"> - <volumeref ref="BelleIIAerogel1-0-030x3351c70"/> - <position name="BelleIIAerogel1-0-030x33520b0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-030x33520b0_rot" unit="deg" x="0" y="0" z="120"/> - </physvol> - <physvol name="A-Spacer--0-030x3352150"> - <volumeref ref="A-Spacer--0-030x3351f60"/> - <position name="A-Spacer--0-030x3352150_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-030x3352150_rot" unit="deg" x="0" y="0" z="120"/> - </physvol> - <physvol name="BelleIIAerogel1-0-040x33529d0"> - <volumeref ref="BelleIIAerogel1-0-040x3352540"/> - <position name="BelleIIAerogel1-0-040x33529d0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-040x33529d0_rot" unit="deg" x="0" y="0" z="160"/> - </physvol> - <physvol name="A-Spacer--0-040x3352a40"> - <volumeref ref="A-Spacer--0-040x3352830"/> - <position name="A-Spacer--0-040x3352a40_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-040x3352a40_rot" unit="deg" x="0" y="0" z="160"/> - </physvol> - <physvol name="BelleIIAerogel1-0-050x3353230"> - <volumeref ref="BelleIIAerogel1-0-050x3352df0"/> - <position name="BelleIIAerogel1-0-050x3353230_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-050x3353230_rot" unit="deg" x="0" y="0" z="-160"/> - </physvol> - <physvol name="A-Spacer--0-050x33532d0"> - <volumeref ref="A-Spacer--0-050x33530e0"/> - <position name="A-Spacer--0-050x33532d0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-050x33532d0_rot" unit="deg" x="0" y="0" z="-160"/> - </physvol> - <physvol name="BelleIIAerogel1-0-060x3353ac0"> - <volumeref ref="BelleIIAerogel1-0-060x3353680"/> - <position name="BelleIIAerogel1-0-060x3353ac0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-060x3353ac0_rot" unit="deg" x="0" y="0" z="-120"/> - </physvol> - <physvol name="A-Spacer--0-060x3353b60"> - <volumeref ref="A-Spacer--0-060x3353970"/> - <position name="A-Spacer--0-060x3353b60_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-060x3353b60_rot" unit="deg" x="0" y="0" z="-120"/> - </physvol> - <physvol name="BelleIIAerogel1-0-070x3354350"> - <volumeref ref="BelleIIAerogel1-0-070x3353f10"/> - <position name="BelleIIAerogel1-0-070x3354350_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-070x3354350_rot" unit="deg" x="0" y="0" z="-80"/> - </physvol> - <physvol name="A-Spacer--0-070x33543f0"> - <volumeref ref="A-Spacer--0-070x3354200"/> - <position name="A-Spacer--0-070x33543f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-070x33543f0_rot" unit="deg" x="0" y="0" z="-80"/> - </physvol> - <physvol name="BelleIIAerogel1-0-080x3354cf0"> - <volumeref ref="BelleIIAerogel1-0-080x3354820"/> - <position name="BelleIIAerogel1-0-080x3354cf0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-0-080x3354cf0_rot" unit="deg" x="0" y="0" z="-40"/> - </physvol> - <physvol name="A-Spacer--0-080x3354d90"> - <volumeref ref="A-Spacer--0-080x3354b10"/> - <position name="A-Spacer--0-080x3354d90_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--0-080x3354d90_rot" unit="deg" x="0" y="0" z="-40"/> - </physvol> - <physvol name="BelleIIAerogel1-1-000x3355310"> - <volumeref ref="BelleIIAerogel1-1-000x33550c0"/> - <position name="BelleIIAerogel1-1-000x3355310_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="A-Spacer--1-000x33553b0"> - <volumeref ref="A-Spacer--1-000x33551c0"/> - <position name="A-Spacer--1-000x33553b0_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol copynumber="1" name="BelleIIAerogel1-1-000x3355750"> - <volumeref ref="BelleIIAerogel1-1-000x3355500"/> - <position name="BelleIIAerogel1-1-000x3355750_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3355750_rot" unit="deg" x="0" y="0" z="25.7142857142857"/> - </physvol> - <physvol copynumber="1" name="A-Spacer--1-000x33557f0"> - <volumeref ref="A-Spacer--1-000x3355600"/> - <position name="A-Spacer--1-000x33557f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x33557f0_rot" unit="deg" x="0" y="0" z="25.7142857142857"/> - </physvol> - <physvol copynumber="2" name="BelleIIAerogel1-1-000x3355b90"> - <volumeref ref="BelleIIAerogel1-1-000x3355940"/> - <position name="BelleIIAerogel1-1-000x3355b90_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3355b90_rot" unit="deg" x="0" y="0" z="51.4285714285714"/> - </physvol> - <physvol copynumber="2" name="A-Spacer--1-000x3355c30"> - <volumeref ref="A-Spacer--1-000x3355a40"/> - <position name="A-Spacer--1-000x3355c30_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3355c30_rot" unit="deg" x="0" y="0" z="51.4285714285714"/> - </physvol> - <physvol copynumber="3" name="BelleIIAerogel1-1-000x3355fd0"> - <volumeref ref="BelleIIAerogel1-1-000x3355d80"/> - <position name="BelleIIAerogel1-1-000x3355fd0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3355fd0_rot" unit="deg" x="0" y="0" z="77.1428571428571"/> - </physvol> - <physvol copynumber="3" name="A-Spacer--1-000x3356070"> - <volumeref ref="A-Spacer--1-000x3355e80"/> - <position name="A-Spacer--1-000x3356070_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3356070_rot" unit="deg" x="0" y="0" z="77.1428571428571"/> - </physvol> - <physvol copynumber="4" name="BelleIIAerogel1-1-000x3356410"> - <volumeref ref="BelleIIAerogel1-1-000x33561c0"/> - <position name="BelleIIAerogel1-1-000x3356410_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3356410_rot" unit="deg" x="0" y="0" z="102.857142857143"/> - </physvol> - <physvol copynumber="4" name="A-Spacer--1-000x33564b0"> - <volumeref ref="A-Spacer--1-000x33562c0"/> - <position name="A-Spacer--1-000x33564b0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x33564b0_rot" unit="deg" x="0" y="0" z="102.857142857143"/> - </physvol> - <physvol copynumber="5" name="BelleIIAerogel1-1-000x3356850"> - <volumeref ref="BelleIIAerogel1-1-000x3356600"/> - <position name="BelleIIAerogel1-1-000x3356850_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3356850_rot" unit="deg" x="0" y="0" z="128.571428571429"/> - </physvol> - <physvol copynumber="5" name="A-Spacer--1-000x33568f0"> - <volumeref ref="A-Spacer--1-000x3356700"/> - <position name="A-Spacer--1-000x33568f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x33568f0_rot" unit="deg" x="0" y="0" z="128.571428571429"/> - </physvol> - <physvol copynumber="6" name="BelleIIAerogel1-1-000x3356c90"> - <volumeref ref="BelleIIAerogel1-1-000x3356a40"/> - <position name="BelleIIAerogel1-1-000x3356c90_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3356c90_rot" unit="deg" x="0" y="0" z="154.285714285714"/> - </physvol> - <physvol copynumber="6" name="A-Spacer--1-000x3356d30"> - <volumeref ref="A-Spacer--1-000x3356b40"/> - <position name="A-Spacer--1-000x3356d30_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3356d30_rot" unit="deg" x="0" y="0" z="154.285714285714"/> - </physvol> - <physvol copynumber="7" name="BelleIIAerogel1-1-000x3357260"> - <volumeref ref="BelleIIAerogel1-1-000x3356fb0"/> - <position name="BelleIIAerogel1-1-000x3357260_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3357260_rot" unit="deg" x="0" y="0" z="180"/> - </physvol> - <physvol copynumber="7" name="A-Spacer--1-000x3357300"> - <volumeref ref="A-Spacer--1-000x3357080"/> - <position name="A-Spacer--1-000x3357300_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3357300_rot" unit="deg" x="0" y="0" z="180"/> - </physvol> - <physvol copynumber="8" name="BelleIIAerogel1-1-000x33576a0"> - <volumeref ref="BelleIIAerogel1-1-000x3357450"/> - <position name="BelleIIAerogel1-1-000x33576a0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x33576a0_rot" unit="deg" x="0" y="0" z="-154.285714285714"/> - </physvol> - <physvol copynumber="8" name="A-Spacer--1-000x3357740"> - <volumeref ref="A-Spacer--1-000x3357550"/> - <position name="A-Spacer--1-000x3357740_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3357740_rot" unit="deg" x="0" y="0" z="-154.285714285714"/> - </physvol> - <physvol copynumber="9" name="BelleIIAerogel1-1-000x3357ae0"> - <volumeref ref="BelleIIAerogel1-1-000x3357890"/> - <position name="BelleIIAerogel1-1-000x3357ae0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3357ae0_rot" unit="deg" x="0" y="0" z="-128.571428571429"/> - </physvol> - <physvol copynumber="9" name="A-Spacer--1-000x3357b80"> - <volumeref ref="A-Spacer--1-000x3357990"/> - <position name="A-Spacer--1-000x3357b80_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3357b80_rot" unit="deg" x="0" y="0" z="-128.571428571429"/> - </physvol> - <physvol copynumber="10" name="BelleIIAerogel1-1-000x3357f20"> - <volumeref ref="BelleIIAerogel1-1-000x3357cd0"/> - <position name="BelleIIAerogel1-1-000x3357f20_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3357f20_rot" unit="deg" x="0" y="0" z="-102.857142857143"/> - </physvol> - <physvol copynumber="10" name="A-Spacer--1-000x3357fc0"> - <volumeref ref="A-Spacer--1-000x3357dd0"/> - <position name="A-Spacer--1-000x3357fc0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3357fc0_rot" unit="deg" x="0" y="0" z="-102.857142857143"/> - </physvol> - <physvol copynumber="11" name="BelleIIAerogel1-1-000x3358360"> - <volumeref ref="BelleIIAerogel1-1-000x3358110"/> - <position name="BelleIIAerogel1-1-000x3358360_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3358360_rot" unit="deg" x="0" y="0" z="-77.1428571428572"/> - </physvol> - <physvol copynumber="11" name="A-Spacer--1-000x3358400"> - <volumeref ref="A-Spacer--1-000x3358210"/> - <position name="A-Spacer--1-000x3358400_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3358400_rot" unit="deg" x="0" y="0" z="-77.1428571428572"/> - </physvol> - <physvol copynumber="12" name="BelleIIAerogel1-1-000x33587a0"> - <volumeref ref="BelleIIAerogel1-1-000x3358550"/> - <position name="BelleIIAerogel1-1-000x33587a0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x33587a0_rot" unit="deg" x="0" y="0" z="-51.4285714285714"/> - </physvol> - <physvol copynumber="12" name="A-Spacer--1-000x3358840"> - <volumeref ref="A-Spacer--1-000x3358650"/> - <position name="A-Spacer--1-000x3358840_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3358840_rot" unit="deg" x="0" y="0" z="-51.4285714285714"/> - </physvol> - <physvol copynumber="13" name="BelleIIAerogel1-1-000x3358be0"> - <volumeref ref="BelleIIAerogel1-1-000x3358990"/> - <position name="BelleIIAerogel1-1-000x3358be0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-1-000x3358be0_rot" unit="deg" x="0" y="0" z="-25.7142857142857"/> - </physvol> - <physvol copynumber="13" name="A-Spacer--1-000x3358c80"> - <volumeref ref="A-Spacer--1-000x3358a90"/> - <position name="A-Spacer--1-000x3358c80_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--1-000x3358c80_rot" unit="deg" x="0" y="0" z="-25.7142857142857"/> - </physvol> - <physvol name="BelleIIAerogel1-2-000x3359250"> - <volumeref ref="BelleIIAerogel1-2-000x3359000"/> - <position name="BelleIIAerogel1-2-000x3359250_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="A-Spacer--2-000x33592f0"> - <volumeref ref="A-Spacer--2-000x3359100"/> - <position name="A-Spacer--2-000x33592f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol copynumber="1" name="BelleIIAerogel1-2-000x3359690"> - <volumeref ref="BelleIIAerogel1-2-000x3359440"/> - <position name="BelleIIAerogel1-2-000x3359690_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x3359690_rot" unit="deg" x="0" y="0" z="18"/> - </physvol> - <physvol copynumber="1" name="A-Spacer--2-000x3359730"> - <volumeref ref="A-Spacer--2-000x3359540"/> - <position name="A-Spacer--2-000x3359730_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x3359730_rot" unit="deg" x="0" y="0" z="18"/> - </physvol> - <physvol copynumber="2" name="BelleIIAerogel1-2-000x3359ad0"> - <volumeref ref="BelleIIAerogel1-2-000x3359880"/> - <position name="BelleIIAerogel1-2-000x3359ad0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x3359ad0_rot" unit="deg" x="0" y="0" z="36"/> - </physvol> - <physvol copynumber="2" name="A-Spacer--2-000x3359b70"> - <volumeref ref="A-Spacer--2-000x3359980"/> - <position name="A-Spacer--2-000x3359b70_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x3359b70_rot" unit="deg" x="0" y="0" z="36"/> - </physvol> - <physvol copynumber="3" name="BelleIIAerogel1-2-000x3359f10"> - <volumeref ref="BelleIIAerogel1-2-000x3359cc0"/> - <position name="BelleIIAerogel1-2-000x3359f10_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x3359f10_rot" unit="deg" x="0" y="0" z="54"/> - </physvol> - <physvol copynumber="3" name="A-Spacer--2-000x3359fb0"> - <volumeref ref="A-Spacer--2-000x3359dc0"/> - <position name="A-Spacer--2-000x3359fb0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x3359fb0_rot" unit="deg" x="0" y="0" z="54"/> - </physvol> - <physvol copynumber="4" name="BelleIIAerogel1-2-000x335a350"> - <volumeref ref="BelleIIAerogel1-2-000x335a100"/> - <position name="BelleIIAerogel1-2-000x335a350_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335a350_rot" unit="deg" x="0" y="0" z="72"/> - </physvol> - <physvol copynumber="4" name="A-Spacer--2-000x335a3f0"> - <volumeref ref="A-Spacer--2-000x335a200"/> - <position name="A-Spacer--2-000x335a3f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335a3f0_rot" unit="deg" x="0" y="0" z="72"/> - </physvol> - <physvol copynumber="5" name="BelleIIAerogel1-2-000x335a790"> - <volumeref ref="BelleIIAerogel1-2-000x335a540"/> - <position name="BelleIIAerogel1-2-000x335a790_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335a790_rot" unit="deg" x="0" y="0" z="90"/> - </physvol> - <physvol copynumber="5" name="A-Spacer--2-000x335a830"> - <volumeref ref="A-Spacer--2-000x335a640"/> - <position name="A-Spacer--2-000x335a830_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335a830_rot" unit="deg" x="0" y="0" z="90"/> - </physvol> - <physvol copynumber="6" name="BelleIIAerogel1-2-000x335abd0"> - <volumeref ref="BelleIIAerogel1-2-000x335a980"/> - <position name="BelleIIAerogel1-2-000x335abd0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335abd0_rot" unit="deg" x="0" y="0" z="108"/> - </physvol> - <physvol copynumber="6" name="A-Spacer--2-000x335ac70"> - <volumeref ref="A-Spacer--2-000x335aa80"/> - <position name="A-Spacer--2-000x335ac70_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335ac70_rot" unit="deg" x="0" y="0" z="108"/> - </physvol> - <physvol copynumber="7" name="BelleIIAerogel1-2-000x335b010"> - <volumeref ref="BelleIIAerogel1-2-000x335adc0"/> - <position name="BelleIIAerogel1-2-000x335b010_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335b010_rot" unit="deg" x="0" y="0" z="126"/> - </physvol> - <physvol copynumber="7" name="A-Spacer--2-000x335b0b0"> - <volumeref ref="A-Spacer--2-000x335aec0"/> - <position name="A-Spacer--2-000x335b0b0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335b0b0_rot" unit="deg" x="0" y="0" z="126"/> - </physvol> - <physvol copynumber="8" name="BelleIIAerogel1-2-000x335b450"> - <volumeref ref="BelleIIAerogel1-2-000x335b200"/> - <position name="BelleIIAerogel1-2-000x335b450_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335b450_rot" unit="deg" x="0" y="0" z="144"/> - </physvol> - <physvol copynumber="8" name="A-Spacer--2-000x335b4f0"> - <volumeref ref="A-Spacer--2-000x335b300"/> - <position name="A-Spacer--2-000x335b4f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335b4f0_rot" unit="deg" x="0" y="0" z="144"/> - </physvol> - <physvol copynumber="9" name="BelleIIAerogel1-2-000x33571d0"> - <volumeref ref="BelleIIAerogel1-2-000x3356e80"/> - <position name="BelleIIAerogel1-2-000x33571d0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x33571d0_rot" unit="deg" x="0" y="0" z="162"/> - </physvol> - <physvol copynumber="9" name="A-Spacer--2-000x335bc50"> - <volumeref ref="A-Spacer--2-000x335b970"/> - <position name="A-Spacer--2-000x335bc50_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335bc50_rot" unit="deg" x="0" y="0" z="162"/> - </physvol> - <physvol copynumber="10" name="BelleIIAerogel1-2-000x335bff0"> - <volumeref ref="BelleIIAerogel1-2-000x335bda0"/> - <position name="BelleIIAerogel1-2-000x335bff0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335bff0_rot" unit="deg" x="0" y="0" z="180"/> - </physvol> - <physvol copynumber="10" name="A-Spacer--2-000x335c090"> - <volumeref ref="A-Spacer--2-000x335bea0"/> - <position name="A-Spacer--2-000x335c090_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335c090_rot" unit="deg" x="0" y="0" z="180"/> - </physvol> - <physvol copynumber="11" name="BelleIIAerogel1-2-000x335c430"> - <volumeref ref="BelleIIAerogel1-2-000x335c1e0"/> - <position name="BelleIIAerogel1-2-000x335c430_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335c430_rot" unit="deg" x="0" y="0" z="-162"/> - </physvol> - <physvol copynumber="11" name="A-Spacer--2-000x335c4d0"> - <volumeref ref="A-Spacer--2-000x335c2e0"/> - <position name="A-Spacer--2-000x335c4d0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335c4d0_rot" unit="deg" x="0" y="0" z="-162"/> - </physvol> - <physvol copynumber="12" name="BelleIIAerogel1-2-000x335c870"> - <volumeref ref="BelleIIAerogel1-2-000x335c620"/> - <position name="BelleIIAerogel1-2-000x335c870_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335c870_rot" unit="deg" x="0" y="0" z="-144"/> - </physvol> - <physvol copynumber="12" name="A-Spacer--2-000x335c910"> - <volumeref ref="A-Spacer--2-000x335c720"/> - <position name="A-Spacer--2-000x335c910_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335c910_rot" unit="deg" x="0" y="0" z="-144"/> - </physvol> - <physvol copynumber="13" name="BelleIIAerogel1-2-000x335ccb0"> - <volumeref ref="BelleIIAerogel1-2-000x335ca60"/> - <position name="BelleIIAerogel1-2-000x335ccb0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335ccb0_rot" unit="deg" x="0" y="0" z="-126"/> - </physvol> - <physvol copynumber="13" name="A-Spacer--2-000x335cd50"> - <volumeref ref="A-Spacer--2-000x335cb60"/> - <position name="A-Spacer--2-000x335cd50_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335cd50_rot" unit="deg" x="0" y="0" z="-126"/> - </physvol> - <physvol copynumber="14" name="BelleIIAerogel1-2-000x335d0f0"> - <volumeref ref="BelleIIAerogel1-2-000x335cea0"/> - <position name="BelleIIAerogel1-2-000x335d0f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335d0f0_rot" unit="deg" x="0" y="0" z="-108"/> - </physvol> - <physvol copynumber="14" name="A-Spacer--2-000x335d190"> - <volumeref ref="A-Spacer--2-000x335cfa0"/> - <position name="A-Spacer--2-000x335d190_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335d190_rot" unit="deg" x="0" y="0" z="-108"/> - </physvol> - <physvol copynumber="15" name="BelleIIAerogel1-2-000x335d530"> - <volumeref ref="BelleIIAerogel1-2-000x335d2e0"/> - <position name="BelleIIAerogel1-2-000x335d530_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335d530_rot" unit="deg" x="0" y="0" z="-90"/> - </physvol> - <physvol copynumber="15" name="A-Spacer--2-000x335d5d0"> - <volumeref ref="A-Spacer--2-000x335d3e0"/> - <position name="A-Spacer--2-000x335d5d0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335d5d0_rot" unit="deg" x="0" y="0" z="-90"/> - </physvol> - <physvol copynumber="16" name="BelleIIAerogel1-2-000x335d970"> - <volumeref ref="BelleIIAerogel1-2-000x335d720"/> - <position name="BelleIIAerogel1-2-000x335d970_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335d970_rot" unit="deg" x="0" y="0" z="-72"/> - </physvol> - <physvol copynumber="16" name="A-Spacer--2-000x335da10"> - <volumeref ref="A-Spacer--2-000x335d820"/> - <position name="A-Spacer--2-000x335da10_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335da10_rot" unit="deg" x="0" y="0" z="-72"/> - </physvol> - <physvol copynumber="17" name="BelleIIAerogel1-2-000x335ddb0"> - <volumeref ref="BelleIIAerogel1-2-000x335db60"/> - <position name="BelleIIAerogel1-2-000x335ddb0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335ddb0_rot" unit="deg" x="0" y="0" z="-54"/> - </physvol> - <physvol copynumber="17" name="A-Spacer--2-000x335de50"> - <volumeref ref="A-Spacer--2-000x335dc60"/> - <position name="A-Spacer--2-000x335de50_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335de50_rot" unit="deg" x="0" y="0" z="-54"/> - </physvol> - <physvol copynumber="18" name="BelleIIAerogel1-2-000x335e1f0"> - <volumeref ref="BelleIIAerogel1-2-000x335dfa0"/> - <position name="BelleIIAerogel1-2-000x335e1f0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335e1f0_rot" unit="deg" x="0" y="0" z="-36"/> - </physvol> - <physvol copynumber="18" name="A-Spacer--2-000x335e290"> - <volumeref ref="A-Spacer--2-000x335e0a0"/> - <position name="A-Spacer--2-000x335e290_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335e290_rot" unit="deg" x="0" y="0" z="-36"/> - </physvol> - <physvol copynumber="19" name="BelleIIAerogel1-2-000x335e630"> - <volumeref ref="BelleIIAerogel1-2-000x335e3e0"/> - <position name="BelleIIAerogel1-2-000x335e630_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="BelleIIAerogel1-2-000x335e630_rot" unit="deg" x="0" y="0" z="-18"/> - </physvol> - <physvol copynumber="19" name="A-Spacer--2-000x335e6d0"> - <volumeref ref="A-Spacer--2-000x335e4e0"/> - <position name="A-Spacer--2-000x335e6d0_pos" unit="mm" x="0" y="0" z="-231.067"/> - <rotation name="A-Spacer--2-000x335e6d0_rot" unit="deg" x="0" y="0" z="-18"/> - </physvol> - <physvol name="R-Spacer--0-000x335eab0"> - <volumeref ref="R-Spacer--0-000x335e9b0"/> - <position name="R-Spacer--0-000x335eab0_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="R-Spacer--1-000x335ed60"> - <volumeref ref="R-Spacer--1-000x335ec60"/> - <position name="R-Spacer--1-000x335ed60_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="R-Spacer--2-000x335f010"> - <volumeref ref="R-Spacer--2-000x335ef10"/> - <position name="R-Spacer--2-000x335f010_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="R-Spacer--3-000x32e6bc0"> - <volumeref ref="R-Spacer--3-000x32e6ac0"/> - <position name="R-Spacer--3-000x32e6bc0_pos" unit="mm" x="0" y="0" z="-231.067"/> - </physvol> - <physvol name="Acrylic0x3360220"> - <volumeref ref="Acrylic0x335f870"/> - <position name="Acrylic0x3360220_pos" unit="mm" x="0" y="0" z="-218.567"/> - </physvol> - <physvol name="InnerMirror0x3361d00"> - <volumeref ref="InnerMirror0x3360600"/> - <position name="InnerMirror0x3361d00_pos" unit="mm" x="0" y="0" z="10.5"/> - </physvol> - <physvol name="OuterMirror0x3363940"> - <volumeref ref="OuterMirror0x3362240"/> - <position name="OuterMirror0x3363940_pos" unit="mm" x="0" y="0" z="10.5"/> - </physvol> - <physvol name="SupportGridBar0x33689b0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33689b0_pos" unit="mm" x="-526" y="0" z="240.567"/> - </physvol> - <physvol copynumber="1" name="SupportGridBar0x281c830"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x281c830_pos" unit="mm" x="-404.5" y="0" z="240.567"/> - </physvol> - <physvol copynumber="2" name="SupportGridBar0x3374f40"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3374f40_pos" unit="mm" x="-283" y="0" z="240.567"/> - </physvol> - <physvol copynumber="3" name="SupportGridBar0x3375830"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3375830_pos" unit="mm" x="-161.5" y="0" z="240.567"/> - </physvol> - <physvol copynumber="4" name="SupportGridBar0x33764e0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33764e0_pos" unit="mm" x="121.5" y="0" z="240.567"/> - </physvol> - <physvol copynumber="5" name="SupportGridBar0x3377660"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3377660_pos" unit="mm" x="243" y="0" z="240.567"/> - </physvol> - <physvol copynumber="6" name="SupportGridBar0x3377f10"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3377f10_pos" unit="mm" x="364.5" y="0" z="240.567"/> - </physvol> - <physvol copynumber="7" name="SupportGridBar0x3378bc0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3378bc0_pos" unit="mm" x="486" y="0" z="240.567"/> - </physvol> - <physvol copynumber="8" name="SupportGridBar0x3379870"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3379870_pos" unit="mm" x="-486" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="9" name="SupportGridBar0x337aa00"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x337aa00_pos" unit="mm" x="-364.5" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="10" name="SupportGridBar0x337b2b0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x337b2b0_pos" unit="mm" x="-243" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="11" name="SupportGridBar0x337bf60"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x337bf60_pos" unit="mm" x="-121.5" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="12" name="SupportGridBar0x337cc10"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x337cc10_pos" unit="mm" x="0" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="13" name="SupportGridBar0x337e2f0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x337e2f0_pos" unit="mm" x="121.5" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="14" name="SupportGridBar0x337eba0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x337eba0_pos" unit="mm" x="243" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="15" name="SupportGridBar0x337f850"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x337f850_pos" unit="mm" x="364.5" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="16" name="SupportGridBar0x3380500"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3380500_pos" unit="mm" x="486" y="121.5" z="240.567"/> - </physvol> - <physvol copynumber="17" name="SupportGridBar0x33817d0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33817d0_pos" unit="mm" x="-486" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="18" name="SupportGridBar0x3382080"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3382080_pos" unit="mm" x="-364.5" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="19" name="SupportGridBar0x3382d30"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3382d30_pos" unit="mm" x="-243" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="20" name="SupportGridBar0x33839e0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33839e0_pos" unit="mm" x="-121.5" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="21" name="SupportGridBar0x33849a0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33849a0_pos" unit="mm" x="0" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="22" name="SupportGridBar0x3385650"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3385650_pos" unit="mm" x="121.5" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="23" name="SupportGridBar0x3386300"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3386300_pos" unit="mm" x="243" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="24" name="SupportGridBar0x3386fb0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3386fb0_pos" unit="mm" x="364.5" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="25" name="SupportGridBar0x3387c60"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3387c60_pos" unit="mm" x="486" y="-121.5" z="240.567"/> - </physvol> - <physvol copynumber="26" name="SupportGridBar0x3388910"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3388910_pos" unit="mm" x="-486" y="243" z="240.567"/> - </physvol> - <physvol copynumber="27" name="SupportGridBar0x33895c0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33895c0_pos" unit="mm" x="-364.5" y="243" z="240.567"/> - </physvol> - <physvol copynumber="28" name="SupportGridBar0x338a270"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338a270_pos" unit="mm" x="-243" y="243" z="240.567"/> - </physvol> - <physvol copynumber="29" name="SupportGridBar0x338af20"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338af20_pos" unit="mm" x="-121.5" y="243" z="240.567"/> - </physvol> - <physvol copynumber="30" name="SupportGridBar0x338bcd0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338bcd0_pos" unit="mm" x="0" y="243" z="240.567"/> - </physvol> - <physvol copynumber="31" name="SupportGridBar0x338c980"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338c980_pos" unit="mm" x="121.5" y="243" z="240.567"/> - </physvol> - <physvol copynumber="32" name="SupportGridBar0x338d630"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338d630_pos" unit="mm" x="243" y="243" z="240.567"/> - </physvol> - <physvol copynumber="33" name="SupportGridBar0x338eb10"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338eb10_pos" unit="mm" x="364.5" y="243" z="240.567"/> - </physvol> - <physvol copynumber="34" name="SupportGridBar0x338f3c0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338f3c0_pos" unit="mm" x="486" y="243" z="240.567"/> - </physvol> - <physvol copynumber="35" name="SupportGridBar0x3390870"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3390870_pos" unit="mm" x="-486" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="36" name="SupportGridBar0x3391120"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3391120_pos" unit="mm" x="-364.5" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="37" name="SupportGridBar0x3391dd0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3391dd0_pos" unit="mm" x="-243" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="38" name="SupportGridBar0x3392a80"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3392a80_pos" unit="mm" x="-121.5" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="39" name="SupportGridBar0x3393730"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3393730_pos" unit="mm" x="0" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="40" name="SupportGridBar0x33943e0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33943e0_pos" unit="mm" x="121.5" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="41" name="SupportGridBar0x3395090"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3395090_pos" unit="mm" x="243" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="42" name="SupportGridBar0x3395d40"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3395d40_pos" unit="mm" x="364.5" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="43" name="SupportGridBar0x3397440"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3397440_pos" unit="mm" x="486" y="-243" z="240.567"/> - </physvol> - <physvol copynumber="44" name="SupportGridBar0x3397cf0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3397cf0_pos" unit="mm" x="-364.5" y="364.5" z="240.567"/> - </physvol> - <physvol copynumber="45" name="SupportGridBar0x33989a0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33989a0_pos" unit="mm" x="-243" y="364.5" z="240.567"/> - </physvol> - <physvol copynumber="46" name="SupportGridBar0x3399c80"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x3399c80_pos" unit="mm" x="-121.5" y="364.5" z="240.567"/> - </physvol> - <physvol copynumber="47" name="SupportGridBar0x339a930"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x339a930_pos" unit="mm" x="0" y="364.5" z="240.567"/> - </physvol> - <physvol copynumber="48" name="SupportGridBar0x339b5e0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x339b5e0_pos" unit="mm" x="121.5" y="364.5" z="240.567"/> - </physvol> - <physvol copynumber="49" name="SupportGridBar0x339c290"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x339c290_pos" unit="mm" x="243" y="364.5" z="240.567"/> - </physvol> - <physvol copynumber="50" name="SupportGridBar0x339cf40"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x339cf40_pos" unit="mm" x="364.5" y="364.5" z="240.567"/> - </physvol> - <physvol copynumber="51" name="SupportGridBar0x339dbf0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x339dbf0_pos" unit="mm" x="-364.5" y="-364.5" z="240.567"/> - </physvol> - <physvol copynumber="52" name="SupportGridBar0x339e8a0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x339e8a0_pos" unit="mm" x="-243" y="-364.5" z="240.567"/> - </physvol> - <physvol copynumber="53" name="SupportGridBar0x339f550"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x339f550_pos" unit="mm" x="-121.5" y="-364.5" z="240.567"/> - </physvol> - <physvol copynumber="54" name="SupportGridBar0x33a0200"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a0200_pos" unit="mm" x="0" y="-364.5" z="240.567"/> - </physvol> - <physvol copynumber="55" name="SupportGridBar0x33a0eb0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a0eb0_pos" unit="mm" x="121.5" y="-364.5" z="240.567"/> - </physvol> - <physvol copynumber="56" name="SupportGridBar0x33a1b60"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a1b60_pos" unit="mm" x="243" y="-364.5" z="240.567"/> - </physvol> - <physvol copynumber="57" name="SupportGridBar0x33a2810"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a2810_pos" unit="mm" x="364.5" y="-364.5" z="240.567"/> - </physvol> - <physvol copynumber="58" name="SupportGridBar0x33a34c0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a34c0_pos" unit="mm" x="-243" y="486" z="240.567"/> - </physvol> - <physvol copynumber="59" name="SupportGridBar0x33a4170"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a4170_pos" unit="mm" x="-121.5" y="486" z="240.567"/> - </physvol> - <physvol copynumber="60" name="SupportGridBar0x33a4e20"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a4e20_pos" unit="mm" x="0" y="486" z="240.567"/> - </physvol> - <physvol copynumber="61" name="SupportGridBar0x338b250"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338b250_pos" unit="mm" x="121.5" y="486" z="240.567"/> - </physvol> - <physvol copynumber="62" name="SupportGridBar0x33a69a0"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a69a0_pos" unit="mm" x="243" y="486" z="240.567"/> - </physvol> - <physvol copynumber="63" name="SupportGridBar0x33a7650"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a7650_pos" unit="mm" x="-243" y="-486" z="240.567"/> - </physvol> - <physvol copynumber="64" name="SupportGridBar0x33a8300"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33a8300_pos" unit="mm" x="-121.5" y="-486" z="240.567"/> - </physvol> - <physvol copynumber="65" name="SupportGridBar0x338e300"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x338e300_pos" unit="mm" x="0" y="-486" z="240.567"/> - </physvol> - <physvol copynumber="66" name="SupportGridBar0x33aa480"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33aa480_pos" unit="mm" x="121.5" y="-486" z="240.567"/> - </physvol> - <physvol copynumber="67" name="SupportGridBar0x33ab130"> - <volumeref ref="SupportGridBar0x3368180"/> - <position name="SupportGridBar0x33ab130_pos" unit="mm" x="243" y="-486" z="240.567"/> - </physvol> - </volume> - <volume name="FrontWallAluRing10x33323a0"> - <materialref ref="G4_Al0x3247b70"/> - <solidref ref="FrontWallAluRing10x3332250"/> - </volume> - <volume name="FrontWallAluRing20x3332650"> - <materialref ref="G4_Al0x3247b70"/> - <solidref ref="FrontWallAluRing20x3332530"/> - </volume> - <volume name="FrontWall0x3330eb0"> - <materialref ref="QuarterInchHoneycomb0x32de250"/> - <solidref ref="FrontWall0x3330da0"/> - <physvol name="FrontWallAluRing10x33324b0"> - <volumeref ref="FrontWallAluRing10x33323a0"/> - </physvol> - <physvol name="FrontWallAluRing20x3332760"> - <volumeref ref="FrontWallAluRing20x3332650"/> - </physvol> - </volume> - <volume name="OuterWallAluRing0x3332c30"> - <materialref ref="G4_Al0x3247b70"/> - <solidref ref="OuterWallAluRing0x3332b10"/> - </volume> - <volume name="OuterWall0x3332930"> - <materialref ref="HalfInchHoneyconb0x32dea40"/> - <solidref ref="OuterWall0x3332820"/> - <physvol name="OuterWallAluRing0x3332d40"> - <volumeref ref="OuterWallAluRing0x3332c30"/> - <position name="OuterWallAluRing0x3332d40_pos" unit="mm" x="0" y="0" z="-235.717"/> - </physvol> - <physvol copynumber="1" name="OuterWallAluRing0x3332df0"> - <volumeref ref="OuterWallAluRing0x3332c30"/> - <position name="OuterWallAluRing0x3332df0_pos" unit="mm" x="0" y="0" z="235.717"/> - </physvol> - </volume> - <volume name="QuartzWindow0x3363db0"> - <materialref ref="FusedSilica0x3258030"/> - <solidref ref="QuartzWindow0x3363d20"/> - </volume> - <volume name="CeramicBody0x3364760"> - <materialref ref="Ceramic0x32dc4f0"/> - <solidref ref="CeramicBody0x3364540"/> - </volume> - <volume name="Plating0x3364960"> - <materialref ref="G4_Ag0x32527d0"/> - <solidref ref="Plating0x33648d0"/> - </volume> - <volume name="MCP0x3364af0"> - <materialref ref="FusedSilica0x3258030"/> - <solidref ref="MCP0x3364a60"/> - </volume> - <volume name="PhotoDetector0x3365040"> - <materialref ref="Bialkali0x32da6f0"/> - <solidref ref="PhotoDetector0x3364f10"/> - </volume> - <volume name="PCB0x3364c80"> - <materialref ref="FR40x32dfa00"/> - <solidref ref="PCB0x3364bf0"/> - </volume> - <volume name="ASIC0x3364e10"> - <materialref ref="G4_Si0x3255300"/> - <solidref ref="ASIC0x3364d80"/> - </volume> - <volume name="HRPPD0x3363c20"> - <materialref ref="Nitrogen0x3255cc0"/> - <solidref ref="HRPPD0x3363b90"/> - <physvol name="QuartzWindow0x33651b0"> - <volumeref ref="QuartzWindow0x3363db0"/> - <position name="QuartzWindow0x33651b0_pos" unit="mm" x="0" y="0" z="-12.5"/> - </physvol> - <physvol name="CeramicBody0x3365250"> - <volumeref ref="CeramicBody0x3364760"/> - <position name="CeramicBody0x3365250_pos" unit="mm" x="0" y="0" z="-5.5"/> - </physvol> - <physvol name="Plating0x3365310"> - <volumeref ref="Plating0x3364960"/> - <position name="Plating0x3365310_pos" unit="mm" x="0" y="0" z="-5.5"/> - </physvol> - <physvol name="MCP0x33653e0"> - <volumeref ref="MCP0x3364af0"/> - <position name="MCP0x33653e0_pos" unit="mm" x="0" y="0" z="-5.29"/> - </physvol> - <physvol name="PhotoDetector0x3366b60"> - <volumeref ref="PhotoDetector0x3365040"/> - <position name="PhotoDetector0x3366b60_pos" unit="mm" x="0" y="0" z="-9.995"/> - </physvol> - <physvol name="PCB0x3366bd0"> - <volumeref ref="PCB0x3364c80"/> - <position name="PCB0x3366bd0_pos" unit="mm" x="0" y="0" z="1"/> - </physvol> - <physvol name="ASIC0x3366c70"> - <volumeref ref="ASIC0x3364e10"/> - <position name="ASIC0x3366c70_pos" unit="mm" x="-28" y="-28" z="2.5"/> - </physvol> - <physvol copynumber="1" name="ASIC0x3366d10"> - <volumeref ref="ASIC0x3364e10"/> - <position name="ASIC0x3366d10_pos" unit="mm" x="-28" y="28" z="2.5"/> - </physvol> - <physvol copynumber="2" name="ASIC0x3366db0"> - <volumeref ref="ASIC0x3364e10"/> - <position name="ASIC0x3366db0_pos" unit="mm" x="28" y="-28" z="2.5"/> - </physvol> - <physvol copynumber="3" name="ASIC0x3366ee0"> - <volumeref ref="ASIC0x3364e10"/> - <position name="ASIC0x3366ee0_pos" unit="mm" x="28" y="28" z="2.5"/> - </physvol> - </volume> - <volume name="AluFrame0x33abd50"> - <materialref ref="G4_Al0x3247b70"/> - <solidref ref="AluFrame0x33ab300"/> - </volume> - <volume name="PFRICH0x32e7830"> - <materialref ref="Air0x32559d0"/> - <solidref ref="PFRICH0x32e7720"/> - <physvol name="GasVolume0x32e86c0"> - <volumeref ref="GasVolume0x32e85c0"/> - <position name="GasVolume0x32e86c0_pos" unit="mm" x="0" y="0" z="-21.317"/> - </physvol> - <physvol name="FrontWall0x3330fb0"> - <volumeref ref="FrontWall0x3330eb0"/> - <position name="FrontWall0x3330fb0_pos" unit="mm" x="0" y="0" z="-267.067"/> - </physvol> - <physvol name="OuterWall0x3332a30"> - <volumeref ref="OuterWall0x3332930"/> - <position name="OuterWall0x3332a30_pos" unit="mm" x="0" y="0" z="-21.317"/> - </physvol> - <physvol name="HRPPD0x3368600"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3368600_pos" unit="mm" x="-526" y="0" z="235.75"/> - </physvol> - <physvol copynumber="1" name="HRPPD0x281c7a0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x281c7a0_pos" unit="mm" x="-404.5" y="0" z="235.75"/> - </physvol> - <physvol copynumber="2" name="HRPPD0x281d120"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x281d120_pos" unit="mm" x="-283" y="0" z="235.75"/> - </physvol> - <physvol copynumber="3" name="HRPPD0x3375570"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3375570_pos" unit="mm" x="-161.5" y="0" z="235.75"/> - </physvol> - <physvol copynumber="4" name="HRPPD0x3376220"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3376220_pos" unit="mm" x="121.5" y="0" z="235.75"/> - </physvol> - <physvol copynumber="5" name="HRPPD0x3376f50"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3376f50_pos" unit="mm" x="243" y="0" z="235.75"/> - </physvol> - <physvol copynumber="6" name="HRPPD0x3377c50"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3377c50_pos" unit="mm" x="364.5" y="0" z="235.75"/> - </physvol> - <physvol copynumber="7" name="HRPPD0x3378900"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3378900_pos" unit="mm" x="486" y="0" z="235.75"/> - </physvol> - <physvol copynumber="8" name="HRPPD0x33795b0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33795b0_pos" unit="mm" x="-486" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="9" name="HRPPD0x337a3a0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x337a3a0_pos" unit="mm" x="-364.5" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="10" name="HRPPD0x337aff0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x337aff0_pos" unit="mm" x="-243" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="11" name="HRPPD0x337bca0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x337bca0_pos" unit="mm" x="-121.5" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="12" name="HRPPD0x337c950"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x337c950_pos" unit="mm" x="0" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="13" name="HRPPD0x33515a0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33515a0_pos" unit="mm" x="121.5" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="14" name="HRPPD0x337e8e0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x337e8e0_pos" unit="mm" x="243" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="15" name="HRPPD0x337f590"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x337f590_pos" unit="mm" x="364.5" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="16" name="HRPPD0x3380240"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3380240_pos" unit="mm" x="486" y="121.5" z="235.75"/> - </physvol> - <physvol copynumber="17" name="HRPPD0x33811a0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33811a0_pos" unit="mm" x="-486" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="18" name="HRPPD0x3381dc0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3381dc0_pos" unit="mm" x="-364.5" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="19" name="HRPPD0x3382a70"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3382a70_pos" unit="mm" x="-243" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="20" name="HRPPD0x33832b0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33832b0_pos" unit="mm" x="-121.5" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="21" name="HRPPD0x33846e0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33846e0_pos" unit="mm" x="0" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="22" name="HRPPD0x3385390"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3385390_pos" unit="mm" x="121.5" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="23" name="HRPPD0x3386040"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3386040_pos" unit="mm" x="243" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="24" name="HRPPD0x3386cf0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3386cf0_pos" unit="mm" x="364.5" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="25" name="HRPPD0x33879a0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33879a0_pos" unit="mm" x="486" y="-121.5" z="235.75"/> - </physvol> - <physvol copynumber="26" name="HRPPD0x3388650"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3388650_pos" unit="mm" x="-486" y="243" z="235.75"/> - </physvol> - <physvol copynumber="27" name="HRPPD0x3389300"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3389300_pos" unit="mm" x="-364.5" y="243" z="235.75"/> - </physvol> - <physvol copynumber="28" name="HRPPD0x3389fb0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3389fb0_pos" unit="mm" x="-243" y="243" z="235.75"/> - </physvol> - <physvol copynumber="29" name="HRPPD0x338ac60"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x338ac60_pos" unit="mm" x="-121.5" y="243" z="235.75"/> - </physvol> - <physvol copynumber="30" name="HRPPD0x338ba10"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x338ba10_pos" unit="mm" x="0" y="243" z="235.75"/> - </physvol> - <physvol copynumber="31" name="HRPPD0x338c6c0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x338c6c0_pos" unit="mm" x="121.5" y="243" z="235.75"/> - </physvol> - <physvol copynumber="32" name="HRPPD0x338d370"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x338d370_pos" unit="mm" x="243" y="243" z="235.75"/> - </physvol> - <physvol copynumber="33" name="HRPPD0x3380f10"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3380f10_pos" unit="mm" x="364.5" y="243" z="235.75"/> - </physvol> - <physvol copynumber="34" name="HRPPD0x338f100"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x338f100_pos" unit="mm" x="486" y="243" z="235.75"/> - </physvol> - <physvol copynumber="35" name="HRPPD0x3390240"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3390240_pos" unit="mm" x="-486" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="36" name="HRPPD0x3390e60"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3390e60_pos" unit="mm" x="-364.5" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="37" name="HRPPD0x3391b10"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3391b10_pos" unit="mm" x="-243" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="38" name="HRPPD0x33927c0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33927c0_pos" unit="mm" x="-121.5" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="39" name="HRPPD0x3393470"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3393470_pos" unit="mm" x="0" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="40" name="HRPPD0x3394120"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3394120_pos" unit="mm" x="121.5" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="41" name="HRPPD0x3394dd0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3394dd0_pos" unit="mm" x="243" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="42" name="HRPPD0x3395a80"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3395a80_pos" unit="mm" x="364.5" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="43" name="HRPPD0x335f5d0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x335f5d0_pos" unit="mm" x="486" y="-243" z="235.75"/> - </physvol> - <physvol copynumber="44" name="HRPPD0x3397a30"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3397a30_pos" unit="mm" x="-364.5" y="364.5" z="235.75"/> - </physvol> - <physvol copynumber="45" name="HRPPD0x3398270"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3398270_pos" unit="mm" x="-243" y="364.5" z="235.75"/> - </physvol> - <physvol copynumber="46" name="HRPPD0x3399a00"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x3399a00_pos" unit="mm" x="-121.5" y="364.5" z="235.75"/> - </physvol> - <physvol copynumber="47" name="HRPPD0x339a670"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339a670_pos" unit="mm" x="0" y="364.5" z="235.75"/> - </physvol> - <physvol copynumber="48" name="HRPPD0x339b320"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339b320_pos" unit="mm" x="121.5" y="364.5" z="235.75"/> - </physvol> - <physvol copynumber="49" name="HRPPD0x339bfd0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339bfd0_pos" unit="mm" x="243" y="364.5" z="235.75"/> - </physvol> - <physvol copynumber="50" name="HRPPD0x339cc80"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339cc80_pos" unit="mm" x="364.5" y="364.5" z="235.75"/> - </physvol> - <physvol copynumber="51" name="HRPPD0x339d930"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339d930_pos" unit="mm" x="-364.5" y="-364.5" z="235.75"/> - </physvol> - <physvol copynumber="52" name="HRPPD0x339e5e0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339e5e0_pos" unit="mm" x="-243" y="-364.5" z="235.75"/> - </physvol> - <physvol copynumber="53" name="HRPPD0x339f290"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339f290_pos" unit="mm" x="-121.5" y="-364.5" z="235.75"/> - </physvol> - <physvol copynumber="54" name="HRPPD0x339ff40"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x339ff40_pos" unit="mm" x="0" y="-364.5" z="235.75"/> - </physvol> - <physvol copynumber="55" name="HRPPD0x33a0bf0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a0bf0_pos" unit="mm" x="121.5" y="-364.5" z="235.75"/> - </physvol> - <physvol copynumber="56" name="HRPPD0x33a18a0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a18a0_pos" unit="mm" x="243" y="-364.5" z="235.75"/> - </physvol> - <physvol copynumber="57" name="HRPPD0x33a2550"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a2550_pos" unit="mm" x="364.5" y="-364.5" z="235.75"/> - </physvol> - <physvol copynumber="58" name="HRPPD0x33a3200"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a3200_pos" unit="mm" x="-243" y="486" z="235.75"/> - </physvol> - <physvol copynumber="59" name="HRPPD0x33a3eb0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a3eb0_pos" unit="mm" x="-121.5" y="486" z="235.75"/> - </physvol> - <physvol copynumber="60" name="HRPPD0x33a4b60"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a4b60_pos" unit="mm" x="0" y="486" z="235.75"/> - </physvol> - <physvol copynumber="61" name="HRPPD0x33a5810"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a5810_pos" unit="mm" x="121.5" y="486" z="235.75"/> - </physvol> - <physvol copynumber="62" name="HRPPD0x33a66e0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a66e0_pos" unit="mm" x="243" y="486" z="235.75"/> - </physvol> - <physvol copynumber="63" name="HRPPD0x33a7390"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a7390_pos" unit="mm" x="-243" y="-486" z="235.75"/> - </physvol> - <physvol copynumber="64" name="HRPPD0x33a8040"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33a8040_pos" unit="mm" x="-121.5" y="-486" z="235.75"/> - </physvol> - <physvol copynumber="65" name="HRPPD0x338e040"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x338e040_pos" unit="mm" x="0" y="-486" z="235.75"/> - </physvol> - <physvol copynumber="66" name="HRPPD0x33aa1c0"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33aa1c0_pos" unit="mm" x="121.5" y="-486" z="235.75"/> - </physvol> - <physvol copynumber="67" name="HRPPD0x33aae70"> - <volumeref ref="HRPPD0x3363c20"/> - <position name="HRPPD0x33aae70_pos" unit="mm" x="243" y="-486" z="235.75"/> - </physvol> - <physvol name="AluFrame0x3369620"> - <volumeref ref="AluFrame0x33abd50"/> - <position name="AluFrame0x3369620_pos" unit="mm" x="0" y="0" z="225.6"/> - </physvol> - </volume> - <volume name="PFRICH_World0x32e0540"> - <materialref ref="Air0x32559d0"/> - <solidref ref="PFRICH_World0x32dc1f0"/> - <physvol name="PFRICH0x32e7980"> - <volumeref ref="PFRICH0x32e7830"/> - <position name="PFRICH0x32e7980_pos" unit="mm" x="0" y="0" z="-1456.25"/> - <rotation name="PFRICH0x32e7980_rot" unit="deg" x="180" y="0" z="180"/> - </physvol> - </volume> - <bordersurface name="InnerMirror0x3361d70" surfaceproperty="InnerMirror0x33609b0"> - <physvolref ref="GasVolume0x32e86c0"/> - <physvolref ref="InnerMirror0x3361d00"/> - </bordersurface> - <bordersurface name="OuterMirror0x33639b0" surfaceproperty="OuterMirror0x33625f0"> - <physvolref ref="GasVolume0x32e86c0"/> - <physvolref ref="OuterMirror0x3363940"/> - </bordersurface> - <bordersurface name="WindowMetallization0x3366af0" surfaceproperty="WindowMetallization0x3365490"> - <physvolref ref="QuartzWindow0x33651b0"/> - <physvolref ref="CeramicBody0x3365250"/> - </bordersurface> - </structure> - - <setup name="Default" version="1.0"> - <world ref="PFRICH_World0x32e0540"/> - </setup> - -</gdml> diff --git a/compact/pid/pfrich.xml b/compact/pid/pfrich.xml index 6d4858c35..cf5d085ae 100644 --- a/compact/pid/pfrich.xml +++ b/compact/pid/pfrich.xml @@ -1,27 +1,33 @@ <!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Christopher Dilks --> +<!-- Copyright (C) 2023 Wenliang (Bill) Li --> <lccdd> <define> -<!-- vessel geometry --> + + +<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> +<!-- Actual global parameters --> <constant name="PFRICH_length" value="BackwardRICHRegion_length" /> <!-- vessel z-length --> <constant name="PFRICH_zmax" value="-BackwardRICHRegion_zmax"/> <!-- vessel front --> <constant name="PFRICH_zmin" value="PFRICH_zmax + PFRICH_length"/> <!-- vessel back --> -<constant name="PFRICH_rmin0" value="10*cm"/> <!-- bore radius at vessel frontplane; makes no sense with current asymmetric design, set to the larger dimension --> -<constant name="PFRICH_rmin1" value="10*cm"/> <!-- bore radius at vessel backplane; makes no sense with current asymmetric design, set to the larger dimension --> +<constant name="PFRICH_rmin0" value="-PFRICH_zmin * Eta3_9_tan * 0.95"/> <!-- bore radius at vessel frontplane --> +<constant name="PFRICH_rmin1" value="-PFRICH_zmax * Eta3_9_tan * 0.85"/> <!-- bore radius at vessel backplane --> <constant name="PFRICH_rmax" value="BackwardPIDRegion_rmax"/> <!-- vessel radius --> <constant name="PFRICH_bore_slope" value="(PFRICH_rmin1 - PFRICH_rmin0) / PFRICH_length"/> <!-- slope of bore radius --> -<constant name="PFRICH_proximity_gap" value="25.9*cm"/> <!-- distance between aerogel exit plane and sensor entrance plane --> + +<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> + +<constant name="PFRICH_proximity_gap" value="30*cm"/> <!-- distance between aerogel exit plane and sensor entrance plane --> <constant name="PFRICH_services_length" value="15*cm"/> <!-- span of service materials behind the sensors --> <constant name="PFRICH_wall_thickness" value="0.5*cm"/> <!-- thickness of radial walls --> <constant name="PFRICH_window_thickness" value="0.1*cm"/> <!-- thickness of entrance and exit walls --> <constant name="PFRICH_aerogel_thickness" value="3.0*cm"/> <!-- aerogel thickness --> <constant name="PFRICH_filter_thickness" value="0.3*mm"/> <!-- filter thickness --> <constant name="PFRICH_aerogel_filter_gap" value="0.01*mm"/> <!-- air gap between aerogel and filter FIXME: currently a gas gap --> -<!-- sensor geometry; model = S13361-3050NE-08 SiPM --> + <!-- FIXME: change to LAPPD(?) --> -<constant name="PFRICH_sensor_size_default" value="25.8*mm"/> <!-- sensor side length (full size, with enclosure) --> +<constant name="PFRICH_sensor_size_default" value="100*mm"/> <!-- sensor side length (full size, with enclosure) --> <constant name="PFRICH_sensor_size_lores" value="PFRICH_sensor_size_default * 4"/> <!-- lores sensor size, used for global vizualizations _only_ --> <constant name="PFRICH_sensor_size" value="PFRICH_sensor_size_default"/> <constant name="PFRICH_pixel_gap" value="0.2*mm"/> <!-- size of gaps between adjacent pixels AND gaps between edge pixels and sensor side --> @@ -30,47 +36,55 @@ <constant name="PFRICH_num_px" value="8"/> <!-- number of pixels along one side of the sensor --> <constant name="PFRICH_pixel_size" value="3.0*mm"/> <!-- a single SiPM pixel size --> <constant name="PFRICH_pixel_pitch" value="PFRICH_pixel_size + PFRICH_pixel_gap"/> <!-- center-to-center distance between SiPMs in a 8x8 panel --> -<!-- debugging switches --> -<comment> -- `PFRICH_debug_optics`: 1 = all components become vacuum; test opticalphotons from IP - 2 = all components become vacuum, except for `gasvol`, test charged particles from IP - 0 = off -</comment> + <constant name="PFRICH_debug_optics" value="0"/> </define> + <detectors> -<detectors> - - -<!-- /detectors/detector --> -<documentation level="10"> -### pfRICH: Proximity Focusing RICH -</documentation> <detector id="BackwardRICH_ID" - name="PFRICH" + name="RICHEndcapN" type="epic_PFRICH" - readout="PFRICHHits" + readout="RICHEndcapNHits" gas="C4F10_PFRICH" material="Aluminum" vis_vessel="DRICH_vessel_vis" vis_gas="DRICH_gas_vis" > + <parent name="/world_volume"/> + + <dimensions + zmin="PFRICH_zmin" + zmax="PFRICH_zmax" + length="PFRICH_length" + rmin0="PFRICH_rmin0" + rmin1="PFRICH_rmin1" + rmax0="PFRICH_rmax" + rmax1="PFRICH_rmax" + proximity_gap="PFRICH_proximity_gap" + wall_thickness="PFRICH_wall_thickness" + window_thickness="PFRICH_window_thickness" + /> + + +<sensors> + +<module + material="AirOptical" + surface="SensorSurface_DRICH" + vis="DRICH_sensor_vis" + side="PFRICH_sensor_sensitive_size" + thickness="PFRICH_sensor_thickness" + gap="0.2*mm" + /> + +<plane + rmin="PFRICH_rmin1 + 2*cm" + rmax="PFRICH_rmax - 4*cm" + /> -<!-- /detectors/detector/dimensions --> -<documentation level="10"> -#### Vessel -- dimensions: - - `zmin`: z-position of vessel front plane - - `length`: overall z-length of the full vessel - - `rmin0` and `rmin1`: bore radius at front plane and back plane, respectively - - `rmax0` and `rmax1`: outer radius of vessel, at front plane and back plane, respectively - - `proximity_gap`: z-distance between aerogel backplane and sensor-surface plane - - `wall_thickness`: thickness of radial walls - - `window_thickness`: thickness of entrance and exit disks -</documentation> <dimensions zmin="PFRICH_zmin" zmax="PFRICH_zmax" @@ -84,7 +98,6 @@ window_thickness="PFRICH_window_thickness" /> - <!-- /detectors/detector/radiator --> <documentation level="10"> #### Radiator @@ -97,37 +110,8 @@ - `thickness`: radiator thickness, defined separately for aerogel and filter - `pitch`: controls the angle of the radiator (0=vertical) </documentation> -<radiator - rmin="PFRICH_rmin0 + PFRICH_wall_thickness + 0.2*cm" - rmax="(PFRICH_rmax/PFRICH_zmax)*PFRICH_zmin + 8.0*cm" - frontplane="-PFRICH_window_thickness" - pitch="0*degree" - > - <aerogel - material="Aerogel_DRICH" - vis="DRICH_aerogel_vis" - thickness="PFRICH_aerogel_thickness" - /> - <airgap - material="AirOptical" - vis="DRICH_gas_vis" - thickness="PFRICH_aerogel_filter_gap" - /> - <filter - material="Acrylic_DRICH" - vis="DRICH_filter_vis" - thickness="PFRICH_filter_thickness" - /> -</radiator> - -<!-- /detectors/detector/sensors --> -<documentation level="10"> -#### Sensors -</documentation> -<sensors> - <!-- /detectors/detector/sensors/module --> <documentation level="10"> @@ -175,18 +159,48 @@ </services> </sensors> + +<radiator + rmin="PFRICH_rmin0 + PFRICH_wall_thickness + 0.2*cm" + rmax="(PFRICH_rmax/PFRICH_zmax)*PFRICH_zmin + 8.0*cm" + frontplane="-PFRICH_window_thickness" + pitch="0*degree" + > + <aerogel + material="Aerogel_DRICH" + vis="DRICH_aerogel_vis" + thickness="PFRICH_aerogel_thickness" + /> + <airgap + material="AirOptical" + vis="DRICH_gas_vis" + thickness="PFRICH_aerogel_filter_gap" + /> + <filter + material="Acrylic_DRICH" + vis="DRICH_filter_vis" + thickness="PFRICH_filter_thickness" + /> +</radiator> + +<mirror + material="Acrylic_DRICH" + surface="MirrorSurface_DRICH" + vis="DRICH_mirror_vis" + backplane="DRICH_window_thickness + 1.0*cm" + rmin="DRICH_rmin1 + DRICH_wall_thickness - 1.0*cm" + rmax="DRICH_rmax2 - DRICH_wall_thickness - 3.0*cm" + phiw="59.5*degree" + thickness="0.2*cm" + focus_tune_x="-7.00*cm" + focus_tune_z="6.15*cm" + /> + </detector> </detectors> -<documentation level="10"> -#### Readout -- segmentation: square matrix of pixels - - `grid_size_x,y`: size of each sensor pixel - - `offset_x,y`: specified such that the `x` and `y` values are unsigned - (except for very rare hits on the sensor sides (FIXME)) -</documentation> <readouts> - <readout name="PFRICHHits"> + <readout name="RICHEndcapNHits"> <segmentation type="CartesianGridXY" grid_size_x="PFRICH_pixel_pitch" @@ -198,5 +212,4 @@ </readout> </readouts> - </lccdd> diff --git a/compact/pid/pfrich_gdml.xml b/compact/pid/pfrich_gdml.xml deleted file mode 100644 index 9081ca19b..000000000 --- a/compact/pid/pfrich_gdml.xml +++ /dev/null @@ -1,11 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Wouter Deconinck --> - -<lccdd> - <detectors> - <detector id="BackwardRICH_ID" name="PFRICH" type="DD4hep_GdmlDetector"> - <gdmlFile ref="pfrich.gdml"/> - <parent name="/world_volume"/> - </detector> - </detectors> -</lccdd> diff --git a/configurations/pfrich_gdml_only.yml b/configurations/pfrich_gdml_only.yml deleted file mode 100644 index f143f299a..000000000 --- a/configurations/pfrich_gdml_only.yml +++ /dev/null @@ -1,6 +0,0 @@ -features: - #beampipe: - fields: - marco: - pid: - pfrich_gdml: diff --git a/src/PFRICH_geo.cpp b/src/PFRICH_geo.cpp index e99feb20e..aba06b4f7 100644 --- a/src/PFRICH_geo.cpp +++ b/src/PFRICH_geo.cpp @@ -1,9 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Christopher Dilks, Sylvester Joosten +// Copyright (C) 2023 Wenliang (Bill) Li, Alexander Kiselev, Karthik Suresh //---------------------------------- -// pfRICH: Proximity Focusing RICH -// Author: C. Dilks +// pfRICH: Proximity Focusing RICH +// Author: Wenliang (Bill) Li +// +// - Design Adapted from standalone Geant4 description by +// Alexander Kiselev and Chandradoy Chatterjee //---------------------------------- #include "DD4hep/DetFactoryHelper.h" @@ -13,326 +16,694 @@ #include "DDRec/Surface.h" #include <XML/Helper.h> +#include "XML/Layering.h" +#include "TVector3.h" +#include "TGeoElement.h" +#include "TGeoManager.h" +#include "TInterpreter.h" +#include "TUri.h" + +using namespace std; using namespace dd4hep; using namespace dd4hep::rec; +using namespace dd4hep::detail; -// create the detector -static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) -{ - - xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - xml::Component dims = detElem.dimensions(); - OpticalSurfaceManager surfMgr = desc.surfaceManager(); - DetElement det(detName, detID); - sens.setType("tracker"); - - // attributes ----------------------------------------------------------- - // - vessel - double vesselZmin = dims.attr<double>(_Unicode(zmin)); - double vesselLength = dims.attr<double>(_Unicode(length)); - double vesselRmin0 = dims.attr<double>(_Unicode(rmin0)); - double vesselRmin1 = dims.attr<double>(_Unicode(rmin1)); - double vesselRmax0 = dims.attr<double>(_Unicode(rmax0)); - double vesselRmax1 = dims.attr<double>(_Unicode(rmax1)); - double proximityGap = dims.attr<double>(_Unicode(proximity_gap)); - double wallThickness = dims.attr<double>(_Unicode(wall_thickness)); - double windowThickness = dims.attr<double>(_Unicode(window_thickness)); - auto vesselMat = desc.material(detElem.attr<std::string>(_Unicode(material))); - auto gasvolMat = desc.material(detElem.attr<std::string>(_Unicode(gas))); - auto vesselVis = desc.visAttributes(detElem.attr<std::string>(_Unicode(vis_vessel))); - auto gasvolVis = desc.visAttributes(detElem.attr<std::string>(_Unicode(vis_gas))); - // - radiator (applies to aerogel and filter) - auto radiatorElem = detElem.child(_Unicode(radiator)); - double radiatorRmin = radiatorElem.attr<double>(_Unicode(rmin)); - double radiatorRmax = radiatorElem.attr<double>(_Unicode(rmax)); - double radiatorPitch = radiatorElem.attr<double>(_Unicode(pitch)); - double radiatorFrontplane = radiatorElem.attr<double>(_Unicode(frontplane)); - // - aerogel - auto aerogelElem = radiatorElem.child(_Unicode(aerogel)); - auto aerogelMat = desc.material(aerogelElem.attr<std::string>(_Unicode(material))); - auto aerogelVis = desc.visAttributes(aerogelElem.attr<std::string>(_Unicode(vis))); - double aerogelThickness = aerogelElem.attr<double>(_Unicode(thickness)); - // - filter - auto filterElem = radiatorElem.child(_Unicode(filter)); - auto filterMat = desc.material(filterElem.attr<std::string>(_Unicode(material))); - auto filterVis = desc.visAttributes(filterElem.attr<std::string>(_Unicode(vis))); - double filterThickness = filterElem.attr<double>(_Unicode(thickness)); - // - airgap between filter and aerogel // TODO: use these to place an airgap volume - auto airgapElem = radiatorElem.child(_Unicode(airgap)); - // auto airgapMat = desc.material(airgapElem.attr<std::string>(_Unicode(material))); // TODO - // auto airgapVis = desc.visAttributes(airgapElem.attr<std::string>(_Unicode(vis))); // TODO - double airgapThickness = airgapElem.attr<double>(_Unicode(thickness)); - // - sensor module - auto sensorElem = detElem.child(_Unicode(sensors)).child(_Unicode(module)); - auto sensorMat = desc.material(sensorElem.attr<std::string>(_Unicode(material))); - auto sensorVis = desc.visAttributes(sensorElem.attr<std::string>(_Unicode(vis))); - auto sensorSurf = surfMgr.opticalSurface(sensorElem.attr<std::string>(_Unicode(surface))); - double sensorSide = sensorElem.attr<double>(_Unicode(side)); - double sensorGap = sensorElem.attr<double>(_Unicode(gap)); - double sensorThickness = sensorElem.attr<double>(_Unicode(thickness)); - auto readoutName = detElem.attr<std::string>(_Unicode(readout)); - // - sensor plane - auto sensorPlaneElem = detElem.child(_Unicode(sensors)).child(_Unicode(plane)); - double sensorPlaneRmin = sensorPlaneElem.attr<double>(_Unicode(rmin)); - double sensorPlaneRmax = sensorPlaneElem.attr<double>(_Unicode(rmax)); - // - debugging switches - long debug_optics_mode = desc.constantAsLong("PFRICH_debug_optics"); - - // if debugging optics, override some settings - bool debug_optics = debug_optics_mode > 0; - if (debug_optics) { - printout(WARNING, "PFRICH_geo", "DEBUGGING PFRICH OPTICS"); - switch (debug_optics_mode) { - case 1: - vesselMat = aerogelMat = filterMat = sensorMat = gasvolMat = desc.material("VacuumOptical"); - break; - case 2: - vesselMat = aerogelMat = filterMat = sensorMat = desc.material("VacuumOptical"); - break; - default: - printout(FATAL, "PFRICH_geo", "UNKNOWN debug_optics_mode"); - return det; - }; - aerogelVis = sensorVis; - gasvolVis = vesselVis = desc.invisible(); - }; - - // readout coder <-> unique sensor ID - /* - `sensorIDfields` is a list of readout fields used to specify a unique sensor ID - * - `cellMask` is defined such that a hit's `cellID & cellMask` is the corresponding sensor's unique ID - * - this redundant generalization is for future flexibility, and consistency with dRICH - */ - std::vector<std::string> sensorIDfields = {"module"}; - const auto& readoutCoder = *desc.readout(readoutName).idSpec().decoder(); - // determine `cellMask` based on `sensorIDfields` - uint64_t cellMask = 0; - for (const auto& idField : sensorIDfields) - cellMask |= readoutCoder[idField].mask(); - desc.add(Constant("PFRICH_cell_mask", std::to_string(cellMask))); - // create a unique sensor ID from a sensor's PlacedVolume::volIDs - auto encodeSensorID = [&readoutCoder](auto ids) { - uint64_t enc = 0; - for (const auto& [idField, idValue] : ids) - enc |= uint64_t(idValue) << readoutCoder[idField].offset(); - return enc; - }; - - // BUILD VESSEL ////////////////////////////////////// - /* - `vessel`: aluminum enclosure, the mother volume of the pfRICH - * - `gasvol`: gas volume, which fills `vessel`; all other volumes defined below - * are children of `gasvol` - */ - - // tank solids - double boreDelta = vesselRmin1 - vesselRmin0; - Cone vesselTank(vesselLength / 2.0, vesselRmin1, vesselRmax1, vesselRmin0, vesselRmax0); - Cone gasvolTank(vesselLength / 2.0 - windowThickness, vesselRmin1 + wallThickness, vesselRmax1 - wallThickness, - vesselRmin0 + wallThickness, vesselRmax0 - wallThickness); - - // extra solids for `debug_optics` only - Box vesselBox(1001, 1001, 1001); - Box gasvolBox(1000, 1000, 1000); - - // choose vessel and gasvol solids (depending on `debug_optics_mode` (0=disabled)) - Solid vesselSolid, gasvolSolid; - switch (debug_optics_mode) { - case 0: - vesselSolid = vesselTank; - gasvolSolid = gasvolTank; - break; // `!debug_optics` - case 1: - vesselSolid = vesselBox; - gasvolSolid = gasvolBox; - break; - case 2: - vesselSolid = vesselBox; - gasvolSolid = gasvolTank; - break; - }; - - // volumes - Volume vesselVol(detName, vesselSolid, vesselMat); - Volume gasvolVol(detName + "_gas", gasvolSolid, gasvolMat); - vesselVol.setVisAttributes(vesselVis); - gasvolVol.setVisAttributes(gasvolVis); - - // reference positions - // - the vessel is created such that the center of the cylindrical tank volume - // coincides with the origin; this is called the "origin position" of the vessel - // - when the vessel (and its children volumes) is placed, it is translated in - // the z-direction to be in the proper EPIC-integration location - // - these reference positions are for the frontplane and backplane of the vessel, - // with respect to the vessel origin position - auto originFront = Position(0., 0., vesselLength / 2.0); - // auto originBack = Position(0., 0., -vesselLength / 2.0); - auto vesselPos = Position(0, 0, vesselZmin) - originFront; - - // place gas volume - PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0)); - DetElement gasvolDE(det, "gasvol_de", 0); - gasvolDE.setPlacement(gasvolPV); - - // place mother volume (vessel) - Volume motherVol = desc.pickMotherVolume(det); - PlacedVolume vesselPV = motherVol.placeVolume(vesselVol, vesselPos); - vesselPV.addPhysVolID("system", detID); - det.setPlacement(vesselPV); - - // BUILD RADIATOR ////////////////////////////////////// - - // solid and volume: create aerogel and filter - Cone aerogelSolid(aerogelThickness / 2, radiatorRmin + boreDelta * aerogelThickness / vesselLength, /* at backplane */ - radiatorRmax, radiatorRmin, /* at frontplane */ - radiatorRmax); - Cone filterSolid(filterThickness / 2, - radiatorRmin + boreDelta * (aerogelThickness + airgapThickness + filterThickness) / - vesselLength, /* at backplane */ - radiatorRmax, - radiatorRmin + boreDelta * (aerogelThickness + airgapThickness) / vesselLength, /* at frontplane */ - radiatorRmax); - Volume aerogelVol(detName + "_aerogel", aerogelSolid, aerogelMat); - Volume filterVol(detName + "_filter", filterSolid, filterMat); - aerogelVol.setVisAttributes(aerogelVis); - filterVol.setVisAttributes(filterVis); - - // aerogel placement and surface properties - // TODO [low-priority]: define skin properties for aerogel and filter - // FIXME: radiatorPitch might not be working correctly (not yet used) - auto radiatorPos = Position(0., 0., radiatorFrontplane - 0.5 * aerogelThickness) + originFront; - auto aerogelPlacement = Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) * // re-center to originFront - RotationY(radiatorPitch); // change polar angle to specified pitch - auto aerogelPV = gasvolVol.placeVolume(aerogelVol, aerogelPlacement); - DetElement aerogelDE(det, "aerogel_de", 0); - aerogelDE.setPlacement(aerogelPV); - // SkinSurface aerogelSkin(desc, aerogelDE, "mirror_optical_surface", aerogelSurf, aerogelVol); - // aerogelSkin.isValid(); - - // filter placement and surface properties - PlacedVolume filterPV; - if (!debug_optics) { - auto filterPlacement = - Translation3D(0., 0., -airgapThickness) * // add an airgap - Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) * // re-center to originFront - RotationY(radiatorPitch) * // change polar angle - Translation3D(0., 0., -(aerogelThickness + filterThickness) / 2.); // move to aerogel backplane - filterPV = gasvolVol.placeVolume(filterVol, filterPlacement); - DetElement filterDE(det, "filter_de", 0); - filterDE.setPlacement(filterPV); - // SkinSurface filterSkin(desc, filterDE, "mirror_optical_surface", filterSurf, filterVol); - // filterSkin.isValid(); - }; - - // radiator z-positions (w.r.t. IP) - double aerogelZpos = vesselPos.z() + aerogelPV.position().z(); - double filterZpos = vesselPos.z() + filterPV.position().z(); - desc.add(Constant("PFRICH_aerogel_zpos", std::to_string(aerogelZpos))); - desc.add(Constant("PFRICH_filter_zpos", std::to_string(filterZpos))); - - // radiator material names - desc.add(Constant("PFRICH_aerogel_material", aerogelMat.ptr()->GetName(), "string")); - desc.add(Constant("PFRICH_filter_material", filterMat.ptr()->GetName(), "string")); - desc.add(Constant("PFRICH_gasvol_material", gasvolMat.ptr()->GetName(), "string")); - - // BUILD SENSORS /////////////////////// - - // solid and volume: single sensor module - Box sensorSolid(sensorSide / 2., sensorSide / 2., sensorThickness / 2.); - Volume sensorVol(detName + "_sensor", sensorSolid, sensorMat); - sensorVol.setVisAttributes(sensorVis); - - // sensitivity - if (!debug_optics) - sensorVol.setSensitiveDetector(sens); - - // sensor plane positioning: we want `proximityGap` to be the distance between the - // aerogel backplane (i.e., aerogel/filter boundary) and the sensor active surface (e.g, photocathode) - double sensorZpos = radiatorFrontplane - aerogelThickness - proximityGap - 0.5 * sensorThickness; - auto sensorPlanePos = Position(0., 0., sensorZpos) + originFront; // reference position - // miscellaneous - int imod = 0; // module number - double tBoxMax = vesselRmax1; // sensors will be tiled in tBox, within annular limits - - // SENSOR MODULE LOOP ------------------------ - /* cartesian tiling loop - * - start at (x=0,y=0), to center the grid - * - loop over positive-x positions; for each, place the corresponding negative-x sensor too - * - nested similar loop over y positions - */ - double sx, sy; - for (double usx = 0; usx <= tBoxMax; usx += sensorSide + sensorGap) { - for (int sgnx = 1; sgnx >= (usx > 0 ? -1 : 1); sgnx -= 2) { - for (double usy = 0; usy <= tBoxMax; usy += sensorSide + sensorGap) { - for (int sgny = 1; sgny >= (usy > 0 ? -1 : 1); sgny -= 2) { - - // sensor (x,y) center - sx = sgnx * usx; - sy = sgny * usy; - - // annular cut - if (std::hypot(sx, sy) < sensorPlaneRmin || std::hypot(sx, sy) > sensorPlaneRmax) - continue; - - // placement (note: transformations are in reverse order) - auto sensorPlacement = Transform3D( - Translation3D(sensorPlanePos.x(), sensorPlanePos.y(), sensorPlanePos.z()) * // move to reference position - Translation3D(sx, sy, 0.) // move to grid position - ); - auto sensorPV = gasvolVol.placeVolume(sensorVol, sensorPlacement); - - // generate LUT for module number -> sensor position, for readout mapping tests - // printf("%d %f %f\n",imod,sensorPV.position().x(),sensorPV.position().y()); - - // properties - sensorPV.addPhysVolID("module", imod); // NOTE: must be consistent with `sensorIDfields` - auto imodEnc = encodeSensorID(sensorPV.volIDs()); - DetElement sensorDE(det, "sensor_de_" + std::to_string(imod), imodEnc); - sensorDE.setPlacement(sensorPV); - if (!debug_optics) { - SkinSurface sensorSkin(desc, sensorDE, "sensor_optical_surface_" + std::to_string(imod), sensorSurf, - sensorVol); - sensorSkin.isValid(); - }; - - // increment sensor module number - imod++; - }; - }; +static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector sens) { + + xml_det_t x_det = e; + int det_id = x_det.id(); + + string det_name = x_det.nameStr(); + Material air = description.air(); + + DetElement sdet(det_name, det_id); + + std::vector<double> rmins = {100, 100}; + std::vector<double> rmaxs = {1300, 1300}; + std::vector<double> zs = {-5000, 5000}; + + sens.setType("tracker"); + description.invisible(); + + xml::DetElement detElem = e; + std::string detName = detElem.nameStr(); + xml::Component dims = detElem.dimensions(); + + xml_dim_t x_par(x_det.child(_U(parent))); + + string name = x_det.nameStr(); + string par_nam = x_par.nameStr(); + DetElement det_parent = description.detector(par_nam); + + Volume mother = det_parent.volume(); + PlacedVolume pv; + + int id = x_det.hasAttr(_U(id)) ? x_det.id() : 0; + xml_dim_t x_pos(x_det.child(_U(position), false)); + xml_dim_t x_rot(x_det.child(_U(rotation), false)); + + auto vesselMat = description.material("VacuumOptical"); + + Tube pfRICH_air_volume(0.0, 65.0, 25.0); // dimension of the pfRICH world in cm + + Rotation3D rot(RotationZYX(0, M_PI, 0)); + Transform3D transform(rot, Position(0, 0, -149)); + + // BUILD SENSORS /////////////////////// + // solid and volume: single sensor module + + OpticalSurfaceManager surfMgr = description.surfaceManager(); + + // - sensor module + auto sensorElem = detElem.child(_Unicode(sensors)).child(_Unicode(module)); + auto sensorMat = description.material(sensorElem.attr<std::string>(_Unicode(material))); + auto sensorVis = description.visAttributes(sensorElem.attr<std::string>(_Unicode(vis))); + auto sensorSurf = surfMgr.opticalSurface(sensorElem.attr<std::string>(_Unicode(surface))); + double sensorSide = sensorElem.attr<double>(_Unicode(side)); + double sensorThickness = sensorElem.attr<double>(_Unicode(thickness)); + auto readoutName = detElem.attr<std::string>(_Unicode(readout)); + + double vesselRmin0 = dims.attr<double>(_Unicode(rmin0)); + double vesselRmin1 = dims.attr<double>(_Unicode(rmin1)); + double vesselRmax0 = dims.attr<double>(_Unicode(rmax0)); + double vesselRmax1 = dims.attr<double>(_Unicode(rmax1)); + + int imod = 0; // module number + + auto gasvolMat = description.material("C4F10_PFRICH"); + auto gasvolVis = description.visAttributes("DRICH_gas_vis"); + auto vesselVis = description.visAttributes("DRICH_gas_vis"); + + double windowThickness = dims.attr<double>(_Unicode(window_thickness)); + double wallThickness = dims.attr<double>(_Unicode(wall_thickness)); + + double proximityGap = dims.attr<double>(_Unicode(proximity_gap)); + + long debug_optics_mode = description.constantAsLong("PFRICH_debug_optics"); + + bool debug_optics = debug_optics_mode > 0; + + auto radiatorElem = detElem.child(_Unicode(radiator)); + double radiatorFrontplane = radiatorElem.attr<double>(_Unicode(frontplane)); + + auto aerogelElem = radiatorElem.child(_Unicode(aerogel)); + double aerogelThickness = aerogelElem.attr<double>(_Unicode(thickness)); + + double radiatorRmin = radiatorElem.attr<double>(_Unicode(rmin)); + double radiatorRmax = radiatorElem.attr<double>(_Unicode(rmax)); + + double airgapThickness = 0.1; + double filterThickness = 1; + + auto aerogelMat = description.material("C4F10_PFRICH"); + auto filterMat = description.material("C4F10_PFRICH"); + + double vesselLength = dims.attr<double>(_Unicode(length)); + auto originFront = Position(0., 0., vesselLength / 2.0); + double sensorZpos = radiatorFrontplane - aerogelThickness - proximityGap - 0.5 * sensorThickness; + auto sensorPlanePos = Position(0., 0., sensorZpos) + originFront; // reference position + + // readout coder <-> unique sensor ID + /* - `sensorIDfields` is a list of readout fields used to specify a unique sensor ID + * - `cellMask` is defined such that a hit's `cellID & cellMask` is the corresponding sensor's unique ID + * - this redundant generalization is for future flexibility, and consistency with dRICH + */ + + std::vector<std::string> sensorIDfields = {"module"}; + const auto& readoutCoder = *description.readout(readoutName).idSpec().decoder(); + // determine `cellMask` based on `sensorIDfields` + uint64_t cellMask = 0; + for (const auto& idField : sensorIDfields) + cellMask |= readoutCoder[idField].mask(); + description.add(Constant("PFRICH_cell_mask", std::to_string(cellMask))); + // create a unique sensor ID from a sensor's PlacedVolume::volIDs + auto encodeSensorID = [&readoutCoder](auto ids) { + uint64_t enc = 0; + for (const auto& [idField, idValue] : ids) + enc |= uint64_t(idValue) << readoutCoder[idField].offset(); + return enc; }; - }; - // END SENSOR MODULE LOOP ------------------------ - // - // Add service material if desired - if (detElem.child("sensors").hasChild(_Unicode(services))) { - xml_comp_t x_service = detElem.child("sensors").child(_Unicode(services)); - Assembly service_vol("services"); - service_vol.setVisAttributes(desc, x_service.visStr()); - - // Compute service total thickness from components - double total_thickness = 0; - for (xml_coll_t ci(x_service, _Unicode(component)); ci; ++ci) { - total_thickness += xml_comp_t(ci).thickness(); - } - int ncomponents = 0; - double thickness_sum = -total_thickness / 2.0; - for (xml_coll_t ci(x_service, _Unicode(component)); ci; ++ci, ncomponents++) { - xml_comp_t x_comp = ci; - double thickness = x_comp.thickness(); - Tube c_tube{sensorPlaneRmin, sensorPlaneRmax, thickness / 2}; - Volume c_vol{_toString(ncomponents, "component%d"), c_tube, desc.material(x_comp.materialStr())}; - c_vol.setVisAttributes(desc, x_comp.visStr()); - service_vol.placeVolume(c_vol, Position(0, 0, thickness_sum + thickness / 2.0)); - thickness_sum += thickness; + auto mirrorElem = detElem.child(_Unicode(mirror)); + auto mirrorMat = description.material(mirrorElem.attr<std::string>(_Unicode(material))); + auto mirrorVis = description.visAttributes(mirrorElem.attr<std::string>(_Unicode(vis))); + + Cone mirror_cone(vesselLength / 2.0, vesselRmax1-7, vesselRmax1-7+0.3, vesselRmax1-13, vesselRmax1-13+0.3); + + // flange + + float _FLANGE_EPIPE_DIAMETER_ = 10.53; // in cm + float _FLANGE_HPIPE_DIAMETER_ = 4.47; // in cm + float _FLANGE_HPIPE_OFFSET_ = 6.76; // in cm + float clearance = 0.5; // in cm + + /// Inner mirror cone + // A wedge bridging two cylinders; + + Tube eflange(0.0, _FLANGE_EPIPE_DIAMETER_/2 + clearance, 25); + Tube hflange(0.0, _FLANGE_HPIPE_DIAMETER_/2 + clearance, 25); + + double r0 = _FLANGE_EPIPE_DIAMETER_/2 + clearance; + double r1 = _FLANGE_HPIPE_DIAMETER_/2 + clearance; + double L = _FLANGE_HPIPE_OFFSET_; + double a = r0*L/(r0-r1); + double b = r0*r0/a; + double c = r1*(a-b)/r0; + + // GEANT variables to define G4Trap; + double pDz = 25, pTheta = 0.0, pPhi = 0.0, pDy1 = (a - b - c)/2, pDy2 = pDy1; + double pDx1 = sqrt(r0*r0 - b*b), pDx2 = pDx1*r1/r0, pDx3 = pDx1, pDx4 = pDx2, pAlp1 = 0.0, pAlp2 = 0.0; + + Trap wedge(pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2); + + UnionSolid flange_shape(eflange, hflange, Position(-_FLANGE_HPIPE_OFFSET_, 0.0, 0.0)); + Rotation3D rZ(RotationZYX(M_PI/2.0, 0.0, 0.0)); + Transform3D transform_flange(rZ, Position(-b - pDy1, 0.0, 0.0)); + UnionSolid flange_final_shape(flange_shape, wedge, transform_flange); + + Volume flangeVol(detName + "_flange", flange_final_shape, mirrorMat); + flangeVol.setVisAttributes(mirrorVis); + + SubtractionSolid pfRICH_volume_shape(pfRICH_air_volume, flange_final_shape); + + Volume pfRICH_volume(detName +"_Vol", pfRICH_volume_shape, vesselMat); // dimension of the pfRICH world in cm + + pv = mother.placeVolume(pfRICH_volume, transform); + + if (id != 0) { + pv.addPhysVolID("system", id); } - gasvolVol.placeVolume(service_vol, - Transform3D(Translation3D(sensorPlanePos.x(), sensorPlanePos.y(), - sensorPlanePos.z() - sensorThickness / 2 - total_thickness / 2))); - } + sdet.setPlacement(pv); + + /// tank solids + + double boreDelta = vesselRmin1 - vesselRmin0; + Cone vesselTank(vesselLength / 2.0, vesselRmin1, vesselRmax1, vesselRmin0, vesselRmax0); + Cone gasvolTank(vesselLength / 2.0 - windowThickness, vesselRmin1 + wallThickness, vesselRmax1 - wallThickness, + vesselRmin0 + wallThickness, vesselRmax0 - wallThickness); + + Box gasvolBox(1000, 1000, 1000); + + Solid gasvolSolid; + gasvolSolid = gasvolTank; + + Solid vesselSolid; + vesselSolid = vesselTank; + + Solid mirrorSolid; + mirrorSolid = mirror_cone; + + Volume vesselVol(detName, vesselSolid, vesselMat); + Volume gasvolVol(detName + "_gas", gasvolSolid, gasvolMat); + vesselVol.setVisAttributes(vesselVis); + gasvolVol.setVisAttributes(gasvolVis); + + Volume mirrorVol(detName, mirrorSolid, mirrorMat); + mirrorVol.setVisAttributes(mirrorVis); + + // place gas volume + PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0)); + DetElement gasvolDE(sdet, "gasvol_de", 0); + gasvolDE.setPlacement(gasvolPV); + + // BUILD RADIATOR ////////////////////////////////////// + + // solid and volume: create aerogel and filter + Cone aerogelSolid(aerogelThickness / 2, radiatorRmin + boreDelta * aerogelThickness / vesselLength, /* at backplane */ + radiatorRmax, radiatorRmin, /* at frontplane */ + radiatorRmax); + Cone filterSolid(filterThickness / 2, + radiatorRmin + boreDelta * (aerogelThickness + airgapThickness + filterThickness) / + vesselLength, /* at backplane */ + radiatorRmax, + radiatorRmin + boreDelta * (aerogelThickness + airgapThickness) / vesselLength, /* at frontplane */ + radiatorRmax); + Volume aerogelVol(detName + "_aerogel", aerogelSolid, aerogelMat); + Volume filterVol(detName + "_filter", filterSolid, filterMat); + + // radiator material names + description.add(Constant("PFRICH_aerogel_material", aerogelMat.ptr()->GetName(), "string")); + description.add(Constant("PFRICH_filter_material", filterMat.ptr()->GetName(), "string")); + description.add(Constant("PFRICH_gasvol_material", gasvolMat.ptr()->GetName(), "string")); + + Box sensorSolid(sensorSide / 2., sensorSide / 2., sensorThickness / 2.); + Volume sensorVol(detName + "_sensor", sensorSolid, sensorMat); + sensorVol.setVisAttributes(sensorVis); + + // -- Mirrors --------------------------------------------------------------------------------- + // Some "standard" value applied to all mirrors; + // At the downstream (sensor plane) location; upstream radii are calculated automatically; + double _CONICAL_MIRROR_INNER_RADIUS_ = 12.0; + double _CONICAL_MIRROR_OUTER_RADIUS_ = 57.0; + + double _INNER_MIRROR_THICKNESS_ = 0.1; //0.29*_INCH + double _OUTER_MIRROR_THICKNESS_ = 0.2; //0.54*_INCH + + /// Detailed sensor description + + double _FIDUCIAL_VOLUME_LENGTH_ = 49.1; // cm + double _SENSOR_AREA_LENGTH_ = 5; // cm + double _HRPPD_CENTRAL_ROW_OFFSET_ = 4.0; // cm + double _HRPPD_WINDOW_THICKNESS_ = 0.38; // cm + double _HRPPD_CONTAINER_VOLUME_HEIGHT_ = 3.2; // cm + double _HRPPD_INSTALLATION_GAP_ = 0.25; // cm + + double _HRPPD_SUPPORT_GRID_BAR_HEIGHT_ = 0.2; + + double _HRPPD_TILE_SIZE_ = 12.0; // cm + double _HRPPD_OPEN_AREA_SIZE_ = 11.4; // cm + double _HRPPD_ACTIVE_AREA_SIZE_ = 10.8; // cm + double _HRPPD_CERAMIC_BODY_THICKNESS_ = 0.9; // cm + double _HRPPD_BASEPLATE_THICKNESS_ = 0.3; // cm + double _HRPPD_PLATING_LAYER_THICKNESS_ = 0.006; // cm + double _EFFECTIVE_MCP_THICKNESS_ = 2*0.06*0.3; // cm + + double _READOUT_PCB_THICKNESS_ = 0.2; + double _READOUT_PCB_SIZE_ = _HRPPD_OPEN_AREA_SIZE_ - 0.2; + + double _ASIC_SIZE_XY_ = 1.6; + double _ASIC_THICKNESS_ = 0.1; + + double xysize = _HRPPD_TILE_SIZE_, wndthick = _HRPPD_WINDOW_THICKNESS_; + + // HRPPD assembly container volume; + double hrppd_container_volume_thickness = _HRPPD_CONTAINER_VOLUME_HEIGHT_; + + double _ACRYLIC_THICKNESS_ = 0.3; + + // HRPPD + Box hrppd_Solid(xysize/2, xysize/2, hrppd_container_volume_thickness/2); + + Volume hrppdVol_air(detName + "_air_hrppd", hrppd_Solid, air); + Volume hrppdVol(detName + "_hrppd", hrppd_Solid, sensorMat); + + hrppdVol_air.setVisAttributes(gasvolVis); + DetElement hrppdDE(sdet, "hrppd_de", 0); + + // Quartz Window + Box wnd_Solid(xysize/2, xysize/2, wndthick/2); + + Volume wndVol(detName + "_wnd", wnd_Solid, gasvolMat); + wndVol.setVisAttributes(gasvolVis); + + double accu = -hrppd_container_volume_thickness/2; + + PlacedVolume wndPV = hrppdVol_air.placeVolume(wndVol, Position(0, 0, accu + wndthick/2)); + + DetElement wndDE(hrppdDE, "wnd_de", 0); + wndDE.setPlacement(wndPV); + + // double pitch = xysize + _HRPPD_INSTALLATION_GAP_; + double xyactive = _HRPPD_ACTIVE_AREA_SIZE_; + double xyopen = _HRPPD_OPEN_AREA_SIZE_; + double certhick = _HRPPD_CERAMIC_BODY_THICKNESS_;//, zcer = azOffset + wndthick + certhick/2; + + accu += wndthick; + + // Ceramic body + Box cerbox(xysize/2, xysize/2, certhick/2); + Box cut_box(xyopen/2, xyopen/2, certhick/2); + + SubtractionSolid ceramic (cerbox, cut_box, Position(0,0, -_HRPPD_BASEPLATE_THICKNESS_)); + + Volume ceramicVol(detName + "_ceramic", ceramic, air); + ceramicVol.setVisAttributes(gasvolVis); + + PlacedVolume ceramicPV = hrppdVol_air.placeVolume(ceramicVol, Position(0.0, 0.0, accu + certhick/2)); + DetElement ceramicDE(sdet, "ceramic_de", 0); + ceramicDE.setPlacement(ceramicPV); + + // Plating body + + Box plating_solid(xyopen/2, xyopen/2, _HRPPD_PLATING_LAYER_THICKNESS_/2); + Volume platingVol( detName + "_plating", plating_solid, air); + + platingVol.setVisAttributes(gasvolVis); + PlacedVolume platingPV = hrppdVol_air.placeVolume(platingVol, Position(0.0, 0.0, accu + certhick/2)); + DetElement platingDE(sdet, "plating_de", 0); + platingDE.setPlacement(platingPV); + + // MCP body + + Box mcp_solid( xyopen/2, xyopen/2, _EFFECTIVE_MCP_THICKNESS_/2); + Volume mcpVol( detName + "_mcp", mcp_solid, air); + + mcpVol.setVisAttributes(gasvolVis); + PlacedVolume mcpPV = hrppdVol_air.placeVolume(mcpVol, Position(0.0, 0.0, accu + certhick/2 + + _HRPPD_PLATING_LAYER_THICKNESS_/2 + _EFFECTIVE_MCP_THICKNESS_/2)); + DetElement mcpDE(sdet, "mcp_de", 0); + mcpDE.setPlacement(mcpPV); + + double pdthick = 0.001; + + Box pdbox_solid(xyactive/2, xyactive/2, pdthick/2); + Volume pdboxVol( detName + "_pd", pdbox_solid, air); + + pdboxVol.setVisAttributes(gasvolVis); + PlacedVolume pdboxPV = hrppdVol_air.placeVolume(pdboxVol, Position(0.0, 0.0, accu + pdthick + pdthick/2)); + + DetElement pdboxDE(sdet, "pdbox_de", 0); + pdboxDE.setPlacement(pdboxPV); + + Box qdbox_solid(xyactive/2, xyactive/2, pdthick/2); + Volume qdboxVol( detName + "_qd", qdbox_solid, air); + + qdboxVol.setVisAttributes(gasvolVis); + PlacedVolume qdboxPV = hrppdVol_air.placeVolume(qdboxVol, Position(0.0, 0.0, accu + pdthick/2)); + + DetElement qdboxDE(sdet, "qdbox_de", 0); + pdboxDE.setPlacement(qdboxPV); + + accu += certhick + 1*mm; + + /// PCB Board + + Box pcb_solid (_READOUT_PCB_SIZE_/2, _READOUT_PCB_SIZE_/2, _READOUT_PCB_THICKNESS_/2); + Volume pcbVol( detName + "_pcb", pcb_solid, air); + + pcbVol.setVisAttributes(gasvolVis); + PlacedVolume pcbPV = hrppdVol_air.placeVolume(pcbVol, Position(0.0, 0.0, accu + _READOUT_PCB_THICKNESS_ /2)); + + DetElement pcbDE(sdet, "pcb_de", 0); + pcbDE.setPlacement(pcbPV); + + accu += _READOUT_PCB_THICKNESS_ + 0.001; + + // ASIC Board + + Box asic_solid( _ASIC_SIZE_XY_/2, _ASIC_SIZE_XY_/2, _ASIC_THICKNESS_/2); + Volume asicVol( detName + "_asic", asic_solid, mirrorMat); + asicVol.setVisAttributes(mirrorVis); + + double asic_pitch = _READOUT_PCB_SIZE_/2; + + imod = 0; + + for(unsigned ix=0; ix<2; ix++) { + double xOffset = asic_pitch*(ix - (2-1)/2.); + + for(unsigned iy=0; iy<2; iy++) { + double yOffset = asic_pitch*(iy - (2-1)/2.); + + auto asicPV = hrppdVol_air.placeVolume(asicVol, Position(xOffset, yOffset, accu + _ASIC_THICKNESS_/2)); + + DetElement asicDE(sdet, "asic_de_" + std::to_string(imod), 0); + asicDE.setPlacement(asicPV); + + imod++; + + } //for iy + } //for ix + + accu += _ASIC_THICKNESS_ + 0.01*mm; + + // Loading the coordinates + + unsigned const hdim = 9; + const unsigned flags[hdim][hdim] = { + // NB: WYSIWIG fashion; well, it is top/ bottom and left/right symmetric; + {0, 0, 1, 1, 1, 1, 1, 0, 0}, + {0, 1, 1, 1, 1, 1, 1, 1, 0}, + {1, 1, 1, 1, 1, 1, 1, 1, 1}, + {1, 1, 1, 1, 2, 1, 1, 1, 1}, + {3, 3, 3, 4, 0, 2, 1, 1, 1}, + {1, 1, 1, 1, 2, 1, 1, 1, 1}, + {1, 1, 1, 1, 1, 1, 1, 1, 1}, + {0, 1, 1, 1, 1, 1, 1, 1, 0}, + {0, 0, 1, 1, 1, 1, 1, 0, 0} + }; + + std::vector<std::pair<TVector2, bool>> coord; + + for(unsigned ix=0; ix<hdim; ix++) { + double xOffset = (_HRPPD_TILE_SIZE_ + _HRPPD_INSTALLATION_GAP_)*(ix - (hdim-1)/2.); + + for(unsigned iy=0; iy<hdim; iy++) { + double yOffset = (_HRPPD_TILE_SIZE_ + _HRPPD_INSTALLATION_GAP_)*(iy - (hdim-1)/2.); + unsigned flag = flags[hdim-iy-1][ix]; + + if (!flag) continue; + + double qxOffset = xOffset + (flag >= 3 ? -_HRPPD_CENTRAL_ROW_OFFSET_ : 0.0); + coord.push_back(std::make_pair(TVector2(qxOffset, yOffset), flag%2)); + } //for iy + } //for ix + + /// Set sensors into the coordinates + /// + for(auto xyptr: coord) { + auto &xy = xyptr.first; + + double sx = xy.X(); + double sy = xy.Y(); + + // placement (note: transformations are in reverse order) + auto sensorPlacement = Transform3D( + Translation3D(sensorPlanePos.x(), sensorPlanePos.y(), sensorPlanePos.z() + 34) * // move to reference position + Translation3D(sx, sy, 0.) // move to grid position + ); + + auto sensorPV = pfRICH_volume.placeVolume(hrppdVol_air, sensorPlacement); + + // properties + sensorPV.addPhysVolID("module", imod); // NOTE: must be consistent with `sensorIDfields` + auto imodEnc = encodeSensorID(sensorPV.volIDs()); + DetElement sensorDE(sdet, "sensor_de_" + std::to_string(imod), imodEnc); + sensorDE.setPlacement(sensorPV); + if (!debug_optics) { + SkinSurface sensorSkin(description, sensorDE, "sensor_optical_surface_" + std::to_string(imod), sensorSurf, + sensorVol); + sensorSkin.isValid(); + }; + + // increment sensor module number + imod++; + + } + + /// Aerogel + + float _AEROGEL_INNER_WALL_THICKNESS_ = 0.01; + + float _VESSEL_INNER_WALL_THICKNESS_ = 0.29 * 2.54; + + float _VESSEL_OUTER_WALL_THICKNESS_ = 0.54 * 2.54;; + + float _VESSEL_OUTER_RADIUS_ = 63.8; + + double _VESSEL_FRONT_SIDE_THICKNESS_ = 0.29*2.54; + + double m_gas_volume_length = _FIDUCIAL_VOLUME_LENGTH_ - _VESSEL_FRONT_SIDE_THICKNESS_ - _SENSOR_AREA_LENGTH_; + double m_gas_volume_radius = _VESSEL_OUTER_RADIUS_ - _VESSEL_OUTER_WALL_THICKNESS_; + + float _FLANGE_CLEARANCE_ = 0.5; + float _BUILDING_BLOCK_CLEARANCE_ = 0.1; + + const int _AEROGEL_BAND_COUNT_ = 3; + + float _AEROGEL_SEPARATOR_WALL_THICKNESS_ = 0.05; + + float _AEROGEL_OUTER_WALL_THICKNESS_ = 0.1; + + float m_r0min = _FLANGE_EPIPE_DIAMETER_/2 + _FLANGE_CLEARANCE_ + _VESSEL_INNER_WALL_THICKNESS_ + _BUILDING_BLOCK_CLEARANCE_; + float m_r0max = m_gas_volume_radius - _BUILDING_BLOCK_CLEARANCE_; + + const unsigned adim[_AEROGEL_BAND_COUNT_] = {9, 14, 20}; + double rheight = (m_r0max - m_r0min - (_AEROGEL_BAND_COUNT_-1)*_AEROGEL_SEPARATOR_WALL_THICKNESS_ - + _AEROGEL_INNER_WALL_THICKNESS_ - _AEROGEL_OUTER_WALL_THICKNESS_) / _AEROGEL_BAND_COUNT_; + + double agthick = 2.5; // cm + + double m_gzOffset = m_gas_volume_length/2 + _BUILDING_BLOCK_CLEARANCE_ + agthick/2; + + string aerogel_name = "a1040"; + + int kkcounter = 0; + + for(unsigned ir=0; ir<_AEROGEL_BAND_COUNT_; ir++) { + int counter = ir ? -1 : 0; + double apitch = 360*degree / adim[ir]; + double aerogel_r0 = m_r0min + _AEROGEL_INNER_WALL_THICKNESS_ + ir*(_AEROGEL_SEPARATOR_WALL_THICKNESS_ + rheight); + double aerogel_r1 = aerogel_r0 + rheight; + double rm = (aerogel_r0+aerogel_r1)/2; + + // Calculate angular space occupied by the spacers and by the tiles; no gas gaps for now; + // assume that a wegde shape is good enough (GEANT visualization does not like boolean objects), + // rather than creating constant thicjkess azimuthal spacers; just assume that spacer thickness is + // _AEROGEL_FRAME_WALL_THICKNESS_ at r=rm; + double l0 = 2*M_PI*rm/adim[ir]; + double l1 = _AEROGEL_SEPARATOR_WALL_THICKNESS_; + double lsum = l0 + l1; + + // FIXME: names overlap in several places!; + double wd0 = (l0/lsum)*(360*degree / adim[ir]); + double wd1 = (l1/lsum)*(360*degree / adim[ir]); + TString ag_name = "Tmp", sp_name = "Tmp"; + + if (ir) ag_name.Form("%s-%d-00", aerogel_name.c_str(), ir); + if (ir) sp_name.Form("A-Spacer--%d-00", ir); + + Tube agtube(aerogel_r0, aerogel_r1, agthick/2, 0*degree, wd0); + Tube sptube(aerogel_r0, aerogel_r1, agthick/2, wd0, wd0 + wd1); + + for(unsigned ia=0; ia<adim[ir]; ia++) { + + Rotation3D r_aerogel_Z(RotationZYX(ia*apitch, 0.0, 0.0)); + Rotation3D r_aerogel_Zinv(RotationZYX(-1.*ia*apitch, 0.0, 0.0)); + + if (ir) { + ag_name.Form("%s-%d-%02d", "aerogel", ir, ia); + + Volume agtubeVol(ag_name.Data(), agtube, gasvolMat); + auto aerogelTilePlacement = Transform3D(r_aerogel_Z, Position(0.0, 0.0, -m_gzOffset)); + auto aerogelTilePV = pfRICH_volume.placeVolume(agtubeVol, aerogelTilePlacement); + DetElement aerogelDE(sdet, "aerogel_de_" + std::to_string(kkcounter), 0); + aerogelDE.setPlacement(aerogelTilePV); + + Volume sptubeVol(detName + "_sptube", sptube, mirrorMat); + auto sptubePlacement = Transform3D(r_aerogel_Z, Position(0.0, 0.0, -m_gzOffset)); + auto sptubePV = pfRICH_volume.placeVolume(sptubeVol, sptubePlacement); + DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(kkcounter), 0); + sptubeDE.setPlacement(sptubePV); + + } else { + + ag_name.Form("%s-%d-%02d", "aerogel_inner", ir, ia); + + Tube agtube_inner(aerogel_r0, aerogel_r1, agthick/2, 0*degree + ia*apitch, wd0 + ia*apitch); + SubtractionSolid agsub (agtube_inner, flange_final_shape); + Volume agsubtubeVol(ag_name.Data(), agsub, gasvolMat); + auto aerogelTilePlacement = Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); + auto agsubTilePV = pfRICH_volume.placeVolume(agsubtubeVol, aerogelTilePlacement); + + DetElement aerogelDE(sdet, "agsubTile_de_" + std::to_string(counter), 0); + aerogelDE.setPlacement(agsubTilePV); + + sp_name.Form("%s-%d-%02d", "sp_inner", ir, ia); + Tube sptube_inner(aerogel_r0, aerogel_r1, agthick/2, wd0 + ia*apitch, wd0+wd1 + ia*apitch); + + SubtractionSolid spsub (sptube_inner, flange_final_shape); + Volume spsubtubeVol(sp_name.Data(), spsub, mirrorMat); + auto spTilePlacement = Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); + auto spsubTilePV = pfRICH_volume.placeVolume(spsubtubeVol, spTilePlacement); + + DetElement sptubeTileDE(sdet, "sptubeTile_de_" + std::to_string(counter), 0); + sptubeTileDE.setPlacement(spsubTilePV); + + sp_name.Form("A-Spacer--%d-%02d", ir, ia); + + } //if + + counter++; + kkcounter++; + + } //for ia + } // for ir + + // Placing radial spacer + + double sp_accu = m_r0min; + int tube_counter = 0; + + for(unsigned ir=0; ir<_AEROGEL_BAND_COUNT_+1; ir++) { + double thickness = ir ? (ir == _AEROGEL_BAND_COUNT_ ? _AEROGEL_OUTER_WALL_THICKNESS_ : + _AEROGEL_SEPARATOR_WALL_THICKNESS_) : _AEROGEL_INNER_WALL_THICKNESS_; + double sp_r0 = sp_accu; + double sp_r1 = sp_r0 + thickness; + + TString sp_name = "Tmp"; if (ir) sp_name.Form("R-Spacer--%d-00", ir); + + Tube sptube(sp_r0, sp_r1, agthick/2, 0*degree, 360*degree); + Volume sptubeVol(detName + "_radial_sptube", sptube, sensorMat); + auto sptubePlacement = Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); + + if (ir) { + + auto sptubePV = pfRICH_volume.placeVolume(sptubeVol, sptubePlacement); + + DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(tube_counter), 0); + sptubeDE.setPlacement(sptubePV); + + } + + else { + + SubtractionSolid spsub (sptube, flange_final_shape); + Volume agsubtubeVol(detName + "_radial_sptube_inner", spsub, gasvolMat); + + auto sptubePV = pfRICH_volume.placeVolume(agsubtubeVol, sptubePlacement); + + DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(tube_counter), 0); + sptubeDE.setPlacement(sptubePV); + + } //if + + sp_accu += thickness + rheight; + + tube_counter++; + + } //for ir + + /// Mirror construction + + double mlen = m_gas_volume_length - _BUILDING_BLOCK_CLEARANCE_; + + mlen -= _BUILDING_BLOCK_CLEARANCE_ + _HRPPD_SUPPORT_GRID_BAR_HEIGHT_; + + double mirror_r0[2] = {m_r0min, m_r0max}; + double mirror_r1[2] = {_CONICAL_MIRROR_INNER_RADIUS_, _CONICAL_MIRROR_OUTER_RADIUS_}; + + for(unsigned im=0; im<2; im++) { + + double mirror_thickness = im ? _OUTER_MIRROR_THICKNESS_ : _INNER_MIRROR_THICKNESS_; + + if (im) { + + Cone mirror_outer_cone_shape(mlen/2.0, mirror_r0[im], mirror_r0[im] + mirror_thickness, mirror_r1[im], mirror_r1[im] + mirror_thickness); + + Volume outer_mirrorVol(detName +"_outer_mirror", mirror_outer_cone_shape, mirrorMat); + + PlacedVolume mirror_outerPV = pfRICH_volume.placeVolume(outer_mirrorVol, Position(0, 0, 0)); + + DetElement mirror_outerDE(sdet, "_outer_mirror_de" , 0); + mirror_outerDE.setPlacement(mirror_outerPV); + + } else { + + Cone mirror_inner_cone_shape(mlen/2., mirror_r0[im], mirror_r0[im] + mirror_thickness, mirror_r1[im], mirror_r1[im] + mirror_thickness); + + SubtractionSolid mirror_inner_sub (mirror_inner_cone_shape, flange_final_shape); + + + Volume inner_mirrorVol(detName +"_inner_mirror", mirror_inner_sub, mirrorMat); + + PlacedVolume mirror_innerPV = pfRICH_volume.placeVolume(inner_mirrorVol, Position(0, 0, 0)); + + DetElement mirror_innerDE(sdet, "_inner_mirror_de" , 0); + mirror_innerDE.setPlacement(mirror_innerPV); + + } + + } //for im + + // Acrylic filter + + double acthick = _ACRYLIC_THICKNESS_; + // m_gzOffset += acthick/2; + + Tube ac_tube(m_r0min+3, m_r0max-1, acthick/2, 0*degree, 360*degree); + SubtractionSolid ac_shape(ac_tube, flange_final_shape); + + Volume acVol(detName +"_ac", ac_shape, gasvolMat); + + PlacedVolume ac_PV = pfRICH_volume.placeVolume(acVol, Position(0, 0, -21.3)); + + DetElement acDE(sdet, "ac_de" , 0); + acDE.setPlacement(ac_PV); + + return sdet; - return det; } // clang-format off From dd9910164c627ec4843088509f1f52637e840a73 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Wed, 27 Mar 2024 13:25:31 -0500 Subject: [PATCH 056/113] feat: dRICH sensor boxes in more realistic sector segments (#684) ### Briefly, what does this PR introduce? Until now the dRICH sensor boxes were a 5cm larger outer radius cylinder sticking out of the gas volume. This did not leave room for service routing between the sectors of the dRICH. This PR modifies the sensor boxes (and envelope volume) to be a cylinder segment of configurable delta phi (set to 48 degrees to fit the sensors). The sections between the segments are conical (polycone), as per both services routing cad and recent TIC presentation. TODO: - [x] #683 - [x] polycone rmin at middle z-plane should be linerp of outer z-plane rmin values, not the current front z-plane rmin (may overlap with beam pipe but is incorrect in any case) ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, adds azimuthally smaller sensor boxes, with side walls that have locally higher X0 expected --- compact/pid/drich.xml | 1 + src/DRICH_geo.cpp | 45 +++++++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/compact/pid/drich.xml b/compact/pid/drich.xml index 67c4097e2..7dc0e5b05 100644 --- a/compact/pid/drich.xml +++ b/compact/pid/drich.xml @@ -24,6 +24,7 @@ <constant name="DRICH_sensorbox_length" value="50.0*cm"/> <!-- z-length of the extrusion --> <constant name="DRICH_sensorbox_rmin" value="DRICH_rmax1 + 2*cm"/> <!-- lower radial limit of the extrusion --> <constant name="DRICH_sensorbox_rmax" value="DRICH_rmax2 + 5*cm"/> <!-- upper radial limit of the extrusion --> +<constant name="DRICH_sensorbox_dphi" value="48*degree"/> <!-- azimuthal width of the extrusion --> <!-- aerogel+filter geometry --> <constant name="DRICH_aerogel_thickness" value="4.0*cm"/> <!-- aerogel thickness --> <constant name="DRICH_airgap_thickness" value="0.01*mm"/> <!-- air gap between aerogel and filter --> diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index aeb09912c..dccafaebf 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -89,6 +89,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec auto sensorboxLength = desc.constant<double>("DRICH_sensorbox_length"); auto sensorboxRmin = desc.constant<double>("DRICH_sensorbox_rmin"); auto sensorboxRmax = desc.constant<double>("DRICH_sensorbox_rmax"); + auto sensorboxDphi = desc.constant<double>("DRICH_sensorbox_dphi"); // - sensor photosensitive surface (pss) auto pssElem = detElem.child(_Unicode(sensors)).child(_Unicode(pss)); auto pssMat = desc.material(pssElem.attr<std::string>(_Unicode(material))); @@ -199,23 +200,43 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec vesselRmin0 + boreDelta * (snoutLength - windowThickness) / vesselLength + wallThickness, vesselRmax1 - wallThickness + windowThickness * (vesselRmax1 - vesselRmax0) / snoutLength); - // tank solids - Cone vesselTank(tankLength / 2.0, vesselSnout.rMin2(), vesselRmax2, vesselRmin1, vesselRmax2); - Cone gasvolTank(tankLength / 2.0 - windowThickness, gasvolSnout.rMin2(), vesselRmax2 - wallThickness, - vesselRmin1 + wallThickness, vesselRmax2 - wallThickness); + // tank solids: + // - inner: cone along beamline + // - outer: cone to back of sensor box, then fixed radius cylinder + Polycone vesselTank(0, 2 * M_PI, + /* rmin */ {vesselSnout.rMin2(), std::lerp(vesselSnout.rMin2(), vesselRmin1, (sensorboxLength - snoutLength) / tankLength), vesselRmin1}, + /* rmax */ {vesselSnout.rMax2(), vesselRmax2, vesselRmax2}, + /* z */ {-tankLength / 2.0, -tankLength / 2.0 + sensorboxLength - snoutLength, tankLength / 2.0}); + Polycone gasvolTank(0, 2 * M_PI, + /* rmin */ {gasvolSnout.rMin2(), std::lerp(gasvolSnout.rMin2(), vesselRmin1 + wallThickness, (sensorboxLength - snoutLength) / tankLength), vesselRmin1 + wallThickness}, + /* rmax */ {gasvolSnout.rMax2(), vesselRmax2 - wallThickness, vesselRmax2 - wallThickness}, + /* z */ {-tankLength / 2.0 + windowThickness, -tankLength / 2.0 + windowThickness + sensorboxLength - snoutLength, tankLength / 2.0 - windowThickness}); // sensorbox solids - // FIXME: this is currently just a simple tubular extrusion; this should be replaced by proper sensor boxes - Tube vesselSensorboxTube(sensorboxRmin, sensorboxRmax, sensorboxLength / 2.); - Tube gasvolSensorboxTube(sensorboxRmin + wallThickness, sensorboxRmax - wallThickness, sensorboxLength / 2.); + double dphi = atan2(wallThickness, sensorboxRmax); // thickness only correct at Rmax + Tube vesselSensorboxTube(sensorboxRmin, sensorboxRmax, sensorboxLength / 2., + -sensorboxDphi / 2., sensorboxDphi / 2.); + Tube gasvolSensorboxTube(sensorboxRmin + wallThickness, sensorboxRmax - wallThickness, sensorboxLength / 2., + -sensorboxDphi / 2. + dphi, sensorboxDphi / 2. - dphi); // union: snout + tank - UnionSolid vesselUnion0(vesselTank, vesselSnout, Position(0., 0., -vesselLength / 2.)); - UnionSolid gasvolUnion0(gasvolTank, gasvolSnout, Position(0., 0., -vesselLength / 2. + windowThickness)); + UnionSolid vesselUnion(vesselTank, vesselSnout, Position(0., 0., -vesselLength / 2.)); + UnionSolid gasvolUnion(gasvolTank, gasvolSnout, Position(0., 0., -vesselLength / 2. + windowThickness)); - // union: add sensorbox - UnionSolid vesselUnion(vesselUnion0, vesselSensorboxTube, Position(0., 0., -(snoutLength + sensorboxLength - 0.6) / 2.)); - UnionSolid gasvolUnion(gasvolUnion0, gasvolSensorboxTube, Position(0., 0., -(snoutLength + sensorboxLength) / 2. + windowThickness)); + // union: add sensorboxes for all sectors + for (int isec = 0; isec < nSectors; isec++) { + RotationZ sectorRotation((isec + 0.5) * 2 * M_PI / nSectors); + vesselUnion = UnionSolid(vesselUnion, vesselSensorboxTube, + Transform3D(sectorRotation, + Position(0., 0., -(snoutLength + sensorboxLength - 0.6) / 2.) + ) + ); + gasvolUnion = UnionSolid(gasvolUnion, gasvolSensorboxTube, + Transform3D(sectorRotation, + Position(0., 0., -(snoutLength + sensorboxLength) / 2. + windowThickness) + ) + ); + } // extra solids for `debugOptics` only Box vesselBox(1001, 1001, 1001); From 3344c7981273b80fddec9a59f88198a0a4a069ef Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Wed, 27 Mar 2024 16:30:24 -0500 Subject: [PATCH 057/113] feat: improved flexibility to define far forward and far backward components (#679) ### Briefly, what does this PR introduce? Currently, we cannot easily control what is included in the far forward and far backward regions, except by hacking around it like in `configurations/zdc_sipm_on_tile_only.yml`. This is making it less obvious how to add only the required far forward geometry to the Acts material map geometry. This PR modifies the jinja template to allow more fine-grained far forward and far backward control, similar to the other subsystem types (e.g. ecal, hcal, pid). It maintains the default, so just specifying `features:far_forward:default:` will load the former `far_forward.xml`, but `features:far_forward:[ZDC_Crystal_LYSO:, ZDC_SiPMonTile:]` will load only those two subsystems. TODO: - [x] #674 ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @ShujieL ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- .../default.xml} | 6 +++--- compact/far_backward/extended.xml | 16 ++++++++++++++++ compact/far_backward_extended.xml | 16 ---------------- compact/far_forward.xml | 18 ------------------ compact/far_forward/default.xml | 18 ++++++++++++++++++ configurations/craterlake.yml | 4 ++-- configurations/craterlake_10x100.yml | 4 ++-- configurations/craterlake_10x275.yml | 4 ++-- configurations/craterlake_18x110_Au.yml | 4 ++-- configurations/craterlake_18x275.yml | 4 ++-- configurations/craterlake_5x41.yml | 4 ++-- configurations/craterlake_material_map.yml | 2 +- configurations/craterlake_tracking_only.yml | 2 +- configurations/full.yml | 4 ++-- configurations/ip6.yml | 4 ++-- configurations/ip6_extended.yml | 4 ++-- configurations/zdc_lyso_sipm.yml | 4 ++-- configurations/zdc_sipm_on_tile_only.yml | 2 +- templates/epic.xml.jinja2 | 4 ++-- 19 files changed, 62 insertions(+), 62 deletions(-) rename compact/{far_backward.xml => far_backward/default.xml} (61%) create mode 100644 compact/far_backward/extended.xml delete mode 100644 compact/far_backward_extended.xml delete mode 100644 compact/far_forward.xml create mode 100644 compact/far_forward/default.xml diff --git a/compact/far_backward.xml b/compact/far_backward/default.xml similarity index 61% rename from compact/far_backward.xml rename to compact/far_backward/default.xml index 9a4ed1b67..ed9608f9b 100644 --- a/compact/far_backward.xml +++ b/compact/far_backward/default.xml @@ -3,12 +3,12 @@ <lccdd> - <include ref="far_backward/magnets.xml"/> + <include ref="magnets.xml"/> <!-- Scattered electron taggers --> - <include ref="far_backward/taggers.xml"/> + <include ref="taggers.xml"/> <!-- Luminosity detector --> - <include ref="far_backward/lumi.xml"/> + <include ref="lumi.xml"/> </lccdd> diff --git a/compact/far_backward/extended.xml b/compact/far_backward/extended.xml new file mode 100644 index 000000000..bcbb157de --- /dev/null +++ b/compact/far_backward/extended.xml @@ -0,0 +1,16 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2023 Wouter Deconinck, Simon Gardner --> + +<lccdd> + + <include ref="magnets.xml"/> + <include ref="beamline_extension_hadron.xml"/> + <include ref="beamline_extension_electron.xml"/> + + <!-- Scattered electron taggers --> + <include ref="taggers.xml"/> + + <!-- Luminosity detector --> + <include ref="lumi.xml"/> + +</lccdd> diff --git a/compact/far_backward_extended.xml b/compact/far_backward_extended.xml deleted file mode 100644 index 53fcbae76..000000000 --- a/compact/far_backward_extended.xml +++ /dev/null @@ -1,16 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2023 Wouter Deconinck, Simon Gardner --> - -<lccdd> - - <include ref="far_backward/magnets.xml"/> - <include ref="far_backward/beamline_extension_hadron.xml"/> - <include ref="far_backward/beamline_extension_electron.xml"/> - - <!-- Scattered electron taggers --> - <include ref="far_backward/taggers.xml"/> - - <!-- Luminosity detector --> - <include ref="far_backward/lumi.xml"/> - -</lccdd> diff --git a/compact/far_forward.xml b/compact/far_forward.xml deleted file mode 100644 index cfcca5141..000000000 --- a/compact/far_forward.xml +++ /dev/null @@ -1,18 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Wouter Deconinck, Sakib Rahman --> - -<lccdd> - - <include ref="far_forward/ion_beamline.xml" /> - <include ref="far_forward/beampipe_hadron_B0.xml" /> - <include ref="far_forward/electron_beamline.xml" /> - <include ref="far_forward/B0_tracker.xml"/> - <include ref="far_forward/B0_ECal.xml"/> - <include ref="far_forward/offM_tracker.xml"/> - <include ref="far_forward/ZDC_SiPMonTile.xml"/> - <include ref="far_forward/ZDC_Crystal_LYSO.xml"/> - <include ref="far_forward/roman_pots_eRD24_design.xml"/> - <include ref="far_forward/vacuum.xml"/> - <include ref="far_forward/magnets.xml"/> - -</lccdd> diff --git a/compact/far_forward/default.xml b/compact/far_forward/default.xml new file mode 100644 index 000000000..6e769d313 --- /dev/null +++ b/compact/far_forward/default.xml @@ -0,0 +1,18 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2022 Wouter Deconinck, Sakib Rahman --> + +<lccdd> + + <include ref="ion_beamline.xml" /> + <include ref="beampipe_hadron_B0.xml" /> + <include ref="electron_beamline.xml" /> + <include ref="B0_tracker.xml"/> + <include ref="B0_ECal.xml"/> + <include ref="offM_tracker.xml"/> + <include ref="ZDC_SiPMonTile.xml"/> + <include ref="ZDC_Crystal_LYSO.xml"/> + <include ref="roman_pots_eRD24_design.xml"/> + <include ref="vacuum.xml"/> + <include ref="magnets.xml"/> + +</lccdd> diff --git a/configurations/craterlake.yml b/configurations/craterlake.yml index 51a600e8d..050c73b00 100644 --- a/configurations/craterlake.yml +++ b/configurations/craterlake.yml @@ -31,6 +31,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/craterlake_10x100.yml b/configurations/craterlake_10x100.yml index 2bf1db35d..e2fefd19b 100644 --- a/configurations/craterlake_10x100.yml +++ b/configurations/craterlake_10x100.yml @@ -31,6 +31,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/craterlake_10x275.yml b/configurations/craterlake_10x275.yml index e3a89ac96..760891776 100644 --- a/configurations/craterlake_10x275.yml +++ b/configurations/craterlake_10x275.yml @@ -31,6 +31,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/craterlake_18x110_Au.yml b/configurations/craterlake_18x110_Au.yml index 98a383739..53994b674 100644 --- a/configurations/craterlake_18x110_Au.yml +++ b/configurations/craterlake_18x110_Au.yml @@ -31,6 +31,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/craterlake_18x275.yml b/configurations/craterlake_18x275.yml index e9a96660c..76721d71f 100644 --- a/configurations/craterlake_18x275.yml +++ b/configurations/craterlake_18x275.yml @@ -31,6 +31,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/craterlake_5x41.yml b/configurations/craterlake_5x41.yml index 51a600e8d..050c73b00 100644 --- a/configurations/craterlake_5x41.yml +++ b/configurations/craterlake_5x41.yml @@ -31,6 +31,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/craterlake_material_map.yml b/configurations/craterlake_material_map.yml index 7e0f09055..c613df219 100644 --- a/configurations/craterlake_material_map.yml +++ b/configurations/craterlake_material_map.yml @@ -14,4 +14,4 @@ features: tof_barrel: tof_endcap: far_forward: - far_forward: + default: diff --git a/configurations/craterlake_tracking_only.yml b/configurations/craterlake_tracking_only.yml index fa779e4f4..bf942cca6 100644 --- a/configurations/craterlake_tracking_only.yml +++ b/configurations/craterlake_tracking_only.yml @@ -15,4 +15,4 @@ features: tof_barrel: tof_endcap: far_forward: - far_forward: + default: diff --git a/configurations/full.yml b/configurations/full.yml index 51a600e8d..050c73b00 100644 --- a/configurations/full.yml +++ b/configurations/full.yml @@ -31,6 +31,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/ip6.yml b/configurations/ip6.yml index 9d2140eb3..66fa680e6 100644 --- a/configurations/ip6.yml +++ b/configurations/ip6.yml @@ -1,6 +1,6 @@ features: beampipe: far_forward: - far_forward: + default: far_backward: - far_backward: + default: diff --git a/configurations/ip6_extended.yml b/configurations/ip6_extended.yml index 5415a40d2..d1a1f000c 100644 --- a/configurations/ip6_extended.yml +++ b/configurations/ip6_extended.yml @@ -1,6 +1,6 @@ features: beampipe: far_forward: - far_forward: + default: far_backward: - far_backward_extended: + extended: diff --git a/configurations/zdc_lyso_sipm.yml b/configurations/zdc_lyso_sipm.yml index b4ec0179e..2822321ec 100644 --- a/configurations/zdc_lyso_sipm.yml +++ b/configurations/zdc_lyso_sipm.yml @@ -1,4 +1,4 @@ features: far_forward: - far_forward/ZDC_Crystal_LYSO: - far_forward/ZDC_SiPMonTile: + ZDC_Crystal_LYSO: + ZDC_SiPMonTile: diff --git a/configurations/zdc_sipm_on_tile_only.yml b/configurations/zdc_sipm_on_tile_only.yml index 5c7bf7719..21c05ba58 100644 --- a/configurations/zdc_sipm_on_tile_only.yml +++ b/configurations/zdc_sipm_on_tile_only.yml @@ -1,3 +1,3 @@ features: far_forward: - far_forward/ZDC_SiPMonTile: + ZDC_SiPMonTile: diff --git a/templates/epic.xml.jinja2 b/templates/epic.xml.jinja2 index f83c7cd8e..df408d9d2 100644 --- a/templates/epic.xml.jinja2 +++ b/templates/epic.xml.jinja2 @@ -182,7 +182,7 @@ ## Far foward detectors </documentation> {% for ff in features['far_forward'] -%} - <include ref="${DETECTOR_PATH}/compact/{{ ff }}.xml"/> + <include ref="${DETECTOR_PATH}/compact/far_forward/{{ ff }}.xml"/> {% endfor -%} {% endif -%} @@ -191,7 +191,7 @@ ## Far backward detectors </documentation> {% for fb in features['far_backward'] -%} - <include ref="${DETECTOR_PATH}/compact/{{ fb }}.xml"/> + <include ref="${DETECTOR_PATH}/compact/far_backward/{{ fb }}.xml"/> {% endfor -%} {% endif -%} From 6e163df3347e747897efef5c3be4739bb5b37009 Mon Sep 17 00:00:00 2001 From: kkauder <kkauder@gmail.com> Date: Wed, 27 Mar 2024 22:24:58 -0400 Subject: [PATCH 058/113] Change pfRICH outer radius (#673) ### Briefly, what does this PR introduce? Change the outer radius to 65 cm as communicated by Alex Enslinger. Hold merge until geometry table is updated (and documented in the commit. message) ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No, it fixes problems with the latest (proposed) pfRICH implementation ### Does this PR change default behavior? Shouldn't. --- compact/definitions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact/definitions.xml b/compact/definitions.xml index 8b0b18345..952dfff09 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -463,7 +463,7 @@ Examples: <constant name="BackwardPIDRegion_length" value="45.0*cm" /> <constant name="BackwardPIDRegion_zmin" value="CentralTrackingRegionN_zmax" /> <constant name="BackwardPIDRegion_zmax" value="BackwardPIDRegion_zmin + BackwardPIDRegion_length" /> - <constant name="BackwardPIDRegion_rmax" value="63.0*cm" /> <!-- FIXME hardcoded, was CentralTrackingRegion_rmax --> + <constant name="BackwardPIDRegion_rmax" value="65.0*cm" /> <!-- FIXME hardcoded, was CentralTrackingRegion_rmax --> <constant name="BackwardPIDRegion_tan" value="CentralTrackingRegionN_tan * 0.92" /> <comment> Backward RICH region </comment> From 65e0b459a91a518ac72d992d3a7dc2fe8744eeb8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Thu, 28 Mar 2024 19:22:06 -0500 Subject: [PATCH 059/113] hotfix: fix attempt to load non-existent far_forward/far_forward.xml (#689) ### Briefly, what does this PR introduce? This PR fixes the [broken main CI pipelines](https://github.com/eic/epic/actions/runs/8462972314/job/23185174937#step:5:304) by ensuring that also epic_craterlake_no_bhcal conforms to the `far_forward:default:` syntax introduced in #679. ### What kind of change does this PR introduce? - [x] Bug fix (issue: https://github.com/eic/epic/actions/runs/8462972314/job/23185174937#step:5:304) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- configurations/craterlake_no_bhcal.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configurations/craterlake_no_bhcal.yml b/configurations/craterlake_no_bhcal.yml index 12fa99f03..2ed315a8a 100644 --- a/configurations/craterlake_no_bhcal.yml +++ b/configurations/craterlake_no_bhcal.yml @@ -30,6 +30,6 @@ features: backward: backward_endcap_flux: far_forward: - far_forward: + default: far_backward: - far_backward: + default: From 6ca70cdd4f1cfa64e628a706ae835956ab77460a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Fri, 29 Mar 2024 02:34:38 -0500 Subject: [PATCH 060/113] fix: use DD4hep RPATH configuration for libepic.so (#685) ### Briefly, what does this PR introduce? This PR configures the epic build to use RPATH in the produced library libepic.so. ### What kind of change does this PR introduce? - [x] Bug fix (issue: libepic.so not linked against libGDML.so, e.g. https://eicweb.phy.anl.gov/containers/eic_container/-/jobs/2772722#L1896) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 346981db7..bfdbad6d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ find_package(fmt REQUIRED) #----------------------------------------------------------------------------------- set(a_lib_name ${PROJECT_NAME}) +set(DD4HEP_SET_RPATH TRUE) dd4hep_configure_output(INSTALL ${CMAKE_INSTALL_PREFIX}) dd4hep_set_compiler_flags() From 2cfca4a274007f578394382a49e36497894b3924 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Mon, 1 Apr 2024 12:57:35 -0400 Subject: [PATCH 061/113] Use expr(1) for dawn views 12,14,15 to enable negative zpos (#688) The current code depends on `-$zpos` to expand to a negated value of $zpos, which doesn't work for negative values. --- scripts/view12/generate_eps | 4 ++-- scripts/view14/generate_eps | 8 ++++---- scripts/view15/generate_eps | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/view12/generate_eps b/scripts/view12/generate_eps index 3668d000c..cbb2b355f 100755 --- a/scripts/view12/generate_eps +++ b/scripts/view12/generate_eps @@ -72,8 +72,8 @@ make_slice(){ local zpos="$1" local tagnum=$(printf "%04d" ${zpos}) local FILE_TAG="${original_file_tag}a${tagnum}" - dawncut 0 0 1 ${zpos}1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim - dawncut 0 0 -1 -${zpos}0 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim + dawncut 0 0 1 $(( 10 * ${zpos} + 1 )) ${INPUT_FILE} ${FILE_TAG}_temp0.prim + dawncut 0 0 -1 $(( -10 * ${zpos} )) ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim dawn -d ${FILE_TAG}.prim ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \ diff --git a/scripts/view14/generate_eps b/scripts/view14/generate_eps index 1f2c9afe9..b1fd92b03 100755 --- a/scripts/view14/generate_eps +++ b/scripts/view14/generate_eps @@ -75,10 +75,10 @@ make_slice(){ local zpos="$1" local tagnum=$(printf "%04d" ${zpos}) local FILE_TAG="${original_file_tag}a${tagnum}" - local z1=$(add ${zpos} 100) - local z2=$(add ${zpos} -100) - #dawncut 0 0 1 ${z1}1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim - #dawncut 0 0 -1 -${z2}0 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim + local z1=$(( ${zpos} + 100 )) + local z2=$(( ${zpos} - 100 )) + #dawncut 0 0 1 $(( 10 * ${z1} + 1 )) ${INPUT_FILE} ${FILE_TAG}_temp0.prim + #dawncut 0 0 -1 $(( -10 * ${z2} )) ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim ../../bin/dawn_tweak -z ${zpos}0 cp ${INPUT_FILE} ${FILE_TAG}.prim dawn -d ${FILE_TAG}.prim diff --git a/scripts/view15/generate_eps b/scripts/view15/generate_eps index 8bc18aaf5..1bf171575 100755 --- a/scripts/view15/generate_eps +++ b/scripts/view15/generate_eps @@ -91,10 +91,10 @@ make_slice(){ local zpos="$1" local tagnum=$(printf "%04d" ${zpos}) local FILE_TAG="${original_file_tag}a${tagnum}" - local z1=$(add ${zpos} 100) - local z2=$(add ${zpos} -100) - #dawncut 0 0 1 ${z1}1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim - #dawncut 0 0 -1 -${z2}0 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim + local z1=$(( ${zpos} + 100 )) + local z2=$(( ${zpos} - 100 )) + #dawncut 0 0 1 $(( 10 * ${z1} + 1 )) ${INPUT_FILE} ${FILE_TAG}_temp0.prim + #dawncut 0 0 -1 $(( -10 * ${z2} )) ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim ../../bin/dawn_tweak -z ${zpos}0 --draw 5 #cp ${INPUT_FILE} ${FILE_TAG}.prim dawncut -1 0 0 0 ${INPUT_FILE} ${FILE_TAG}.prim From c24a7e727d3b6c2b7ecf9999aedcd53cc1c5d4da Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Mon, 1 Apr 2024 12:57:53 -0400 Subject: [PATCH 062/113] bin/make_dawn_views: remove unused imports (#686) Those are not referenced. Likely, were copied from the `bin/generate_prim_file`. --- bin/make_dawn_views | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bin/make_dawn_views b/bin/make_dawn_views index c2ed66387..c27757b36 100755 --- a/bin/make_dawn_views +++ b/bin/make_dawn_views @@ -5,14 +5,9 @@ # C. Peng (ANL), translate to python and add flexible run time for simulation import os -import signal import subprocess import argparse -import atexit -import time -from datetime import datetime import fcntl -import psutil def readline_nonblocking(output): From 07df565368fe7cad21c6eb063c99960dea26d1b3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Tue, 2 Apr 2024 18:41:21 -0500 Subject: [PATCH 063/113] fix: ignore gdml/ and calibrations/ (#692) ### Briefly, what does this PR introduce? This PR causes git to ignore the gdml/ and calibrations/ directories so they are not accidentally checked in. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index afb9d6591..16ecd1f1b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,9 @@ ip6_build *.swp -fieldmaps +fieldmaps/ +gdml/ +calibrations/ manifest.txt acts.txt From b033cf8a88551607e9c58a36de52c1f1d211dadb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Tue, 2 Apr 2024 19:39:45 -0500 Subject: [PATCH 064/113] doc: update README.md with tgeo and step file links (#690) ### Briefly, what does this PR introduce? This PR updates the front-page README.md with the tgeo and step file links, and places the image 'above the fold' with links by side. Some poor alignments, but didn't want to shrink the image even further.  ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [x] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- README.md | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index c3d5f5bfe..b26cf36ff 100644 --- a/README.md +++ b/README.md @@ -3,30 +3,26 @@ Overview -------- -**Detector geometry viewer:** -- [Viewer only](https://eic.github.io/epic/geoviewer) -- Main configurations: - - [CraterLake](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_craterlake.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) -- Additional viewers: - - [Inner detector (without calorimetry)](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_inner_detector.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - - [Calorimetry](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_calorimeters.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - - [Imaging](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_imaging_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) - - [PID](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_pid_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - - [dRICH](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_drich_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all) - - [pfRICH](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_pfrich_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) - - [DIRC](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_dirc_only.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - - [Tracking](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_tracking_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - - [Vertex](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_vertex_only.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) - - [ToF](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_tof_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) - - [Beamline](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_ip6.root&item=default;1&opt=clipx;clipy;transp30;zoom40;ROTY290;ROTZ350;trz0;trr0;ctrl;all) - -[<img title="craterlake" src="https://eic.github.io/epic/artifacts/epic_craterlake_views/view1_top.png" width="75%">](https://eic.github.io/epic/artifacts/epic_craterlake_views/view1_top.pdf) +<a href="https://eic.github.io/epic/artifacts/epic_craterlake_views/view1_top.pdf"><img align="right" alt="craterlake" src="https://eic.github.io/epic/artifacts/epic_craterlake_views/view1_top.png" width="70%"/></a> + +**Detector geometry:** +- [Empty viewer](https://eic.github.io/epic/geoviewer) +- Craterlake: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_craterlake.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [step](https://eic.github.io/epic//artifacts/epic_craterlake_no_bhcal.stp/epic_craterlake_no_bhcal.stp) +- Subsystems: + - Inner detector: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_inner_detector.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_inner_detector.root) + - Calorimetry: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_calorimeters.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_calorimeters.root) + - Imaging: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_imaging_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_imaging.root) [step](https://eic.github.io/epic//artifacts/epic_imaging_only.stp/epic_imaging_only.stp) + - PID: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_pid_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_pid_only.root) + - dRICH: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_drich_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_drich_only.root) [step](https://eic.github.io/epic//artifacts/epic_drich_only.stp/epic_drich_only.stp) + - pfRICH: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_pfrich_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_pfrich_only.root) + - DIRC: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_dirc_only.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_dirc_only.root) [step](https://eic.github.io/epic//artifacts/epic_dirc_only.stp/epic_dirc_only.stp) + - Tracking: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_tracking_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_tracking_only.root) [step](https://eic.github.io/epic//artifacts/epic_craterlake_tracking_only.stp/epic_craterlake_tracking_only.stp) + - Vertex: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_vertex_only.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_vertex_only.root) + - TOF: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_tof_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_tof_only.root) + - Beamline: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_ip6.root&item=default;1&opt=clipx;clipy;transp30;zoom40;ROTY290;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_ip6.root) [step](https://eic.github.io/epic//artifacts/epic_ip6.stp/epic_ip6.stp) **Detector parameters:** -- text: [CraterLake](https://eic.github.io/epic/artifacts/constants/epic_craterlake_constants.out) -- toml: [CraterLake](https://eic.github.io/epic/artifacts/constants/epic_craterlake_constants.toml) -- csv: [CraterLake](https://eic.github.io/epic/artifacts/DetectorParameterTable/epic_craterlake.csv) -- html: [CraterLake](https://eic.github.io/epic/artifacts/DetectorParameterTable/epic_craterlake.html) +- Craterlake: [text](https://eic.github.io/epic/artifacts/constants/epic_craterlake_constants.out) [toml](https://eic.github.io/epic/artifacts/constants/epic_craterlake_constants.toml) [csv](https://eic.github.io/epic/artifacts/DetectorParameterTable/epic_craterlake.csv) [html](https://eic.github.io/epic/artifacts/DetectorParameterTable/epic_craterlake.html) Getting Started --------------- @@ -48,10 +44,6 @@ To load the geometry, you can use the scripts in the `install` directory: ```bash source install/setup.sh ``` -or -```tcsh -source install/setup.csh -``` ### Adding/changing detector geometry From 007580fb18c6c4d66bba93155980b03a5e7ba016 Mon Sep 17 00:00:00 2001 From: Alex Jentsch <alexmichaeljentsch@gmail.com> Date: Thu, 4 Apr 2024 03:10:53 -0400 Subject: [PATCH 065/113] Add new ff vacuum structure (#665) ### Briefly, what does this PR introduce? This introduces a completely re-vamped far-forward beam pipe and vacuum system, which includes a neutral particle exit window, boxes to house the Roman pots, etc. and fills the volumes with vacuum. There are a few additional updates which will be needed once some other issues are resolved, but the overall layout will not drastically change. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [x] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators I have run the overlap checker (no overlaps), and done a few additional visual checks + acceptance checks. There are still some comments and missing "dd4hep::" constants in the code - please ignore these for now. The comments are for my future updates, and the missing constants are intentional, as all of the drawings are in "mm", and i want to keep the exact numbers as they are to make it easier to make updates. ### Does this PR introduce breaking changes? What changes might users need to make to their code? Kind of - it drastically changes the behavior of particles which go to the ZDC (a proper exit window is now there), and it will alter the reconstruction of forward protons due to the shift of the RP planes (a PR in EICrecon will follow with updated matrices). It should be noted that the exit window really only covers up to about 3.8 mrad in neutral particle acceptance. This is due to the physical constraints of fitting the window alongside the proton beam line and not impacting the proton acceptance. ### Does this PR change default behavior? Yes, especially for neutrons and photons in the ZDC. --------- Co-authored-by: Alexander Jentsch <ajentsch@bnl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> --- compact/far_forward/beampipe_hadron_B0.xml | 2 +- .../far_forward/roman_pots_eRD24_design.xml | 445 ++++++++-------- src/forwardBeamPipeBrazil.cpp | 499 ++++++++++++++++++ 3 files changed, 721 insertions(+), 225 deletions(-) create mode 100644 src/forwardBeamPipeBrazil.cpp diff --git a/compact/far_forward/beampipe_hadron_B0.xml b/compact/far_forward/beampipe_hadron_B0.xml index f02790921..e739fdf68 100644 --- a/compact/far_forward/beampipe_hadron_B0.xml +++ b/compact/far_forward/beampipe_hadron_B0.xml @@ -10,7 +10,7 @@ <detectors> - <detector id="BeamPipeB0_ID" name="BeamPipeB0" type="hadronDownstreamBeamPipe" vis="BeamPipeVis"> + <detector id="BeamPipeB0_ID" name="BeamPipeB0" type="forwardBeamPipeBrazil" vis="BeamPipeVis"> <position x="-0.165*m" y="0*m" z="6.4*m" /> <rotation x="0*rad" y="0*rad" z="0*rad" /> </detector> diff --git a/compact/far_forward/roman_pots_eRD24_design.xml b/compact/far_forward/roman_pots_eRD24_design.xml index 1fdf153d2..f3a393c62 100644 --- a/compact/far_forward/roman_pots_eRD24_design.xml +++ b/compact/far_forward/roman_pots_eRD24_design.xml @@ -2,241 +2,238 @@ <!-- Copyright (C) 2022 Alex Jentsch, Whitney Armstrong --> <lccdd> - <define> - <comment> - --------------------------------- - Roman Pots Implementation from eRD24 RD Effort - Author: Alex Jentsch - Date of first commit: June 15th, 2021 - --------------------------------- - </comment> + <define> + <comment> + --------------------------------- + Roman Pots Implementation from eRD24 RD Effort + Author: Alex Jentsch + Date of first commit: June 15th, 2021 + --------------------------------- + </comment> - <!-- Global "station" location, rotation, position information --> + <!-- Global "station" location, rotation, position information --> - <constant name="ForwardRomanPotStation1_zpos" value="26.0*m"/> - <constant name="ForwardRomanPotStation1_xpos" value="-0.8333878326*m"/> - <constant name="ForwardRomanPotStation2_zpos" value="28.0*m"/> - <constant name="ForwardRomanPotStation2_xpos" value="-0.924342804*m"/> + <constant name="ForwardRomanPotStation1_zpos" value="32547.3*mm"/> + <constant name="ForwardRomanPotStation1_xpos" value="-1131.19*mm"/> + <constant name="ForwardRomanPotStation2_zpos" value="34245.5*mm"/> + <constant name="ForwardRomanPotStation2_xpos" value="-1208.43*mm"/> - <constant name="ForwardRomanPotStation1_rotation" value="-0.047*rad"/> - <constant name="ForwardRomanPotStation2_rotation" value="-0.047*rad"/> + <constant name="ForwardRomanPotStation1_rotation" value="-0.04545*rad"/> + <constant name="ForwardRomanPotStation2_rotation" value="-0.04545*rad"/> - <constant name="ForwardRomanPotStation1_insertionPosition" value="0.0*cm"/> - <constant name="ForwardRomanPotStation2_insertionPosition" value="0.0*cm"/> + <constant name="ForwardRomanPotStation1_insertionPosition" value="0.0*cm"/> + <constant name="ForwardRomanPotStation2_insertionPosition" value="0.0*cm"/> - <!-- Module/layer information --> - <!-- Each module is simply a 3.2cm wide by 3.2cm tall square --> + <!-- Module/layer information --> + <!-- Each module is simply a 3.2cm wide by 3.2cm tall square --> - <!-- Module insertion positions --> + <!-- Module insertion positions --> - <constant name="ForwardRomanPotStation1_insertion_outer" value="3.2*cm"/> - <constant name="ForwardRomanPotStation2_insertion_outer" value="3.2*cm"/> + <constant name="ForwardRomanPotStation1_insertion_outer" value="3.2*cm"/> + <constant name="ForwardRomanPotStation2_insertion_outer" value="3.2*cm"/> - <!-- HIGH ACCEPTANCE VALUES --> - - <constant name="ForwardRomanPotStation1_insertion_central" value="3.2*cm + 0.7*cm"/> - <constant name="ForwardRomanPotStation2_insertion_central" value="3.2*cm + 0.7*cm"/> - - <constant name="ForwardRomanPotStation1_insertion_intermediate" value="3.2*cm + 0.0*cm"/> - <constant name="ForwardRomanPotStation2_insertion_intermediate" value="3.2*cm + 0.0*cm"/> - - - <!-- HIGH DIVERGENCE VALUES --> - - <!-- - - <constant name="ForwardRomanPotStation1_insertion_intermediate" value="3.2*cm + 0.6*cm"/> - <constant name="ForwardRomanPotStation2_insertion_intermediate" value="3.2*cm + 0.6*cm"/> + <!-- HIGH ACCEPTANCE VALUES --> <constant name="ForwardRomanPotStation1_insertion_central" value="3.2*cm + 0.7*cm"/> <constant name="ForwardRomanPotStation2_insertion_central" value="3.2*cm + 0.7*cm"/> - --> - - <!-- Each module is a sandwich of 1mm aluminum, 0.3mm air, 0.3mm silicon, 0.3mm inactive silicon, 0.3mm copper, and 1mm aluminum --> - <!-- Vacuum is between each module --> - - <!-- module size --> - - <constant name="ForwardRomanPot_ModuleWidth" value="32.0*mm"/> - <constant name="ForwardRomanPot_ModuleHeight" value="32.0*mm"/> - - <!-- materials --> - <!-- <constant name="ForwardRomanPot_RFShieldMat" value="StainlessSteel"/> --> - <!-- <constant name="ForwardRomanPot_LGADMat" value="SiliconOxide"/> --> - <!-- <constant name="ForwardRomanPot_ASICMat" value="SiliconOxide"/> --> - <!-- <constant name="ForwardRomanPot_ThermalStripMat" value="Copper"/> --> - - <!-- Thicknesses --> - <constant name="ForwardRomanPot_RFShieldThickness" value="1.0*mm"/> - <constant name="ForwardRomanPot_LGADThickness" value="0.3*mm"/> - <constant name="ForwardRomanPot_ASICThickness" value="0.3*mm"/> - <constant name="ForwardRomanPot_ThermalStripThickness" value="0.3*mm"/> - <constant name="ForwardRomanPot_ShieldingAirLayerThickness" value="0.3*mm"/> - <constant name="ForwardRomanPot_LayerSeparationThickness" value="1.0*cm"/> - - </define> - - - <detectors> - <detector id="ForwardRomanPot_Station_1_ID" - name="ForwardRomanPot_Station_1" - readout="ForwardRomanPotHits" - type="ip6_ForwardRomanPot" - insideTrackingVolume="true" - reflect="false" vis="FFTrackerVis"> - <position x="ForwardRomanPotStation1_xpos" y="0" z="ForwardRomanPotStation1_zpos" /> - <rotation x="0" y="ForwardRomanPotStation1_rotation" z="0" /> - <module name="ModuleRP1" vis="FFTrackerShieldedModuleVis" nx="2" ny="2" width="ForwardRomanPot_ModuleWidth" height="ForwardRomanPot_ModuleHeight"> - <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> - <module_component material="Copper" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ThermalStripThickness" /> - <module_component material="SiliconOxide" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ASICThickness" /> - <module_component material="SiliconOxide" vis="FFTrackerSurfaceVis" thickness="ForwardRomanPot_LGADThickness" sensitive="true"/> - <module_component material="Vacuum" vis="InvisibleNoDaughters" thickness="ForwardRomanPot_ShieldingAirLayerThickness"/> - <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> - <!--<module_component material="Vacuum" thickness="ForwardRomanPot_LayerSeparationThickness"/>--> - </module> - <module_assembly name="Station1Top"> - <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="(6*ForwardRomanPot_ModuleWidth)/2.0" y="ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="0" y="ForwardRomanPotStation1_insertion_central"/> - </array> - <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> - </array> - <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> - </array> - </module_assembly> - <module_assembly name="Station1Bottom"> - <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="(4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0" y="-ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="-ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="0" y="-ForwardRomanPotStation1_insertion_central"/> - </array> - <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> - </array> - <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> - </array> - </module_assembly> - - <layer id="1" vis="FFTrackerLayerVis"> - <position x="0" y="0" z="0.0*cm"/> - <component assembly="Station1Top"> - <position x="0" y="0" z="0.0*cm"/> - </component> - <component assembly="Station1Bottom"> - <position x="0" y="0" z="0.0*cm"/> - </component> - </layer> - <layer id="2" vis="FFTrackerLayerVis"> - <position x="0" y="0" z="0.0*cm"/> - <component assembly="Station1Top"> - <position x="0" y="0" z="20.0*mm"/> - </component> - <component assembly="Station1Bottom"> - <position x="0" y="0" z="20.0*mm"/> - </component> - </layer> - - </detector> - - <detector - id="ForwardRomanPot_Station_2_ID" - name="ForwardRomanPot_Station_2" - readout="ForwardRomanPotHits" - type="ip6_ForwardRomanPot" - insideTrackingVolume="true" - reflect="false" - vis="FFTrackerVis"> - <position x="ForwardRomanPotStation2_xpos" y="0" z="ForwardRomanPotStation2_zpos" /> - <rotation x="0" y="ForwardRomanPotStation1_rotation" z="0" /> - <module name="Module1" vis="FFTrackerShieldedModuleVis" nx="2" ny="2" width="ForwardRomanPot_ModuleWidth" height="ForwardRomanPot_ModuleHeight"> - <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> - <module_component material="Copper" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ThermalStripThickness" /> - <module_component material="SiliconOxide" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ASICThickness" /> - <module_component material="SiliconOxide" vis="FFTrackerSurfaceVis" thickness="ForwardRomanPot_LGADThickness" sensitive="true"/> - <module_component material="Vacuum" vis="InvisibleNoDaughters" thickness="ForwardRomanPot_ShieldingAirLayerThickness"/> - <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> - </module> - <module_assembly name="Station2Top"> - <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="(4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0" y="ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="0" y="ForwardRomanPotStation1_insertion_central"/> - </array> - <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> - </array> - <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> - </array> - </module_assembly> - <module_assembly name="Station2Bottom"> - <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="(4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0" y="-ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="-ForwardRomanPotStation1_insertion_outer"/> - </array> - <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="0" y="-ForwardRomanPotStation1_insertion_central"/> - </array> - <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> - </array> - <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> - <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> - </array> - </module_assembly> - - - <layer id="1" vis="FFTrackerLayerVis"> - <position x="0" y="0" z="0.0*cm"/> - <component assembly="Station2Top"> - <position x="0" y="0" z="0.0*cm"/> - </component> - <component assembly="Station2Bottom"> - <position x="0" y="0" z="0.0*cm"/> - </component> - </layer> - <layer id="2" vis="FFTrackerLayerVis"> - <position x="0" y="0" z="0.0*cm"/> - <component assembly="Station2Top"> - <position x="0" y="0" z="20.0*mm"/> - </component> - <component assembly="Station2Bottom"> - <position x="0" y="0" z="20.0*mm"/> - </component> - </layer> - </detector> - - -</detectors> - - - - - <readouts> - <readout name="ForwardRomanPotHits"> - <segmentation type="CartesianGridXY" grid_size_x="0.5*mm" grid_size_y="0.5*mm" /> - <id>system:8,assembly:3,layer:4,module:4,sensor:4,x:32:-16,y:-16</id> - </readout> - </readouts> + <constant name="ForwardRomanPotStation1_insertion_intermediate" value="3.2*cm + 0.0*cm"/> + <constant name="ForwardRomanPotStation2_insertion_intermediate" value="3.2*cm + 0.0*cm"/> + + + <!-- HIGH DIVERGENCE VALUES --> + + <comment> + + <constant name="ForwardRomanPotStation1_insertion_intermediate" value="3.2*cm + 0.6*cm"/> + <constant name="ForwardRomanPotStation2_insertion_intermediate" value="3.2*cm + 0.6*cm"/> + + <constant name="ForwardRomanPotStation1_insertion_central" value="3.2*cm + 0.7*cm"/> + <constant name="ForwardRomanPotStation2_insertion_central" value="3.2*cm + 0.7*cm"/> + + </comment> + + <!-- Each module is a sandwich of 1mm aluminum, 0.3mm air, 0.3mm silicon, 0.3mm inactive silicon, 0.3mm copper, and 1mm aluminum --> + <!-- Vacuum is between each module --> + + <!-- module size --> + + <constant name="ForwardRomanPot_ModuleWidth" value="32.0*mm"/> + <constant name="ForwardRomanPot_ModuleHeight" value="32.0*mm"/> + + <!-- materials --> + <!-- <constant name="ForwardRomanPot_RFShieldMat" value="StainlessSteel"/> --> + <!-- <constant name="ForwardRomanPot_LGADMat" value="SiliconOxide"/> --> + <!-- <constant name="ForwardRomanPot_ASICMat" value="SiliconOxide"/> --> + <!-- <constant name="ForwardRomanPot_ThermalStripMat" value="Copper"/> --> + + <!-- Thicknesses --> + <constant name="ForwardRomanPot_RFShieldThickness" value="1.0*mm"/> + <constant name="ForwardRomanPot_LGADThickness" value="0.3*mm"/> + <constant name="ForwardRomanPot_ASICThickness" value="0.3*mm"/> + <constant name="ForwardRomanPot_ThermalStripThickness" value="0.3*mm"/> + <constant name="ForwardRomanPot_ShieldingAirLayerThickness" value="0.3*mm"/> + <constant name="ForwardRomanPot_LayerSeparationThickness" value="1.0*cm"/> + + </define> + + + <detectors> + <detector + id="ForwardRomanPot_Station_1_ID" + name="ForwardRomanPot_Station_1" + readout="ForwardRomanPotHits" + type="ip6_ForwardRomanPot" + insideTrackingVolume="true" + reflect="false" vis="FFTrackerVis"> + <position x="ForwardRomanPotStation1_xpos" y="0" z="ForwardRomanPotStation1_zpos" /> + <rotation x="0" y="ForwardRomanPotStation1_rotation" z="0" /> + <module name="ModuleRP1" vis="FFTrackerShieldedModuleVis" nx="2" ny="2" width="ForwardRomanPot_ModuleWidth" height="ForwardRomanPot_ModuleHeight"> + <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> + <module_component material="Copper" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ThermalStripThickness" /> + <module_component material="SiliconOxide" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ASICThickness" /> + <module_component material="SiliconOxide" vis="FFTrackerSurfaceVis" thickness="ForwardRomanPot_LGADThickness" sensitive="true"/> + <module_component material="Vacuum" vis="InvisibleNoDaughters" thickness="ForwardRomanPot_ShieldingAirLayerThickness"/> + <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> + <!--<module_component material="Vacuum" thickness="ForwardRomanPot_LayerSeparationThickness"/>--> + </module> + <module_assembly name="Station1Top"> + <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="(6*ForwardRomanPot_ModuleWidth)/2.0" y="ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="0" y="ForwardRomanPotStation1_insertion_central"/> + </array> + <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> + </array> + <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> + </array> + </module_assembly> + <module_assembly name="Station1Bottom"> + <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="(4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0" y="-ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="-ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="ModuleRP1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="0" y="-ForwardRomanPotStation1_insertion_central"/> + </array> + <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> + </array> + <array nx="1" ny="2" module="ModuleRP1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> + </array> + </module_assembly> + + <layer id="1" vis="FFTrackerLayerVis"> + <position x="0" y="0" z="0.0*cm"/> + <component assembly="Station1Top"> + <position x="0" y="0" z="0.0*cm"/> + </component> + <component assembly="Station1Bottom"> + <position x="0" y="0" z="0.0*cm"/> + </component> + </layer> + <layer id="2" vis="FFTrackerLayerVis"> + <position x="0" y="0" z="0.0*cm"/> + <component assembly="Station1Top"> + <position x="0" y="0" z="20.0*mm"/> + </component> + <component assembly="Station1Bottom"> + <position x="0" y="0" z="20.0*mm"/> + </component> + </layer> + + </detector> + + <detector + id="ForwardRomanPot_Station_2_ID" + name="ForwardRomanPot_Station_2" + readout="ForwardRomanPotHits" + type="ip6_ForwardRomanPot" + insideTrackingVolume="true" + reflect="false" + vis="FFTrackerVis"> + <position x="ForwardRomanPotStation2_xpos" y="0" z="ForwardRomanPotStation2_zpos" /> + <rotation x="0" y="ForwardRomanPotStation1_rotation" z="0" /> + <module name="Module1" vis="FFTrackerShieldedModuleVis" nx="2" ny="2" width="ForwardRomanPot_ModuleWidth" height="ForwardRomanPot_ModuleHeight"> + <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> + <module_component material="Copper" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ThermalStripThickness" /> + <module_component material="SiliconOxide" vis="FFTrackerServiceVis" thickness="ForwardRomanPot_ASICThickness" /> + <module_component material="SiliconOxide" vis="FFTrackerSurfaceVis" thickness="ForwardRomanPot_LGADThickness" sensitive="true"/> + <module_component material="Vacuum" vis="InvisibleNoDaughters" thickness="ForwardRomanPot_ShieldingAirLayerThickness"/> + <module_component material="Aluminum" vis="FFTrackerShieldingVis" thickness="ForwardRomanPot_RFShieldThickness"/> + </module> + <module_assembly name="Station2Top"> + <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="(4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0" y="ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="0" y="ForwardRomanPotStation1_insertion_central"/> + </array> + <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> + </array> + <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="ForwardRomanPotStation1_insertion_intermediate"/> + </array> + </module_assembly> + <module_assembly name="Station2Bottom"> + <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="(4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0" y="-ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-((4*ForwardRomanPot_ModuleWidth)/2.0 + (2*ForwardRomanPot_ModuleWidth)/2.0)" y="-ForwardRomanPotStation1_insertion_outer"/> + </array> + <array nx="2" ny="2" module="Module1" width="2*ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="0" y="-ForwardRomanPotStation1_insertion_central"/> + </array> + <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> + </array> + <array nx="1" ny="2" module="Module1" width="ForwardRomanPot_ModuleWidth" height="2*ForwardRomanPot_ModuleHeight"> + <position x="-3.0*ForwardRomanPot_ModuleWidth/2.0" y="-ForwardRomanPotStation1_insertion_intermediate"/> + </array> + </module_assembly> + + + <layer id="1" vis="FFTrackerLayerVis"> + <position x="0" y="0" z="0.0*cm"/> + <component assembly="Station2Top"> + <position x="0" y="0" z="0.0*cm"/> + </component> + <component assembly="Station2Bottom"> + <position x="0" y="0" z="0.0*cm"/> + </component> + </layer> + <layer id="2" vis="FFTrackerLayerVis"> + <position x="0" y="0" z="0.0*cm"/> + <component assembly="Station2Top"> + <position x="0" y="0" z="20.0*mm"/> + </component> + <component assembly="Station2Bottom"> + <position x="0" y="0" z="20.0*mm"/> + </component> + </layer> + </detector> + + </detectors> + + <readouts> + <readout name="ForwardRomanPotHits"> + <segmentation type="CartesianGridXY" grid_size_x="0.5*mm" grid_size_y="0.5*mm" /> + <id>system:8,assembly:3,layer:4,module:4,sensor:4,x:32:-16,y:-16</id> + </readout> + </readouts> </lccdd> diff --git a/src/forwardBeamPipeBrazil.cpp b/src/forwardBeamPipeBrazil.cpp new file mode 100644 index 000000000..0feb23991 --- /dev/null +++ b/src/forwardBeamPipeBrazil.cpp @@ -0,0 +1,499 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (C) 2024 Alex Jentsch + +#include "DD4hep/DetFactoryHelper.h" +#include "DD4hep/Printout.h" +#include "TMath.h" +#include <XML/Helper.h> + +using namespace std; +using namespace dd4hep; + +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) +{ + + using namespace ROOT::Math; + xml_det_t x_det = e; + string det_name = x_det.nameStr(); + DetElement sdet(det_name, x_det.id()); + Assembly assembly(det_name + "_assembly"); + Material m_Al = det.material("Aluminum"); + Material m_Be = det.material("Beryllium"); + Material m_SS = det.material("StainlessSteel"); + Material m_vac = det.material("Vacuum"); + string vis_name = x_det.visStr(); + + PlacedVolume pv_assembly; + + double b0_hadron_tube_inner_r = 2.9 * dd4hep::cm; + double b0_hadron_tube_outer_r = 3.1 * dd4hep::cm; + double b0_hadron_tube_length = 120.0 * dd4hep::cm; + + double pipeThickness = 5.0 * dd4hep::mm; + + struct beampipe_dimensions_t { + Double_t length = 0.0; + Double_t innerXRadius = 0.0; + Double_t innerYRadius = 0.0; + Double_t outerXRadius = 0.0; + Double_t outerYRadius = 0.0; + Double_t xCenter = 0.0; + Double_t yCenter = 0.0; + Double_t zCenter = 0.0; + Double_t rotationAngle = 0.0; + }; + + std::vector<beampipe_dimensions_t> beampipe_dimensions; + + double globRotationAngle = -0.0454486856; //This is the angle of the proton orbit from the end of B1APF to the beginning of B2PF + double crossingAngle = -0.025; //relevant for the neutral cone + + double b1APFEndPoint_z = 22062.3828 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm + double b1APFEndPoint_x = 654.3372 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm + + double tmp_endpoint_z = 0.0; + double tmp_endpoint_x = 0.0; + + //forumula -> Z = b1APFEndPoint_z+((0.5*elementLengt)*Cos(globRotationAngle)) + //forumula -> X = b1APFEndPoint_z+((0.5*elementLengt)*Sin(globRotationAngle)) + + //------------------------------------------------------------------------------------ + //Geometry extracted from version 0 VPC drawings shown at the FF preliminary + //design review in February 2024 -- CAD model not available as of April 1st, 2024 + //------------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------------ + //primary pipe after B1APF, before neutral exit window + transition to smaller pipe + //rectangular cross-section!!!!! + //------------------------------------------------------------------------------------ + + + beampipe_dimensions.push_back({ + .length = 7615.486 * dd4hep::mm, //from VPC drawings, in mm + .innerXRadius = 275.0 * dd4hep::mm, + .innerYRadius = 175.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + }); + + beampipe_dimensions[0].outerXRadius = beampipe_dimensions[0].innerXRadius + pipeThickness; + beampipe_dimensions[0].outerYRadius = beampipe_dimensions[0].innerYRadius + pipeThickness; + beampipe_dimensions[0].xCenter = -1*(b1APFEndPoint_x+((0.5*beampipe_dimensions[0].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[0].yCenter = 0.0; + beampipe_dimensions[0].zCenter = (b1APFEndPoint_z+((0.5*beampipe_dimensions[0].length)*TMath::Cos(-globRotationAngle))); + + tmp_endpoint_z = beampipe_dimensions[0].zCenter+((0.5*beampipe_dimensions[0].length)*TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1*beampipe_dimensions[0].xCenter+((0.5*beampipe_dimensions[0].length)*TMath::Sin(-globRotationAngle)); + + double windowRadius = 110.0 * dd4hep::mm; + + + //------------------------------------------------------------------------------------ + //first small pipe section, between primary vessel and RP station 1 + //rectangular cross-section!!!!! + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({ + .length = 2780.273 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + }); + + beampipe_dimensions[1].outerXRadius = beampipe_dimensions[1].innerXRadius + pipeThickness; + beampipe_dimensions[1].outerYRadius = beampipe_dimensions[1].innerYRadius + pipeThickness; + beampipe_dimensions[1].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[1].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[1].yCenter = 0.0; + beampipe_dimensions[1].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[1].length)*TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[1].zCenter+((0.5*beampipe_dimensions[1].length)*TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1*beampipe_dimensions[1].xCenter+((0.5*beampipe_dimensions[1].length)*TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + //First roman pots scattering chamber + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({ + .length = 200 * dd4hep::mm, // from VPC drawings + .innerXRadius = 200.0 * dd4hep::mm, + .innerYRadius = 125.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + }); + + beampipe_dimensions[2].outerXRadius = beampipe_dimensions[2].innerXRadius + pipeThickness; + beampipe_dimensions[2].outerYRadius = beampipe_dimensions[2].innerYRadius + pipeThickness; + beampipe_dimensions[2].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[2].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[2].yCenter = 0.0; + beampipe_dimensions[2].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[2].length)*TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[2].zCenter+((0.5*beampipe_dimensions[2].length)*TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1*beampipe_dimensions[2].xCenter+((0.5*beampipe_dimensions[2].length)*TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + //pipe between RP 1 and RP 2 stations + //rectangular cross-section!!!!! + //------------------------------------------------------------------------------------ + + + beampipe_dimensions.push_back({ + .length = 1500.0 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + }); + + beampipe_dimensions[3].outerXRadius = beampipe_dimensions[3].innerXRadius + pipeThickness; + beampipe_dimensions[3].outerYRadius = beampipe_dimensions[3].innerYRadius + pipeThickness; + beampipe_dimensions[3].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[3].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[3].yCenter = 0.0; + beampipe_dimensions[3].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[3].length)*TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[3].zCenter+((0.5*beampipe_dimensions[3].length)*TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1*beampipe_dimensions[3].xCenter+((0.5*beampipe_dimensions[3].length)*TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + //second roman pots scattering chamber + //------------------------------------------------------------------------------------ + + + beampipe_dimensions.push_back({ + .length = 200 * dd4hep::mm, // from VPC drawings + .innerXRadius = 200.0 * dd4hep::mm, + .innerYRadius = 125.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + }); + + beampipe_dimensions[4].outerXRadius = beampipe_dimensions[4].innerXRadius + pipeThickness; + beampipe_dimensions[4].outerYRadius = beampipe_dimensions[4].innerYRadius + pipeThickness; + beampipe_dimensions[4].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[4].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[4].yCenter = 0.0; + beampipe_dimensions[4].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[4].length)*TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[4].zCenter+((0.5*beampipe_dimensions[4].length)*TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1*beampipe_dimensions[4].xCenter+((0.5*beampipe_dimensions[4].length)*TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + // Pipe from second RP chamber to taper + //------------------------------------------------------------------------------------ + + + beampipe_dimensions.push_back({ + .length = 100.0 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + }); + + beampipe_dimensions[5].outerXRadius = beampipe_dimensions[5].innerXRadius + pipeThickness; + beampipe_dimensions[5].outerYRadius = beampipe_dimensions[5].innerYRadius + pipeThickness; + beampipe_dimensions[5].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[5].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[5].yCenter = 0.0; + beampipe_dimensions[5].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[5].length)*TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[5].zCenter+((0.5*beampipe_dimensions[5].length)*TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1*beampipe_dimensions[5].xCenter+((0.5*beampipe_dimensions[5].length)*TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + // taper near ZDC + //------------------------------------------------------------------------------------ + + + beampipe_dimensions.push_back({ + .length = 599.692 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + + }); + + beampipe_dimensions[6].outerXRadius = beampipe_dimensions[6].innerXRadius + pipeThickness; + beampipe_dimensions[6].outerYRadius = beampipe_dimensions[6].innerYRadius + pipeThickness; + beampipe_dimensions[6].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[6].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[6].yCenter = 0.0; + beampipe_dimensions[6].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[6].length)*TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[6].zCenter+((0.5*beampipe_dimensions[6].length)*TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1*beampipe_dimensions[6].xCenter+((0.5*beampipe_dimensions[6].length)*TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + // pipe connecting taper to B2PF magnet, just past ZDC + //------------------------------------------------------------------------------------ + + //numbers here are not really correct for the full taper, just for the opening + + beampipe_dimensions.push_back({ + .length = 3000.0 * dd4hep::mm, // from VPC drawings + .innerXRadius = 35.0 * dd4hep::mm, + .innerYRadius = 0.0, + .rotationAngle = globRotationAngle + }); + + beampipe_dimensions[7].outerXRadius = beampipe_dimensions[7].innerXRadius + pipeThickness; + beampipe_dimensions[7].outerYRadius = beampipe_dimensions[7].innerYRadius + pipeThickness; //NOT USED HERE + beampipe_dimensions[7].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[7].length)*TMath::Sin(-globRotationAngle))); + beampipe_dimensions[7].yCenter = 0.0; + beampipe_dimensions[7].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[7].length)*TMath::Cos(-globRotationAngle)); + + + //------------------------------------------ + //begin building main volumes here + //------------------------------------------ + + //------------------------------------------------------------------- + + int pieceIdx = 0; //Larger, rectangular pipe transporting proton and neutral envelopes (neutral exit window and transfer to smaller proton line at the end) + + Box pipeAfterB1APF_outer(beampipe_dimensions[pieceIdx].outerXRadius, beampipe_dimensions[pieceIdx].outerYRadius, beampipe_dimensions[pieceIdx].length/2); + Box pipeAfterB1APF_inner(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, (beampipe_dimensions[pieceIdx].length)/2); + Box pipeAfterB1APF_firstEndCap(beampipe_dimensions[pieceIdx].outerXRadius, beampipe_dimensions[pieceIdx].outerYRadius, 5.0/2.0); + Tube neutral_exit_window_cutout(0.0, windowRadius, 1.0); // 1.0cm thick + //FIXME: proton transfer window is done by hand right now - not a nicer way to do it until we get the CAD drawing + Box protonTransferWindow(155.0 * dd4hep::mm, beampipe_dimensions[1].outerYRadius, (5.0/2)); + + SubtractionSolid tmpAfterB1APF(pipeAfterB1APF_outer, pipeAfterB1APF_inner); //This gets rid of the inner portion of the pipe, but leaves the endcaps + tmpAfterB1APF = SubtractionSolid(tmpAfterB1APF, pipeAfterB1APF_firstEndCap, Position(0.0, 0.0, (-beampipe_dimensions[pieceIdx].length)/2)); + tmpAfterB1APF = SubtractionSolid(tmpAfterB1APF, protonTransferWindow, Position((-120.0 * dd4hep::mm), 0.0, (beampipe_dimensions[pieceIdx].length)/2 )); + tmpAfterB1APF = SubtractionSolid(tmpAfterB1APF, neutral_exit_window_cutout, Position(160.0 * dd4hep::mm, 0.0, 0.5*beampipe_dimensions[pieceIdx].length)); + + Volume v_pipeAfterB1APF(Form("v_pipeAfterB1APF_%d", pieceIdx), tmpAfterB1APF, m_SS); + sdet.setAttributes(det, v_pipeAfterB1APF, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_0 = assembly.placeVolume(v_pipeAfterB1APF, Transform3D(RotationY(crossingAngle), Position(beampipe_dimensions[pieceIdx].xCenter + 4.0, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); // 2353.06094))); + pv_pipe_0.addPhysVolID("sector", 1); + DetElement pipe_de_0(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_0.setPlacement(pv_pipe_0); + + //-------------------------------------------------------------------- + + double lengthDelta = 0.0; //over-length value to remove end-pieces for hollow rectangular pipes + + // 1 -- small pipe connecting big pipe to RP station 1 + // 2 -- roman pots scattering chamber 1 + // 3 -- small pipe connecting RP1 and RP2 + // 4 -- roman pots scattering chamber 2 + // 5 -- small pipe connecting RP2 to ZDC taper + + lengthDelta = 5.0; //for small beam pipes to remove endcaps + + for(int idx = 1; idx < 6; idx++){ //loop for the easier pieces to simplify + + if(idx == 2 || idx == 4){ continue;} + + Box outer(beampipe_dimensions[idx].outerXRadius, beampipe_dimensions[idx].outerYRadius, beampipe_dimensions[idx].length/2); + Box inner(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, (beampipe_dimensions[idx].length+lengthDelta)/2); + + SubtractionSolid hollow_pipe(outer, inner); + + Volume v_hollow_pipe(Form("v_pipe_%d", idx), hollow_pipe, m_SS); + sdet.setAttributes(det, v_hollow_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_final = assembly.placeVolume(v_hollow_pipe, Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, beampipe_dimensions[idx].zCenter))); + pv_final.addPhysVolID("sector", 1); + DetElement final_de(sdet, Form("sector_pipe_%d_de", idx), 1); + final_de.setPlacement(pv_final); + + } + + lengthDelta = 0.0; //not needed for scattering chambers + + for(int idx = 1; idx < 6; idx++){ //loop for the easier pieces to simplify + + if(idx == 1 || idx == 3 || idx == 5){ continue;} + + Box outer(beampipe_dimensions[idx].outerXRadius, beampipe_dimensions[idx].outerYRadius, beampipe_dimensions[idx].length/2); + Box inner(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, (beampipe_dimensions[idx].length+lengthDelta)/2); + Box RP_subtract_outer(beampipe_dimensions[1].outerXRadius, beampipe_dimensions[1].outerYRadius, (beampipe_dimensions[2].length+5.0)/2); + + SubtractionSolid hollow_pipe(outer, inner); + hollow_pipe = SubtractionSolid(hollow_pipe, RP_subtract_outer); + + Volume v_hollow_pipe(Form("v_pipe_%d", idx), hollow_pipe, m_SS); + sdet.setAttributes(det, v_hollow_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_final = assembly.placeVolume(v_hollow_pipe, Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, beampipe_dimensions[idx].zCenter))); + pv_final.addPhysVolID("sector", 1); + DetElement final_de(sdet, Form("sector_pipe_%d_de", idx), 1); + final_de.setPlacement(pv_final); + + } + + //---------------------------------------------------------------- + + pieceIdx = 6; + + Double_t trpVertices[16]; + Double_t trpVerticesInner[16]; + //(x0, y0, x1, y1, ... , x7, y7) + //opening side - larger size + trpVertices[0] = -beampipe_dimensions[6].outerXRadius; + trpVertices[1] = -beampipe_dimensions[6].outerYRadius; + + trpVertices[2] = -beampipe_dimensions[6].outerXRadius; + trpVertices[3] = beampipe_dimensions[6].outerYRadius; + + trpVertices[4] = beampipe_dimensions[6].outerXRadius; + trpVertices[5] = beampipe_dimensions[6].outerYRadius; + + trpVertices[6] = beampipe_dimensions[6].outerXRadius; + trpVertices[7] = -beampipe_dimensions[6].outerYRadius; + + //exiting side - smaller size + + trpVertices[8] = -beampipe_dimensions[6].outerYRadius; + trpVertices[9] = -beampipe_dimensions[6].outerYRadius; + + trpVertices[10] = -beampipe_dimensions[6].outerYRadius; + trpVertices[11] = beampipe_dimensions[6].outerYRadius; + + trpVertices[12] = beampipe_dimensions[6].outerYRadius; + trpVertices[13] = beampipe_dimensions[6].outerYRadius; + + trpVertices[14] = beampipe_dimensions[6].outerYRadius; + trpVertices[15] = -beampipe_dimensions[6].outerYRadius; + + for(int i = 0; i < 16; i++){ + + if(trpVertices[i] > 0.0){trpVerticesInner[i] = trpVertices[i]-(pipeThickness);} + if(trpVertices[i] < 0.0){trpVerticesInner[i] = trpVertices[i]+(pipeThickness);} + + } + + EightPointSolid taper_outer((0.5*beampipe_dimensions[pieceIdx].length), trpVertices); + EightPointSolid taper_inner((0.5*beampipe_dimensions[pieceIdx].length), trpVerticesInner); + + Box taper_entrance(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, (0.5*(pipeThickness + 5.0))); + Box taper_exit(beampipe_dimensions[pieceIdx].innerYRadius, beampipe_dimensions[pieceIdx].innerYRadius, (0.5*(pipeThickness + 5.0))); + SubtractionSolid hollowTaper(taper_outer, taper_inner); + hollowTaper = SubtractionSolid(hollowTaper, taper_entrance, Position(0.0, 0.0, (-0.5*beampipe_dimensions[pieceIdx].length))); + hollowTaper = SubtractionSolid(hollowTaper, taper_exit, Position(0.0, 0.0, (0.5*beampipe_dimensions[pieceIdx].length))); + + Volume v_taper(Form("v_taper_%d", pieceIdx), hollowTaper, m_SS); + sdet.setAttributes(det, v_taper, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_6 = assembly.placeVolume(v_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position(beampipe_dimensions[pieceIdx].xCenter, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); + pv_pipe_6.addPhysVolID("sector", 1); + DetElement pipe_de_6(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_6.setPlacement(pv_pipe_6); + + //--------------------------------------------------------------- + + pieceIdx = 7; //pipe between taper and B2PF + + Tube pipe_after_taper(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].outerXRadius, beampipe_dimensions[pieceIdx].length/2); + + Volume v_pipe_7(Form("v_pipe_7_%d", pieceIdx), pipe_after_taper, m_SS); + sdet.setAttributes(det, v_pipe_7, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_7 = assembly.placeVolume(v_pipe_7, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position(beampipe_dimensions[pieceIdx].xCenter, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); // 2353.06094))); + pv_pipe_7.addPhysVolID("sector", 1); + DetElement pipe_de_7(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_7.setPlacement(pv_pipe_7); + + + //-------------------------------------------------------------- + // This is the beam tube in the B0 magnet for the hadron beam + // doesn't use the slope information calculated before - it stands alone + + pieceIdx = 8; + + Tube b0_hadron_tube(b0_hadron_tube_inner_r, b0_hadron_tube_outer_r, b0_hadron_tube_length / 2.0); + Volume v_b0_hadron_tube("v_b0_hadron_tube", b0_hadron_tube, m_Be); + sdet.setAttributes(det, v_b0_hadron_tube, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_8 = assembly.placeVolume(v_b0_hadron_tube, Transform3D(RotationY(crossingAngle), Position(-16.5, 0.0, 640.0))); // 2353.06094))); + pv_pipe_8.addPhysVolID("sector", 1); + DetElement pipe_de_8(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_8.setPlacement(pv_pipe_6); + + //---------------------------------------------------------------- + + pieceIdx = 9; //neutral exit window + + Box pipeAfterB1APF_LARGE((beampipe_dimensions[0].outerXRadius+5.0), (beampipe_dimensions[0].outerYRadius+5.0), (beampipe_dimensions[0].length+5.0)/2); + Tube neutral_exit_window(0.0, windowRadius, 1.0); // 1.0cm thick + + IntersectionSolid finalWindow(pipeAfterB1APF_outer, neutral_exit_window, Position(160.0 * dd4hep::mm, 0.0, 0.5*beampipe_dimensions[0].length)); + + Volume v_neutral_exit_window("v_neutral_exit_window", finalWindow, m_Al); + sdet.setAttributes(det, v_neutral_exit_window, x_det.regionStr(), x_det.limitsStr(), "AnlRed"); + + auto pv_pipe_9 = assembly.placeVolume(v_neutral_exit_window, Transform3D(RotationY(crossingAngle), Position( beampipe_dimensions[0].xCenter + 4.0, 0.0, beampipe_dimensions[0].zCenter))); + pv_pipe_9.addPhysVolID("sector", 1); + DetElement pipe_de_9(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_9.setPlacement(pv_pipe_9); + + //----------------------------------------------------------------- + // Build vacuum volumes here + //----------------------------------------------------------------- + + pieceIdx = 0; + + Box vacuum_main_pipe(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, (beampipe_dimensions[pieceIdx].length-2.0)/2); + Box cutout_for_OMD_station(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, 2.0); + + SubtractionSolid final_vacuum_main_pipe(vacuum_main_pipe, cutout_for_OMD_station, Position(0.0, 0.0, (2251.0 - beampipe_dimensions[pieceIdx].zCenter))); + final_vacuum_main_pipe = SubtractionSolid(final_vacuum_main_pipe, cutout_for_OMD_station, Position(0.0, 0.0, (2451.0 - beampipe_dimensions[pieceIdx].zCenter))); + + Volume v_vacuum_main_pipe("v_vacuum_main_pipe", final_vacuum_main_pipe, m_vac); + sdet.setAttributes(det, v_vacuum_main_pipe, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_vacuum_0 = assembly.placeVolume(v_vacuum_main_pipe, Transform3D(RotationY(crossingAngle), Position( beampipe_dimensions[pieceIdx].xCenter + 4.0, 0.0, beampipe_dimensions[pieceIdx].zCenter))); + pv_vacuum_0.addPhysVolID("sector", 1); + DetElement vacuum_de_0(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); + vacuum_de_0.setPlacement(pv_vacuum_0); + + //------------------------------------------------------------------ + + for(int idx = 1; idx < 6; idx++){ //loop for the easier pieces to simplify + + if(idx == 2 || idx == 4){ continue;} //FIXME: don't fill RP chambers with vacuum yet - still an issue with RP geometry + + Box inner_vacuum(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, (beampipe_dimensions[idx].length)/2); + + Volume v_inner_vacuum(Form("v_vacuum_%d", idx), inner_vacuum, m_vac); + sdet.setAttributes(det, v_inner_vacuum, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_final = assembly.placeVolume(v_inner_vacuum, Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, beampipe_dimensions[idx].zCenter))); + pv_final.addPhysVolID("sector", 1); + DetElement final_de(sdet, Form("sector_FF_vacuum_%d_de", idx), 1); + final_de.setPlacement(pv_final); + + } + + //------------------------------------------------------------------ + + pieceIdx = 6; + + EightPointSolid vacuum_taper((0.5*beampipe_dimensions[pieceIdx].length), trpVerticesInner); + + Volume v_vacuum_taper("v_vacuum_taper", vacuum_taper, m_vac); + sdet.setAttributes(det, v_vacuum_taper, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_vacuum_6 = assembly.placeVolume(v_vacuum_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position( beampipe_dimensions[pieceIdx].xCenter, 0.0, beampipe_dimensions[pieceIdx].zCenter))); + pv_vacuum_6.addPhysVolID("sector", 1); + DetElement vacuum_de_6(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); + vacuum_de_6.setPlacement(pv_vacuum_6); + + //------------------------------------------------------------------- + + pieceIdx = 7; //vacuum between taper and B2PF + + Tube vacuum_pipe_after_taper(0.0, beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].length/2); + + Volume v_vacuum_pipe_after_taper("v_vacuum_pipe_after_taper", vacuum_pipe_after_taper, m_vac); + sdet.setAttributes(det, v_vacuum_pipe_after_taper, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_vacuum_7 = assembly.placeVolume(v_vacuum_pipe_after_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position(beampipe_dimensions[pieceIdx].xCenter, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); + pv_vacuum_7.addPhysVolID("sector", 1); + DetElement vacuum_de_7(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); + vacuum_de_7.setPlacement(pv_vacuum_7); + + //------------------------------------------------------------------- + + pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly); + pv_assembly.addPhysVolID("system", x_det.id()).addPhysVolID("barrel", 1); + sdet.setPlacement(pv_assembly); + assembly->GetShape()->ComputeBBox(); + return sdet; +} + +DECLARE_DETELEMENT(forwardBeamPipeBrazil, create_detector) From fc55362e8f6f20168bc39fede590aaf840199d93 Mon Sep 17 00:00:00 2001 From: Simon Gardner <simon.gardner@glasgow.ac.uk> Date: Fri, 5 Apr 2024 00:16:58 +0100 Subject: [PATCH 066/113] Added definitions_craterlake to ip6 configurations (#696) ### Briefly, what does this PR introduce? The ip6 configurations were unable to be used to reconstruct tracks from the B0 surfaces without the DD4hep_SubdetectorAssembly which wraps around it which is defined in definitions_craterlake. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --- configurations/ip6.yml | 2 ++ configurations/ip6_extended.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configurations/ip6.yml b/configurations/ip6.yml index 66fa680e6..cd9591e83 100644 --- a/configurations/ip6.yml +++ b/configurations/ip6.yml @@ -1,5 +1,7 @@ features: beampipe: + tracking: + definitions_craterlake: far_forward: default: far_backward: diff --git a/configurations/ip6_extended.yml b/configurations/ip6_extended.yml index d1a1f000c..5e4a172f9 100644 --- a/configurations/ip6_extended.yml +++ b/configurations/ip6_extended.yml @@ -1,5 +1,7 @@ features: beampipe: + tracking: + definitions_craterlake: far_forward: default: far_backward: From d17a5c7dba1ac54e1faf0be80f9f64a3ba1fa2a3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Thu, 4 Apr 2024 22:01:59 -0500 Subject: [PATCH 067/113] feat: material map generation and validation scripts and pipeline job (#677) ### Briefly, what does this PR introduce? This PR adds automatic material map generation and validation (including comparison with what happens if we reuse the previous field map). It runs this in a pipeline job. All this is based on @ShujieL's scripts in https://github.com/eic/snippets/tree/main/Tracking/material_map. It adds: - automatic download of Acts source files, - less copied code, more calling of Acts source, - (therefore) less flexibility in file names. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @ShujieL ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/linux-eic-shell.yml | 31 +++++ scripts/material_map/.gitignore | 5 + scripts/material_map/epic.py | 49 +++++++ scripts/material_map/geometry_epic.py | 40 ++++++ scripts/material_map/material_mapping_epic.py | 51 +++++++ .../material_map/material_recording_epic.py | 77 +++++++++++ .../material_map/material_validation_epic.py | 54 ++++++++ scripts/material_map/materialmap_config.py | 70 ++++++++++ .../run_material_map_validation.sh | 127 ++++++++++++++++++ 9 files changed, 504 insertions(+) create mode 100644 scripts/material_map/.gitignore create mode 100644 scripts/material_map/epic.py create mode 100644 scripts/material_map/geometry_epic.py create mode 100644 scripts/material_map/material_mapping_epic.py create mode 100644 scripts/material_map/material_recording_epic.py create mode 100644 scripts/material_map/material_validation_epic.py create mode 100644 scripts/material_map/materialmap_config.py create mode 100755 scripts/material_map/run_material_map_validation.sh diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index fe7a81a42..c20fab6d2 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -189,6 +189,37 @@ jobs: root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml\")" | tee check_tracking_geometry.out bin/acts_geo_check check_tracking_geometry.out + validate-material-map: + runs-on: ubuntu-latest + needs: + - build + - check-tracking-geometry + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: build-gcc-full-eic-shell + path: install/ + - uses: cvmfs-contrib/github-action-cvmfs@v4 + - uses: eic/run-cvmfs-osg-eic-shell@main + with: + platform-release: "jug_xl:nightly" + setup: install/setup.sh + run: | + pushd scripts/material_map + export DETECTOR_CONFIG=epic_craterlake_material_map + ./run_material_map_validation.sh + popd + - uses: actions/upload-artifact@v4 + with: + name: material_map + path: | + "scripts/material_map/*.json" + "scripts/material_map/*.root" + scripts/material_map/Surfaces/ + scripts/material_map/Validation/ + if-no-files-found: error + convert-to-gdml: runs-on: ubuntu-latest needs: diff --git a/scripts/material_map/.gitignore b/scripts/material_map/.gitignore new file mode 100644 index 000000000..302d91010 --- /dev/null +++ b/scripts/material_map/.gitignore @@ -0,0 +1,5 @@ +Examples/ +Surfaces/ +Validation/ +calibrations/ +*.json diff --git a/scripts/material_map/epic.py b/scripts/material_map/epic.py new file mode 100644 index 000000000..4e8fc2858 --- /dev/null +++ b/scripts/material_map/epic.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2024 Shujie Li + +## Stand alone function to build ePIC geometry with ACTS python bindings +## for material mapping +## Shujie Li, 03, 2024 + +from pathlib import Path + +import acts +import acts.examples.dd4hep + +from acts import ( + Vector4, + MaterialMapJsonConverter +) + +import json + +def getDetector( + xmlFile, + jsonFile="", + logLevel=acts.logging.WARNING, +): + customLogLevel = acts.examples.defaultLogging(logLevel=logLevel) + logger = acts.logging.getLogger("epic.getDetector") + + matDeco = None + if len(jsonFile)>0: + file = Path(jsonFile) + logger.info("Adding material from %s", file.absolute()) + matDeco = acts.IMaterialDecorator.fromFile( + file, + level=customLogLevel(maxLevel=acts.logging.INFO), + ) + + dd4hepConfig = acts.examples.dd4hep.DD4hepGeometryService.Config( + xmlFileNames=[xmlFile], + logLevel=logLevel, + dd4hepLogLevel=customLogLevel(), + ) + detector = acts.examples.dd4hep.DD4hepDetector() + + config = acts.MaterialMapJsonConverter.Config() + + trackingGeometry, deco = detector.finalize(dd4hepConfig, matDeco) + + return detector, trackingGeometry, deco diff --git a/scripts/material_map/geometry_epic.py b/scripts/material_map/geometry_epic.py new file mode 100644 index 000000000..596afa6ca --- /dev/null +++ b/scripts/material_map/geometry_epic.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2024 Shujie Li + +import os +import argparse + +import acts + +import epic +from geometry import runGeometry + +if "__main__" == __name__: + p = argparse.ArgumentParser( + description="Script to generate geometry-map.json for ePIC geometry" + ) + p.add_argument( + "-i", + "--xmlFile", + default=( + os.environ.get("DETECTOR_PATH", "") + + "/" + + os.environ.get("DETECTOR_CONFIG", "") + + ".xml" + ), + help="Input xml file containing ePIC geometry", + ) + args = p.parse_args() + + detector, trackingGeometry, decorators = epic.getDetector(args.xmlFile) + + runGeometry( + trackingGeometry, + decorators, + outputDir=os.getcwd(), + outputObj=False, + outputCsv=False, + outputJson=True, + outputRoot=True, + ) diff --git a/scripts/material_map/material_mapping_epic.py b/scripts/material_map/material_mapping_epic.py new file mode 100644 index 000000000..ded6fc7d8 --- /dev/null +++ b/scripts/material_map/material_mapping_epic.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2024 Shujie Li + +import os +import argparse + +import acts +from acts.examples import JsonFormat + +import epic +from material_mapping import runMaterialMapping + +if "__main__" == __name__: + + p = argparse.ArgumentParser( + description="Script to generate material map for ePIC geometry" + ) + p.add_argument( + "--xmlFile", + default=os.environ.get("DETECTOR_PATH", "")+"epic_craterlake.xml", + help="input xml file containing ePIC geometry", + ) + p.add_argument( + "--geoFile", + type=str, + default="geometry-map.json", + help="input json file to define volumes and layers used in material mapping", + ) + p.add_argument( + "--matFile", + type=str, + default="material-map.json", + help="output filename for the generated material map, can be json and cbor formats", + ) + args = p.parse_args() + + mapName = args.matFile.split('.')[0] + + detector, trackingGeometry, decorators = epic.getDetector( + args.xmlFile, args.geoFile) + + runMaterialMapping( + trackingGeometry, + decorators, + outputDir = os.getcwd(), + inputDir = os.getcwd(), + readCachedSurfaceInformation=False, + mapVolume= False, + mapName = mapName, + ).run() diff --git a/scripts/material_map/material_recording_epic.py b/scripts/material_map/material_recording_epic.py new file mode 100644 index 000000000..85290e955 --- /dev/null +++ b/scripts/material_map/material_recording_epic.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2024 Shujie Li + +import os +import warnings +from pathlib import Path +import argparse + +import acts +from acts.examples import ( + GaussianVertexGenerator, + ParametricParticleGenerator, + FixedMultiplicityGenerator, + EventGenerator, + RandomNumbers, +) + +import acts.examples.dd4hep +import acts.examples.geant4 +import acts.examples.geant4.dd4hep + +import epic +from material_recording import runMaterialRecording + +u = acts.UnitConstants + +_material_recording_executed = False + + +def main(): + + p = argparse.ArgumentParser() + p.add_argument( + "-n", "--events", type=int, default=1000, help="Number of events to generate" + ) + p.add_argument( + "-t", "--tracks", type=int, default=100, help="Particle tracks per event" + ) + p.add_argument( + "-i", "--xmlFile", type=str, default=os.environ.get("DETECTOR_PATH", "") + os.environ.get("DETECTOR_CONFIG", "") + ".xml", help="DD4hep input file" + ) + p.add_argument( + "-o", "--outputName", type=str, default="geant4_material_tracks.root", help="Name of the output rootfile" + ) + p.add_argument( + "--eta_min", + type=float, + default=-8.0, + help="eta min (optional)", + ) + p.add_argument( + "--eta_max", + type=float, + default=8.0, + help="eta max (optional)", + ) + args = p.parse_args() + + detector, trackingGeometry, decorators = epic.getDetector( + args.xmlFile) + + detectorConstructionFactory = ( + acts.examples.geant4.dd4hep.DDG4DetectorConstructionFactory(detector) + ) + + runMaterialRecording( + detectorConstructionFactory=detectorConstructionFactory, + tracksPerEvent=args.tracks, + outputDir=os.getcwd(), + etaRange=(args.eta_min, args.eta_max), + s=acts.examples.Sequencer(events=args.events, numThreads=1), + ).run() + + +if "__main__" == __name__: + main() diff --git a/scripts/material_map/material_validation_epic.py b/scripts/material_map/material_validation_epic.py new file mode 100644 index 000000000..6317ba08f --- /dev/null +++ b/scripts/material_map/material_validation_epic.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2024 Shujie Li + +import os +import argparse + +import acts +import acts.examples.dd4hep +from acts.examples import Sequencer + +import epic +from material_validation import runMaterialValidation + + +if "__main__" == __name__: + + p = argparse.ArgumentParser( + description="Script to produce propogation validation for ePIC material mapping." + ) + p.add_argument( + "--xmlFile", + default=os.environ.get("DETECTOR_PATH", "") + os.environ.get("DETECTOR_CONFIG", "") + ".xml", + help="input xml file containing ePIC geometry", + ) + p.add_argument( + "--matFile", + type=str, + default="material-map.json", + help="input material map file, can be either Json or Cbor", + ) + p.add_argument( + "--outputName", + type=str, + default="propagation-material.root", + help="customized name of the output rootfile", + ) + p.add_argument( + "-n","--nevents", + type=int, + default=100, + help="number of events to run", + ) + args = p.parse_args() + + detector, trackingGeometry, decorators = epic.getDetector(args.xmlFile, args.matFile) + + field = acts.ConstantBField(acts.Vector3(0, 0, 0)) + + runMaterialValidation( + trackingGeometry, decorators, field, + outputDir=os.getcwd(), outputName=args.outputName, + s=Sequencer(events=args.nevents, numThreads=-1) + ).run() diff --git a/scripts/material_map/materialmap_config.py b/scripts/material_map/materialmap_config.py new file mode 100644 index 000000000..ead046234 --- /dev/null +++ b/scripts/material_map/materialmap_config.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2024 Shujie Li + +## Generate ePIC material map for ACTS +## read config-map.json and turn on mapping for approach 1 and 2 of each sensitive surface. +import pandas as pd +import numpy as np +import json +import os +import argparse + +if "__main__" == __name__: + p = argparse.ArgumentParser( + description="Script to turn on all approach 1 and 2, and also the beampipe surface in config json file for matieral mapping" + ) + p.add_argument( + "-i","--inputFile", + type=str, + default="config-map.json", + help=" input json file to be modified", + ) + p.add_argument( + "-o","--outputFile", + type=str, + default="config-map_new.json", + help=" output json file", + ) + +args = p.parse_args() +print(args) +fname = args.inputFile +out_name = args.outputFile + + +## load json file +f = open(fname) +dd = json.load(f) + +ee=dd['Volumes']['entries'] + +## print volume name and ID +print ("Volume ID Name Approaches") +for vv in np.arange(len(ee)): + nn = ee[vv]['value']['NAME'] + + if "|" not in nn and "Gap" not in nn: + print(ee[vv]['volume'], nn,"1, 2")#print(ee[vv]['value'])#['NAME']) + if "acts_beampipe_central::Barrel" in nn: + v_beampipe = vv+1 + print(v_beampipe, nn, "X") + +## find apporach 1 and 2 to turn on mapping +for vv in np.arange(1,1+len(dd['Surfaces'])): + for ii,tt in enumerate(dd['Surfaces'][str(vv)]): + if 'approach' in tt: + dd['Surfaces'][str(vv)][ii]['value']['material']['mapMaterial']=True + ## turn on beampipe surface and defind binning + elif vv==v_beampipe: + if tt['value']['bounds']['type']=='CylinderBounds': + # print (dd['Surfaces'][str(vv)][ii]) + dd['Surfaces'][str(vv)][ii]['value']['material']['mapMaterial']=True + dd['Surfaces'][str(vv)][ii]['value']['material']['binUtility']['binningdata'][0]['bins']=36 + dd['Surfaces'][str(vv)][ii]['value']['material']['binUtility']['binningdata'][1]['bins']=200 + + +with open(out_name, "w") as outfile: + json.dump(dd, outfile, indent=4) + +print("Done! Updated config file at "+out_name) diff --git a/scripts/material_map/run_material_map_validation.sh b/scripts/material_map/run_material_map_validation.sh new file mode 100755 index 000000000..3daafd1bd --- /dev/null +++ b/scripts/material_map/run_material_map_validation.sh @@ -0,0 +1,127 @@ +#!/bin/bash +set -e +# script for material map validation with ACTS python bindings +# run as : ./run_material_map_validation.sh --nevents 1000 +# Shujie Li, 03. 2024 (https://github.com/eic/snippets/pull/3) + +# Check if DETECTOR_PATH and DETECTOR_CONFIG are set +if [[ -z ${DETECTOR_PATH} || -z ${DETECTOR_CONFIG} ]] ; then + echo "You must set \$DETECTOR_PATH and \$DETECTOR_CONFIG before running this script." + exit -1 +fi + +# Download required Acts files +ACTS_VERSION="682d2080d36712ac15975340c92f860b25169213" +ACTS_URL="https://github.com/acts-project/acts/raw/" +ACTS_FILES=( + "Examples/Scripts/Python/geometry.py" + "Examples/Scripts/Python/material_mapping.py" + "Examples/Scripts/Python/material_recording.py" + "Examples/Scripts/Python/material_validation.py" + "Examples/Scripts/MaterialMapping/writeMapConfig.py" + "Examples/Scripts/MaterialMapping/configureMap.py" + "Examples/Scripts/MaterialMapping/Mat_map.C" + "Examples/Scripts/MaterialMapping/Mat_map_surface_plot.C" + "Examples/Scripts/MaterialMapping/Mat_map_surface_plot_ratio.C" + "Examples/Scripts/MaterialMapping/Mat_map_surface_plot_dist.C" + "Examples/Scripts/MaterialMapping/Mat_map_surface_plot_1D.C" + "Examples/Scripts/MaterialMapping/materialPlotHelper.cpp" + "Examples/Scripts/MaterialMapping/materialPlotHelper.hpp" +) +for file in ${ACTS_FILES[@]} ; do + if [ ! -f ${file} ] ; then + curl --silent --location --create-dirs --output ${file} ${ACTS_URL}/${ACTS_VERSION}/${file} + fi +done +export PYTHONPATH=$PWD/Examples/Scripts/Python:$PYTHONPATH + +# Default arguments +nevents=1000 +nparticles=1000 +while [[ $# -gt 1 ]] +do + key="$1" + case $key in + --nevents) + nevents=$2 + shift # past value + shift + ;; + --nparticles) + nparticles=$2 + shift # past value + shift + ;; + *) # unknown option + #POSITIONAL+=("$1") # save it in an array for later + echo "unknown option $1" + print_the_help + shift # past argument + ;; + esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +recordingFile=geant4_material_tracks.root +geoFile=geometry-map.json +matFile=material-map.json +trackFile=material-map_tracks.root +propFile=propagation_material + +echo "::group::----GEANTINO SCAN------" +# output geant4_material_tracks.root +# The result of the geantino scan will be a root file containing material tracks. Those contain the direction and production vertex of the geantino, the total material accumulated and all the interaction points in the detector. +python material_recording_epic.py -i ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml -n ${nevents} -t ${nparticles} -o ${recordingFile} +echo "::endgroup::" + +echo "::group::-----MAPPING Configuration-----" +# map geometry to geometry-map.json +python geometry_epic.py -i ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml + +# take geometry-map.json and read out config-map.json +python Examples/Scripts/MaterialMapping/writeMapConfig.py ${geoFile} config-map.json + +# turn on approaches and beampipe surfaces for material mapping +# you can always manually adjust the mapmaterial flag and binnings in config-map.json +python materialmap_config.py -i config-map.json -o config-map_new.json + +# turn config-map.json into modified geometry-map.json +python Examples/Scripts/MaterialMapping/configureMap.py ${geoFile} config-map_new.json +echo "::endgroup::" + +echo "::group::----MAPPING------------" +# input: geant4_material_tracks.root, geometry-map.json +# output: material-maps.json or cbor. This is the material map that you want to provide to EICrecon, i.e. -Pacts:MaterialMap=XXX .Please --matFile to specify the name and type +# material-maps_tracks.root(recorded steps from geantino, for validation purpose) +python material_mapping_epic.py --xmlFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml --geoFile ${geoFile} --matFile ${matFile} +echo "::endgroup::" + +echo "::group::----Prepare validation rootfile--------" +# output propagation-material.root +python material_validation_epic.py --xmlFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml --outputName ${propFile}_new --matFile ${matFile} -n ${nevents} +python material_validation_epic.py --xmlFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml --outputName ${propFile}_old --matFile "calibrations/materials-map.cbor" -n ${nevents} +echo "::endgroup::" + +echo "::group::-------Comparison plots---------" +rm -rf Validation/new +mkdir -p Validation/new +root -l -b -q Examples/Scripts/MaterialMapping/Mat_map.C'("'${propFile}_new'.root","'${trackFile}'","Validation/new")' +rm -rf Validation/old +mkdir -p Validation/old +root -l -b -q Examples/Scripts/MaterialMapping/Mat_map.C'("'${propFile}_old'.root","'${trackFile}'","Validation/old")' + +rm -rf Surfaces +mkdir -p Surfaces/new/ratio_plot +mkdir -p Surfaces/new/prop_plot +mkdir -p Surfaces/new/map_plot +mkdir -p Surfaces/old/ratio_plot +mkdir -p Surfaces/old/prop_plot +mkdir -p Surfaces/old/map_plot +mkdir -p Surfaces/dist_plot +mkdir -p Surfaces/1D_plot + +root -l -b -q Examples/Scripts/MaterialMapping/Mat_map_surface_plot_ratio.C'("'${propFile}_new'.root","'${trackFile}'",-1,"Surfaces/new/ratio_plot","Surfaces/new/prop_plot","Surfaces/new/map_plot")' +root -l -b -q Examples/Scripts/MaterialMapping/Mat_map_surface_plot_ratio.C'("'${propFile}_old'.root","'${trackFile}'",-1,"Surfaces/old/ratio_plot","Surfaces/old/prop_plot","Surfaces/old/map_plot")' +root -l -b -q Examples/Scripts/MaterialMapping/Mat_map_surface_plot_dist.C'("'${trackFile}'",-1,"Surfaces/dist_plot")' +root -l -b -q Examples/Scripts/MaterialMapping/Mat_map_surface_plot_1D.C'("'${trackFile}'",-1,"Surfaces/1D_plot")' +echo "::endgroup::" From 595c73537e4d0f33330a3af956b87b61c7bd408a Mon Sep 17 00:00:00 2001 From: Simon Gardner <simon.gardner@glasgow.ac.uk> Date: Fri, 5 Apr 2024 16:50:07 +0100 Subject: [PATCH 068/113] Extended configs tested by check-tracking-geometry (#697) ### Briefly, what does this PR introduce? Adds tests to check if more configurations are pass the check-tracking-geometry check. Initially this is before the epic_ip6 has been updated so should fail the test but probably initially won't. This should be followed by a change to acts_geo_check to cover the case or a request to change the logger level of messages which should cause it to fail. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --- .github/workflows/linux-eic-shell.yml | 5 ++++- bin/acts_geo_check | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index c20fab6d2..52f32c9fa 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -173,6 +173,9 @@ jobs: check-tracking-geometry: runs-on: ubuntu-latest needs: build + strategy: + matrix: + detector_config: [epic_craterlake, epic_ip6] steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 @@ -186,7 +189,7 @@ jobs: network_types: "none" setup: install/setup.sh run: | - root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml\")" | tee check_tracking_geometry.out + root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${{matrix.detector_config}}.xml\")" | tee check_tracking_geometry.out bin/acts_geo_check check_tracking_geometry.out validate-material-map: diff --git a/bin/acts_geo_check b/bin/acts_geo_check index 697c415f6..fde323451 100755 --- a/bin/acts_geo_check +++ b/bin/acts_geo_check @@ -20,4 +20,11 @@ if [[ "$nlines" > "0" ]] ; then res="1" fi +nlines=$(grep -in inconsistent ${logfile} | grep -in acts | wc -l) +if [[ "$nlines" > "0" ]] ; then + echo " ACTS geometry error: " + grep -in inconsistent ${logfile} | grep -in acts + res="1" +fi + exit ${res} From 66d487e05b3810d279433af83603bad77b4e0629 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Fri, 5 Apr 2024 15:46:26 -0500 Subject: [PATCH 069/113] feat: install setup.sh as FHS compliant bin/thisepic.sh (#698) ### Briefly, what does this PR introduce? Installing `setup.sh` in the prefix is not consistent with the linux filesystem hierarchy standard and leads to `/usr/local/setup.sh`. This PR installs `setup.sh` into e.g. `/usr/local/bin/thisepic.sh`, which is FHS compliant. Next steps: - Transition to using FHS location - Add deprecation warning to old version (v24.MM++) - Remove old version (v24.MM++) ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Not yet, but recommended default changes. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bfdbad6d9..0f8da16e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,6 +113,10 @@ configure_file(templates/setup.sh.in ${CMAKE_CURRENT_BINARY_DIR}/setup.sh @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh DESTINATION ${CMAKE_INSTALL_PREFIX} ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh + DESTINATION ${CMAKE_INSTALL_BINDIR} + RENAME this${PROJECT_NAME}.sh +) # install programs install(PROGRAMS bin/g4MaterialScan_to_csv From cd40db4ffdb055d56da6e061cd70afa330ebdc2a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Mon, 8 Apr 2024 17:31:46 -0500 Subject: [PATCH 070/113] feat: add barrel flux return (#694) ### Briefly, what does this PR introduce? This PR adds the barrel flux return backlegs and spacers per the info in #693. Needed for hall background radiation studies. Also adds forward endcap flux return.  ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @ajentsch ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Not really for any detector behavior. --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/definitions.xml | 37 ++++++-- compact/display.xml | 8 +- compact/hcal/backward_endcap_flux.xml | 10 +-- compact/hcal/barrel_flux_return.xml | 110 ++++++++++++++++++++++++ compact/hcal/forward_endcap_flux.xml | 35 ++++++++ compact/hcal/lfhcal.xml | 7 +- compact/materials.xml | 12 +++ configurations/craterlake.yml | 2 + configurations/craterlake_10x100.yml | 2 + configurations/craterlake_10x275.yml | 2 + configurations/craterlake_18x110_Au.yml | 2 + configurations/craterlake_18x275.yml | 2 + configurations/craterlake_no_bhcal.yml | 2 + src/BarrelFluxReturn_geo.cpp | 52 +++++++++++ src/EndcapFluxReturn_geo.cpp | 7 +- src/LFHCAL_geo.cpp | 24 ++++-- 16 files changed, 285 insertions(+), 29 deletions(-) create mode 100644 compact/hcal/barrel_flux_return.xml create mode 100644 compact/hcal/forward_endcap_flux.xml create mode 100644 src/BarrelFluxReturn_geo.cpp diff --git a/compact/definitions.xml b/compact/definitions.xml index 952dfff09..cbb47ee99 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -630,17 +630,36 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <constant name="HcalEndcapN_rmax" value="min(HcalBarrel_rmax, 267.0 * cm)"/> - <constant name="LFHCAL_rmax" value="HcalBarrel_rmax"/> - + <comment> Lepton_Assy_21.stp, rwimmer, 2024-04-03 </comment> <constant name="FluxEndcapN_collar_rmax" value="326.2*cm"/> - <constant name="FluxEndcapN_collar_rmin" value="269.0*cm"/> - <constant name="FluxEndcapN_collar_thickness" value="120.4*cm"/> - <constant name="FluxEndcapN_oculus_rmax" value="267.0*cm"/> - <constant name="FluxEndcapN_oculus_rmin" value="213.6*cm"/> + <constant name="FluxEndcapN_collar_rmin" value="275.0*cm"/> + <constant name="FluxEndcapN_collar_thickness" value="120.38*cm"/> + <constant name="FluxEndcapN_oculus_rmax" value="FluxEndcapN_collar_rmin"/> + <constant name="FluxEndcapN_oculus_rmin" value="221.6*cm"/> <constant name="FluxEndcapN_oculus_thickness" value="28.5*cm"/> - <constant name="FluxEndcapN_rmax" value="267.0*cm"/> - <constant name="FluxEndcapN_rmin" value="14*cm"/> - <constant name="FluxEndcapN_thickness" value="10*cm"/> + <constant name="FluxEndcapN_exterior_rmax" value="FluxEndcapN_collar_rmin*cm"/> + <constant name="FluxEndcapN_exterior_rmin" value="16*cm"/> + <constant name="FluxEndcapN_exterior_thickness" value="10*cm"/> + + <comment> Hadron End Cap Assembly_North Half.stp, rwimmer, 2024-04-03 </comment> + <constant name="FluxEndcapP_collar_rmax" value="326.2*cm"/> + <constant name="FluxEndcapP_collar_rmin" value="289.56*cm"/> + <constant name="FluxEndcapP_collar_thickness" value="167.14*cm"/> + <constant name="FluxEndcapP_oculus_rmax" value="FluxEndcapP_collar_rmin"/> + <constant name="FluxEndcapP_oculus_rmin" value="210.0*cm"/> + <constant name="FluxEndcapP_oculus_thickness" value="22.2*cm"/> + + <comment> LFHCAL includes support, which is part of the flux return </comment> + <constant name="LFHCAL_rmax" value="FluxEndcapP_collar_rmin"/> + + <comment> STAR Asm for EPIC w cradle.stp, rwimmer, 2024-04-03 </comment> + <constant name="FluxBarrelForward_zmax" value="320*cm"/> + <constant name="FluxBarrelBackward_zmax" value="FluxBarrelForward_zmax"/> + <constant name="FluxBarrel_thickness" value="62.5*cm"/> <!-- for envelope only --> + <constant name="FluxBarrel_rmin" value="273.05*cm"/> + <constant name="FluxBarrel_rmax" value="FluxBarrel_rmin + FluxBarrel_thickness"/> + <constant name="FluxBarrel_length" value="FluxBarrelForward_zmax + FluxBarrelBackward_zmax"/> + <constant name="FluxBarrel_offset" value="(FluxBarrelForward_zmax - FluxBarrelBackward_zmax)/2.0"/> <comment> These are used by ddsim, the region where we store all secondaries diff --git a/compact/display.xml b/compact/display.xml index 4b54d080b..e9f6adef9 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -105,9 +105,13 @@ <vis name="HcalSensorVis" ref="AnlBlue" showDaughters="false" visible="false"/> <vis name="HcalAbsorberVis" ref="AnlGray" showDaughters="false" visible="false"/> <vis name="HcalEndcapInsertVis" ref="AnlGray" showDaughters="false" visible="true"/> - <vis name="LFHCALVis" ref="AnlBlue" showDaughters="true" visible="true"/> - <vis name="FluxEndcapNVis" ref="AnlGray" showDaughters="true" visible="false"/> + <vis name="LFHCALVis" ref="AnlBlue" showDaughters="true" visible="true"/> + <vis name="FluxBarrelVis" ref="AnlGray" showDaughters="true" visible="false"/> + <vis name="FluxBarrelElementVis" ref="AnlViolet" showDaughters="false" visible="true"/> + <vis name="FluxEndcapNVis" ref="AnlGray" showDaughters="true" visible="false"/> <vis name="FluxEndcapNLayerVis" ref="AnlViolet" showDaughters="false" visible="true"/> + <vis name="FluxEndcapPVis" ref="AnlGray" showDaughters="true" visible="false"/> + <vis name="FluxEndcapPLayerVis" ref="AnlViolet" showDaughters="false" visible="true"/> <comment> Passive steel for flux return </comment> diff --git a/compact/hcal/backward_endcap_flux.xml b/compact/hcal/backward_endcap_flux.xml index 64595615c..a568e071f 100644 --- a/compact/hcal/backward_endcap_flux.xml +++ b/compact/hcal/backward_endcap_flux.xml @@ -6,7 +6,7 @@ <documentation> #### Dimension constants </documentation> - <constant name="FluxEndcapN_zshift" value="FluxEndcapN_collar_thickness-FluxEndcapN_thickness"/> + <constant name="FluxEndcapN_zshift" value="FluxEndcapN_collar_thickness-FluxEndcapN_exterior_thickness"/> <constant name="FluxEndcapN_zmin" value="BackwardServiceGap_zmax"/> </define> @@ -15,9 +15,9 @@ <!-- Define detector --> <detectors> <documentation> - ### Backwards (Negative Z) Endcap Flux Return + ### Backward (Negative Z) Endcap Flux Return </documentation> - <detector name="FluxEndcapN" type="epic_EndcapFluxReturnN" vis="FluxEndcapNVis"> + <detector name="FluxEndcapN" type="epic_EndcapFluxReturn" vis="FluxEndcapNVis" reflect="true"> <position x="0" y="0" z="-FluxEndcapN_zmin"/> <layer id="1" name="Collar" material="Steel235" @@ -29,8 +29,8 @@ thickness="FluxEndcapN_oculus_thickness" vis="FluxEndcapNLayerVis" /> <layer id="3" name="FluxReturn" material="Steel235" - rmin="FluxEndcapN_rmin" rmax="FluxEndcapN_rmax" zpos="FluxEndcapN_zshift" - thickness="FluxEndcapN_thickness" vis="FluxEndcapNLayerVis" + rmin="FluxEndcapN_exterior_rmin" rmax="FluxEndcapN_exterior_rmax" zpos="FluxEndcapN_zshift" + thickness="FluxEndcapN_exterior_thickness" vis="FluxEndcapNLayerVis" /> diff --git a/compact/hcal/barrel_flux_return.xml b/compact/hcal/barrel_flux_return.xml new file mode 100644 index 000000000..59249c545 --- /dev/null +++ b/compact/hcal/barrel_flux_return.xml @@ -0,0 +1,110 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2023 Wouter Deconinck, Leszek Kosarzewski --> + +<lccdd> + <define> + <documentation> + #### Dimension constants + </documentation> + <constant name="FluxBarrel_repeat" value="30"/> + <constant name="FluxBarrel_dphi" value="360*deg / FluxBarrel_repeat"/> + + <comment> Trapezoid for STAR backlegs </comment> + <constant name="FluxBarrel_Backleg_x" value="609.6*mm"/> + <constant name="FluxBarrel_Backleg_y1" value="444.5*mm"/> + <constant name="FluxBarrel_Backleg_y2" value="572.64*mm"/> + <constant name="FluxBarrel_Backleg_Regular_z" value="6316.2*mm"/> + <constant name="FluxBarrel_Backleg_Chimney_z" value="3616.2*mm"/> + <constant name="FluxBarrel_Backleg_Chimney_repeat" value="3"/> + <constant name="FluxBarrel_Backleg_Regular_repeat" value="FluxBarrel_repeat - FluxBarrel_Backleg_Chimney_repeat"/> + + <comment> Box for spacers </comment> + <constant name="FluxBarrel_Spacer_x" value="612.96*mm"/> + <constant name="FluxBarrel_Spacer_y" value="128.76*mm"/> + <constant name="FluxBarrel_Spacer_Regular_z" value="FluxBarrel_Backleg_Regular_z"/> + <constant name="FluxBarrel_Spacer_Chimney_z" value="FluxBarrel_Backleg_Chimney_z"/> + <constant name="FluxBarrel_Spacer_Chimney_repeat" value="2"/> + <constant name="FluxBarrel_Spacer_Regular_repeat" value="FluxBarrel_repeat - FluxBarrel_Spacer_Chimney_repeat"/> + </define> + + <!-- Define detector --> + <detectors> + <documentation> + ### Barrel Flux Return + </documentation> + <detector name="FluxBarrel" type="epic_BarrelFluxReturn" vis="FluxBarrelVis"> + <dimensions + rmin="FluxBarrel_rmin" + rmax="FluxBarrel_rmax" + z="FluxBarrel_length"/> + + <comment> Trd1 is defined such that x1/x2 are equivalent with y at phi = 0 </comment> + <shape name="FluxBarrel_Backleg_Regular" + type="Trd1" + z="FluxBarrel_Backleg_x/2" + x1="FluxBarrel_Backleg_y1/2" + x2="FluxBarrel_Backleg_y2/2" + y="FluxBarrel_Backleg_Regular_z/2" + material="Steel1008" + vis="FluxBarrelElementVis"/> + <replicate count="FluxBarrel_Backleg_Regular_repeat" + shape="FluxBarrel_Backleg_Regular" + dphi="FluxBarrel_dphi" + phi0="90*deg + (FluxBarrel_Backleg_Chimney_repeat + 1) / 2 * FluxBarrel_dphi"> + <rotation y="90*deg" z="90*deg"/> + <position x="FluxBarrel_rmin + FluxBarrel_Backleg_x/2"/> + </replicate> + <shape name="FluxBarrel_Backleg_Chimney" + type="Trd1" + z="FluxBarrel_Backleg_x/2" + x1="FluxBarrel_Backleg_y1/2" + x2="FluxBarrel_Backleg_y2/2" + y="FluxBarrel_Backleg_Chimney_z/2" + material="Steel1008" + vis="FluxBarrelElementVis"/> + <replicate count="FluxBarrel_Backleg_Chimney_repeat" + shape="FluxBarrel_Backleg_Chimney" + dphi="FluxBarrel_dphi" + phi0="90*deg - (FluxBarrel_Backleg_Chimney_repeat - 1) / 2 * FluxBarrel_dphi"> + <rotation y="90*deg" z="90*deg"/> + <position + x="FluxBarrel_rmin + FluxBarrel_Backleg_x/2" + z="(FluxBarrel_Backleg_Regular_z - FluxBarrel_Backleg_Chimney_z)/2"/> + </replicate> + + <shape name="FluxBarrel_Spacer_Regular" + type="Box" + dx="FluxBarrel_Spacer_x/2" + dy="FluxBarrel_Spacer_y/2" + dz="FluxBarrel_Spacer_Regular_z/2" + material="Steel1008" + vis="FluxBarrelElementVis"/> + <replicate count="FluxBarrel_Spacer_Regular_repeat" + shape="FluxBarrel_Spacer_Regular" + dphi="FluxBarrel_dphi" + phi0="90*deg + (FluxBarrel_Spacer_Chimney_repeat + 1) / 2 * FluxBarrel_dphi"> + <position + x="FluxBarrel_rmin + FluxBarrel_Spacer_x/2"/> + </replicate> + <shape name="FluxBarrel_Spacer_Chimney" + type="Box" + dx="FluxBarrel_Spacer_x / 2" + dy="FluxBarrel_Spacer_y / 2" + dz="FluxBarrel_Spacer_Chimney_z / 2" + material="Steel1008" + vis="FluxBarrelElementVis"/> + <replicate + count="FluxBarrel_Spacer_Chimney_repeat" + shape="FluxBarrel_Spacer_Chimney" + dphi="FluxBarrel_dphi" + phi0="90*deg - (FluxBarrel_Spacer_Chimney_repeat - 1) / 2 * FluxBarrel_dphi"> + <position + x="FluxBarrel_rmin + FluxBarrel_Spacer_x/2" + z="(FluxBarrel_Spacer_Regular_z - FluxBarrel_Spacer_Chimney_z)/2"/> + </replicate> + + </detector> + </detectors> + + +</lccdd> diff --git a/compact/hcal/forward_endcap_flux.xml b/compact/hcal/forward_endcap_flux.xml new file mode 100644 index 000000000..e13745836 --- /dev/null +++ b/compact/hcal/forward_endcap_flux.xml @@ -0,0 +1,35 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2023 Wouter Deconinck, Leszek Kosarzewski --> + +<lccdd> + <define> + <documentation> + #### Dimension constants + </documentation> + <constant name="FluxEndcapP_zmin" value="ForwardServiceGap_zmax"/> + + </define> + + + <!-- Define detector --> + <detectors> + <documentation> + ### Forward (Positive Z) Endcap Flux Return + </documentation> + <detector name="FluxEndcapP" type="epic_EndcapFluxReturn" vis="FluxEndcapPVis"> + <position x="0" y="0" z="FluxEndcapP_zmin"/> + + <layer id="1" name="Collar" material="Steel235" + rmin="FluxEndcapP_collar_rmin" rmax="FluxEndcapP_collar_rmax" zpos="0*cm" + thickness="FluxEndcapP_collar_thickness" vis="FluxEndcapPLayerVis" + /> + <layer id="2" name="Oculus" material="Steel235" + rmin="FluxEndcapP_oculus_rmin" rmax="FluxEndcapP_oculus_rmax" zpos="0*cm" + thickness="FluxEndcapP_oculus_thickness" vis="FluxEndcapPLayerVis" + /> + + </detector> + </detectors> + + +</lccdd> diff --git a/compact/hcal/lfhcal.xml b/compact/hcal/lfhcal.xml index 3c18598e2..3a903e6c7 100644 --- a/compact/hcal/lfhcal.xml +++ b/compact/hcal/lfhcal.xml @@ -94,7 +94,12 @@ <dimensions z="LFHCAL_length" rmin="20*cm" - rmax="LFHCAL_rmax"/> + rmax="LFHCAL_rmax" + x="3*EightM_OuterWidth" + y="6*EightM_OuterHeight" + x0="-FourM_OuterWidth"/> + <envelope material="Steel235"/> + <eightmodule name="8MModule" vis= "LFHCAL8MModVis" repeat="0" > <dimensions width="EightM_OuterWidth" diff --git a/compact/materials.xml b/compact/materials.xml index 4b54e47df..95ee8d1a5 100644 --- a/compact/materials.xml +++ b/compact/materials.xml @@ -74,6 +74,18 @@ <fraction n=".002" ref="C"/> <fraction n=".005" ref="Mn"/> </material> + <material name="Steel1008"> + <comment> + SAE AISI 1008 cold-rolled low-carbon steel + https://www.azom.com/article.aspx?ArticleID=6538 + </comment> + <D value="7.85" unit="g/cm3"/> + <fraction n="0.994" ref="Fe"/> + <fraction n=".004" ref="Mn"/> + <fraction n=".001" ref="C"/> + <fraction n=".0005" ref="S"/> + <fraction n=".0005" ref="P"/> + </material> <material name="Aluminum5083"> <D value="2.650" unit="g/cm3"/> <fraction n="0.94" ref="Al"/> diff --git a/configurations/craterlake.yml b/configurations/craterlake.yml index 050c73b00..2b9b241d1 100644 --- a/configurations/craterlake.yml +++ b/configurations/craterlake.yml @@ -28,6 +28,8 @@ features: lfhcal_with_space_for_insert: forward_insert: barrel_gdml: + barrel_flux_return: + forward_endcap_flux: backward: backward_endcap_flux: far_forward: diff --git a/configurations/craterlake_10x100.yml b/configurations/craterlake_10x100.yml index e2fefd19b..39bfe43ad 100644 --- a/configurations/craterlake_10x100.yml +++ b/configurations/craterlake_10x100.yml @@ -27,6 +27,8 @@ features: hcal: lfhcal_with_space_for_insert: forward_insert: + forward_endcap_flux: + barrel_flux_return: barrel_gdml: backward: backward_endcap_flux: diff --git a/configurations/craterlake_10x275.yml b/configurations/craterlake_10x275.yml index 760891776..c645a6926 100644 --- a/configurations/craterlake_10x275.yml +++ b/configurations/craterlake_10x275.yml @@ -28,6 +28,8 @@ features: lfhcal_with_space_for_insert: forward_insert: barrel_gdml: + barrel_flux_return: + forward_endcap_flux: backward: backward_endcap_flux: far_forward: diff --git a/configurations/craterlake_18x110_Au.yml b/configurations/craterlake_18x110_Au.yml index 53994b674..e9736a234 100644 --- a/configurations/craterlake_18x110_Au.yml +++ b/configurations/craterlake_18x110_Au.yml @@ -28,6 +28,8 @@ features: lfhcal_with_space_for_insert: forward_insert: barrel_gdml: + barrel_flux_return: + forward_endcap_flux: backward: backward_endcap_flux: far_forward: diff --git a/configurations/craterlake_18x275.yml b/configurations/craterlake_18x275.yml index 76721d71f..7f0972f1d 100644 --- a/configurations/craterlake_18x275.yml +++ b/configurations/craterlake_18x275.yml @@ -28,6 +28,8 @@ features: lfhcal_with_space_for_insert: forward_insert: barrel_gdml: + barrel_flux_return: + forward_endcap_flux: backward: backward_endcap_flux: far_forward: diff --git a/configurations/craterlake_no_bhcal.yml b/configurations/craterlake_no_bhcal.yml index 2ed315a8a..94223d402 100644 --- a/configurations/craterlake_no_bhcal.yml +++ b/configurations/craterlake_no_bhcal.yml @@ -27,6 +27,8 @@ features: hcal: lfhcal_with_space_for_insert: forward_insert: + barrel_flux_return: + forward_endcap_flux: backward: backward_endcap_flux: far_forward: diff --git a/src/BarrelFluxReturn_geo.cpp b/src/BarrelFluxReturn_geo.cpp new file mode 100644 index 000000000..9ea328d6d --- /dev/null +++ b/src/BarrelFluxReturn_geo.cpp @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (C) 2024 Wouter Deconinck + +#include "DD4hep/DetFactoryHelper.h" +#include "DD4hep/Printout.h" +#include "XML/Utilities.h" + +using namespace dd4hep; + +static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[maybe_unused]] dd4hep::SensitiveDetector sens) +{ + xml_det_t x_det = e; + xml_comp_t x_dim = x_det.dimensions(); + + // Create element + dd4hep::DetElement sdet(x_det.nameStr(), x_det.id()); + + // Create envelope + dd4hep::Material air = description.air(); + Tube env_solid(x_dim.rmin(), x_dim.rmax(), x_dim.z() / 2.0); + Volume env_vol(x_det.nameStr() + "_env", env_solid, air); + env_vol.setVisAttributes(description.visAttributes(x_det.visStr())); + + // Create volume map + std::map<std::string, dd4hep::Volume> volumes_by_name; + for (xml_coll_t shape(e, _U(shape)); shape; ++shape) { + xml_comp_t x_shape = shape; + Solid solid = xml::createShape(description, x_shape.typeStr(), shape); + Material mat = description.material(x_shape.materialStr()); + volumes_by_name[x_shape.nameStr()] = + Volume(x_shape.nameStr(), solid, mat) + .setVisAttributes(description.visAttributes(x_shape.visStr())); + } + + // Replicate volumes + for (xml_coll_t repl(e, _U(replicate)); repl; ++repl) { + xml_comp_t x_repl = repl; + Volume& vol = volumes_by_name[x_repl.attr<std::string>(_U(shape))]; + Transform3D tf = xml::createTransformation(x_repl); + for (int i = 0; i < x_repl.count(); ++i) { + double phi = x_repl.phi0() + i * x_repl.attr<double>(_Unicode(dphi)); + env_vol.placeVolume(vol, Transform3D(RotationZ(phi)) * tf); + } + } + + // Get position and place volume + PlacedVolume pv = description.pickMotherVolume(sdet).placeVolume(env_vol); + sdet.setPlacement(pv); + return sdet; +} + +DECLARE_DETELEMENT(epic_BarrelFluxReturn, create_detector) diff --git a/src/EndcapFluxReturn_geo.cpp b/src/EndcapFluxReturn_geo.cpp index c17158e94..91cf9ef80 100644 --- a/src/EndcapFluxReturn_geo.cpp +++ b/src/EndcapFluxReturn_geo.cpp @@ -16,10 +16,9 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[m xml_det_t x_det = e; int det_id = x_det.id(); std::string det_name = x_det.nameStr(); + bool reflect = x_det.reflect(false); dd4hep::Material air = description.air(); xml_comp_t x_pos = x_det.position(); - - dd4hep::Assembly assembly(det_name); dd4hep::DetElement sdet(det_name, det_id); dd4hep::PlacedVolume pv; @@ -51,7 +50,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[m s_phv2.addPhysVolID("halfdisk", 1); - pv = assembly.placeVolume(disk, dd4hep::Position(0, 0, -layer_thickness/2-layer_zpos)); + pv = assembly.placeVolume(disk, dd4hep::Position(0, 0, (reflect ? -1.0 : 1.0) * (layer_thickness/2 + layer_zpos))); pv.addPhysVolID("layer", layer_id); disk_ele.setPlacement(pv); } @@ -63,4 +62,4 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[m return sdet; } -DECLARE_DETELEMENT(epic_EndcapFluxReturnN, create_detector) +DECLARE_DETELEMENT(epic_EndcapFluxReturn, create_detector) diff --git a/src/LFHCAL_geo.cpp b/src/LFHCAL_geo.cpp index e23dc7957..fef21b5d2 100644 --- a/src/LFHCAL_geo.cpp +++ b/src/LFHCAL_geo.cpp @@ -782,10 +782,18 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens // general detector dimensions xml_dim_t dim = detElem.dimensions(); double length = dim.z(); // Size along z-axis - xml_dim_t pos = detElem.position(); + // general detector position + xml_dim_t pos = detElem.position(); printout(DEBUG, "LFHCAL_geo", "global LFHCal position " + _toString(pos.x()) + "\t" + _toString(pos.y()) + "\t" + _toString(pos.z())); + // envelope volume + xml_comp_t x_env = detElem.child(_Unicode(envelope)); + Tube rmaxtube(0, dim.rmax(), dim.z() / 2); + Box beampipe(dim.x() / 2, dim.y() / 2, dim.z() / 2); + Solid env = SubtractionSolid(rmaxtube, beampipe, Position(dim.x0(),0,0)); + Volume env_vol(detName + "_env", env, desc.material(x_env.materialStr())); + bool renderComponents = getAttrOrDefault(detElem, _Unicode(renderComponents), 0.); bool allSensitive = getAttrOrDefault(detElem, _Unicode(allSensitive), 0.); if (renderComponents) { @@ -901,7 +909,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens moduleIDy = ((pos8M[e].y + 265) / 10); // Placing modules in world volume - auto tr8M = Transform3D(Position(pos.x()-pos8M[e].x-0.5*eightM_params.mod_width, pos.y() - pos8M[e].y, pos.z() + pos8M[e].z + length / 2.)); + auto tr8M = Transform3D(Position(-pos8M[e].x-0.5*eightM_params.mod_width, -pos8M[e].y, pos8M[e].z)); phv = assembly.placeVolume(eightMassembly, tr8M); phv.addPhysVolID("moduleIDx", moduleIDx).addPhysVolID("moduleIDy", moduleIDy).addPhysVolID("moduletype", 0); } @@ -929,16 +937,16 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens printout(DEBUG, "LFHCAL_geo", "LFHCAL WRONG ID FOR 4M module: " + _toString(f) + "/" + _toString((int)pos4M.size()) + "\t" + _toString(moduleIDx) + "\t" + _toString(moduleIDy)); } - auto tr4M = Transform3D(Position(pos.x()-pos4M[f].x-0.5*fourM_params.mod_width, pos.y()-pos4M[f].y, pos.z() + pos4M[f].z + length / 2.)); + auto tr4M = Transform3D(Position(-pos4M[f].x-0.5*fourM_params.mod_width, -pos4M[f].y, pos4M[f].z)); phv = assembly.placeVolume(fourMassembly, tr4M); phv.addPhysVolID("moduleIDx", moduleIDx).addPhysVolID("moduleIDy", moduleIDy).addPhysVolID("moduletype", 1); } - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr = Translation3D(0., 0., 0.) * RotationZYX(0.,0.,0.); - PlacedVolume envPV = motherVol.placeVolume(assembly, tr); - envPV.addPhysVolID("system", detID); - det.setPlacement(envPV); + Volume motherVol = desc.pickMotherVolume(det); + phv = env_vol.placeVolume(assembly); + phv = motherVol.placeVolume(env_vol, Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.))); + phv.addPhysVolID("system", detID); + det.setPlacement(phv); return det; } From c6992d0bd0a3c02541c722db3c30ec7f9d754f81 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:52:27 -0500 Subject: [PATCH 071/113] [pre-commit.ci] pre-commit autoupdate (#701) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <!--pre-commit.ci start--> updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8a6affb0..f25a40848 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: skip: [clang-format] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-yaml - id: end-of-file-fixer From cd216f657bfa71ca90fcc9a5714fa0e42852db52 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Thu, 11 Apr 2024 16:40:57 -0400 Subject: [PATCH 072/113] remove HybridCalorimeter (#703) This is unused. --- compact/ecal/backward_hybrid.xml | 76 ------------- src/HybridCalorimeter_geo.cpp | 187 ------------------------------- 2 files changed, 263 deletions(-) delete mode 100644 compact/ecal/backward_hybrid.xml delete mode 100644 src/HybridCalorimeter_geo.cpp diff --git a/compact/ecal/backward_hybrid.xml b/compact/ecal/backward_hybrid.xml deleted file mode 100644 index bee40e905..000000000 --- a/compact/ecal/backward_hybrid.xml +++ /dev/null @@ -1,76 +0,0 @@ -<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Dmitry Romanov --> - -<lccdd> - <define> - <comment> - Transition area. - The idea behind this parametrization is that: - one glass module with its wrap is always - a size of 4 crystal modules with its wraps. - Then the transition area (where glass meets crystals) has no gaps - - +----------------+----------------+ - | +----+ +----+ | +----------+ | - | | | | | | | | | - | +----+ +----+ | | | | - | +----+ +----+ | | | | - | | | | | | | | | - | +----+ +----+ | +----------+ | - +----------------+----------------+ - crystal glass - - This implies that: - GlassModule_wrap = 2*CrystalModule_wrap - GlassModule_sx = 2*CrystalModule_sx - GlassModule_sy = 2*CrystalModule_sy - - </comment> - - <constant name="CrystalModule_width" value="20.00*mm"/> - <constant name="CrystalModule_length" value="200.00*mm"/> - <constant name="CrystalModule_wrap" value="0.50*mm"/> - <constant name="CrystalModule_z0" value="0.0*cm"/> - - <constant name="GlassModule_width" value="2*CrystalModule_width"/> - <constant name="GlassModule_length" value="55.00*cm"/> - <constant name="GlassModule_wrap" value="2*CrystalModule_wrap"/> - <constant name="GlassModule_z0" value="0.0*cm"/> - - <constant name="EcalEndcapNIonCutout_dphi" value="30*degree"/> - - <constant name="EcalEndcapN_thickness" value="GlassModule_length"/> - <constant name="EcalEndcapN_z0" value="-EcalEndcapN_zmin - EcalEndcapN_thickness/2"/> - <constant name="EcalEndcapNCrystal_rmax" value="100*cm"/> <!-- i.e. never --> - - <constant name="CrystalModule_distance" value="CrystalModule_width + CrystalModule_wrap"/> - <constant name="GlassModule_distance" value="GlassModule_width + GlassModule_wrap"/> - </define> - - <display> - <vis name="HybridEcalOuterVis" alpha="0.5" r= "0.3" g="0.3" b="0.3" showDaughters="true" visible="true"/> - </display> - - <detectors> - - <documentation level="10"> - #### Backwards Endcap EM Calorimeter - - Backwards Endcap EM Calorimeter, placements generated by script - </documentation> - <detector id="EcalEndcapN_ID" name="EcalEndcapN" type="epic_HybridCalorimeter" readout="EcalEndcapNHits"> - <position x="0" y="0" z="EcalEndcapN_z0"/> - <rotation x="0" y="0" z="0"/> - </detector> - </detectors> - <readouts> - <comment>Effectively no segmentation, the segmentation is used to provide cell dimension info</comment> - <readout name="EcalEndcapNHits"> - <segmentation type="MultiSegmentation" key="sector"> - <segmentation name="CrystalSeg" key_value="1" type="CartesianGridXY" grid_size_x="CrystalModule_distance" grid_size_y="CrystalModule_distance"/> - <segmentation name="GlassSeg" key_value="2" type="CartesianGridXY" grid_size_x="GlassModule_distance" grid_size_y="GlassModule_distance"/> - </segmentation> - <id>system:8,sector:4,module:20,x:32:-16,y:-16</id> - </readout> - </readouts> -</lccdd> diff --git a/src/HybridCalorimeter_geo.cpp b/src/HybridCalorimeter_geo.cpp deleted file mode 100644 index 0117e65bf..000000000 --- a/src/HybridCalorimeter_geo.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Dmitry Romanov, Sylvester Joosten, Chao Peng - -//========================================================================== -// A general implementation for homogeneous calorimeter -// it supports three types of placements -// 1. Individual module placement with module dimensions and positions -// 2. Array placement with module dimensions and numbers of row and columns -// 3. Disk placement with module dimensions and (Rmin, Rmax), and (Phimin, Phimax) -// 4. Lines placement with module dimensions and (mirrorx, mirrory) -// (NOTE: anchor point is the 0th block of the line instead of line center) -//-------------------------------------------------------------------------- -// Author: Chao Peng (ANL) -// Date: 06/09/2021 -//========================================================================== - -#include "DD4hep/DetFactoryHelper.h" -#include "GeometryHelpers.h" -#include <XML/Helper.h> -#include <algorithm> -#include <fmt/core.h> -#include <iostream> -#include <math.h> -#include <tuple> - -using namespace dd4hep; - -// main -static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) -{ - - using namespace std; - using namespace fmt; - - xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); - sens.setType("calorimeter"); - - auto glass_material = desc.material("SciGlass"); - auto crystal_material = desc.material("PbWO4"); - auto air_material = desc.material("Air"); - - double ROut = desc.constantAsDouble("EcalEndcapN_rmax"); - double RIn_el = desc.constantAsDouble("EcalEndcapN_rmin1"); - double ionCutout_dphi = desc.constantAsDouble("EcalEndcapNIonCutout_dphi"); - double RIn = desc.constantAsDouble("EcalEndcapN_rmin2"); - double SizeZ = desc.constantAsDouble("EcalEndcapN_thickness"); - double thickness = desc.constantAsDouble("EcalEndcapN_thickness"); - double trans_radius = desc.constantAsDouble("EcalEndcapNCrystal_rmax"); - double Glass_z0 = desc.constantAsDouble("GlassModule_z0"); - double Glass_Width = desc.constantAsDouble("GlassModule_width"); - double Glass_thickness = desc.constantAsDouble("GlassModule_length"); - double Glass_Gap = desc.constantAsDouble("GlassModule_wrap"); - double glass_distance = desc.constantAsDouble("GlassModule_distance"); - - double Crystal_Width = desc.constantAsDouble("CrystalModule_width"); - double Crystal_thickness = desc.constantAsDouble("CrystalModule_length"); - double crystal_distance = desc.constantAsDouble("CrystalModule_distance"); - double Crystal_z0 = desc.constantAsDouble("CrystalModule_z0"); - // FIXME Crystal_Gap is read but not used - // double Crystal_Gap = desc.constantAsDouble("CrystalModule_wrap"); - - // RIn and ROut will define outer tube embedding the calorimeter - // centers_rmin/out define the maximum radius of module centers - // so that modules are not overlapping with mother tube volume - const double glassHypotenuse = std::hypot(glass_distance, glass_distance) / 2; - const double crystalHypotenuse = glassHypotenuse / 2; - // Offset these values a bit so we don't miss edge-blocks - const double glassCenters_rmax = ROut - glassHypotenuse + 1 * mm; - const double crystalCenters_rmin = RIn + crystalHypotenuse - 1 * mm; - // Also limits of the inner crystal blocks fill - const double cutout_tan = tan(ionCutout_dphi / 2); - const double cutout_rmin = RIn_el + crystalHypotenuse - 1 * mm; - - // Offset to align the modules at the zmin of the endcap, - const double Crystal_offset = -0.5 * (Crystal_thickness - thickness); - const double Glass_offset = -0.5 * (Glass_thickness - thickness); - - // envelope - // consists of an glass tube of the full thickness, and a crystal inner tube - // for the crystal that allows us to get closet to the beampipe without - // overlaps, and a partial electron tube that allows us to get closer to the - // electron beampipe in the region where there is no ion beampipe - Tube glass_tube(min(RIn + glassHypotenuse * 2, trans_radius), ROut, SizeZ / 2.0, 0., 360.0 * deg); - Tube crystal_tube(RIn, min(RIn + glassHypotenuse * 2, trans_radius), Crystal_thickness / 2.0, 0., 360.0 * deg); - Tube electron_tube(RIn_el, RIn, Crystal_thickness / 2., ionCutout_dphi / 2., 360.0 * deg - ionCutout_dphi / 2); - UnionSolid outer_envelope(glass_tube, crystal_tube, Position(0, 0, Crystal_offset)); - UnionSolid envelope(outer_envelope, electron_tube, Position(0, 0, Crystal_offset)); - Volume ecal_vol("negative_ecal", envelope, air_material); - ecal_vol.setVisAttributes(desc.visAttributes("HybridEcalOuterVis")); - - // TODO why 1cm and not something else? - double Glass_OuterR = ROut - 1 * cm; - - // Geometry of modules - Box glass_box("glass_box", Glass_Width * 0.5, Glass_Width * 0.5, Glass_thickness * 0.5); - Volume glass_module("glass_module", glass_box, glass_material); - glass_module.setVisAttributes(desc.visAttributes("EcalEndcapNModuleVis")); - glass_module.setSensitiveDetector(sens); - - Box crystal_box("crystal_box", Crystal_Width * 0.5, Crystal_Width * 0.5, Crystal_thickness * 0.5); - Volume crystal_module("crystal_module", crystal_box, crystal_material); - crystal_module.setVisAttributes(desc.visAttributes("EcalEndcapNModuleVis")); - crystal_module.setSensitiveDetector(sens); - - // GLASS - double diameter = 2 * Glass_OuterR; - - // Can we fit an even or odd amount of glass blocks within our rmax? - // This determines the transition points between crystal and glass as we need the - // outer crystal arangement to be in multiples of 2 (aligned with glass) - const int towersInRow = std::ceil((diameter + Glass_Gap) / (Glass_Width + Glass_Gap)); - - // Is it odd or even number of towersInRow - double leftTowerPos, topTowerPos; - if (towersInRow % 2) { - // | - // [ ][ ][ ][ ][ ] - // ^ | - int towersInHalfRow = std::ceil(towersInRow / 2.0); - topTowerPos = leftTowerPos = -towersInHalfRow * (Glass_Width + Glass_Gap); - - } else { - // | - // [ ][ ][ ][ ][ ][ ] - // ^ | - int towersInHalfRow = towersInRow / 2; - topTowerPos = leftTowerPos = -(towersInHalfRow - 0.5) * (Glass_Width + Glass_Gap); - } - - int glass_module_index = 0; - int cryst_module_index = 0; - for (int rowIndex = 0; rowIndex < towersInRow; rowIndex++) { - for (int colIndex = 0; colIndex < towersInRow; colIndex++) { - const double glass_x = leftTowerPos + colIndex * (Glass_Width + Glass_Gap); - const double glass_y = topTowerPos + rowIndex * (Glass_Width + Glass_Gap); - const double r = std::hypot(glass_x, glass_y); - // crystal if within the transition radius (as defined by the equivalent glass - // block) - if (r < trans_radius) { - for (const auto dx : {-1, 1}) { - for (const auto& dy : {-1, 1}) { - const double crystal_x = glass_x + dx * crystal_distance / 2; - const double crystal_y = glass_y + dy * crystal_distance / 2; - const double crystal_r = std::hypot(crystal_x, crystal_y); - // check if crystal in the main crystal ring? - const bool mainRing = (crystal_r > crystalCenters_rmin); - const bool innerRing = !mainRing && crystal_r > cutout_rmin; - const bool ionCutout = crystal_x > 0 && fabs(crystal_y / crystal_x) < cutout_tan; - if (mainRing || (innerRing && !ionCutout)) { - auto placement = - ecal_vol.placeVolume(crystal_module, Position(crystal_x, crystal_y, Crystal_z0 + Crystal_offset)); - placement.addPhysVolID("sector", 1); - placement.addPhysVolID("module", cryst_module_index++); - } - } - } - // Glass block if within the rmax - } else if (r < glassCenters_rmax) { - // glass module - auto placement = ecal_vol.placeVolume(glass_module, Position(glass_x, glass_y, Glass_z0 + Glass_offset)); - placement.addPhysVolID("sector", 2); - placement.addPhysVolID("module", glass_module_index++); - } - } - } - - desc.add(Constant("EcalEndcapN_NModules_Sector1", std::to_string(cryst_module_index))); - desc.add(Constant("EcalEndcapN_NModules_Sector2", std::to_string(glass_module_index))); - // fmt::print("Total Glass modules: {}\n", towerIndex); - // fmt::print("CE EMCAL GLASS END\n\n"); - - // detector position and rotation - auto pos = detElem.position(); - auto rot = detElem.rotation(); - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); - PlacedVolume envPV = motherVol.placeVolume(ecal_vol, tr); - envPV.addPhysVolID("system", detID); - det.setPlacement(envPV); - return det; -} - -//@} -DECLARE_DETELEMENT(epic_HybridCalorimeter, create_detector) From a1ea91aa4836f3e44bd5d8faa160217468d7c20f Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Mon, 15 Apr 2024 19:49:49 -0500 Subject: [PATCH 073/113] feat: add calibrations.xml (#708) ### Briefly, what does this PR introduce? This PR adds a place to put calibrations artifacts in a place that allows them to be propagated to cached and other configurations. Yes, it's xml, not json, but at some point later we can switch that. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/calibrations.xml | 14 ++++++++++++++ templates/epic.xml.jinja2 | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 compact/calibrations.xml diff --git a/compact/calibrations.xml b/compact/calibrations.xml new file mode 100644 index 000000000..07ba8aa2f --- /dev/null +++ b/compact/calibrations.xml @@ -0,0 +1,14 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2024 Wouter Deconinck --> + +<lccdd> + + <plugins> + <plugin name="epic_FileLoader"> + <arg value="cache:$DETECTOR_PATH:/opt/detector"/> + <arg value="file:calibrations/onnx/identity_gemm_w1x1_b1.onnx"/> + <arg value="url:https://github.com/eic/epic-data/raw/27ef75b2b6108b5e72d3ab891f32aeeb3770c7bd/onnx/identity_gemm_w1x1_b1.onnx"/> + </plugin> + </plugins> + +</lccdd> diff --git a/templates/epic.xml.jinja2 b/templates/epic.xml.jinja2 index df408d9d2..ad376206d 100644 --- a/templates/epic.xml.jinja2 +++ b/templates/epic.xml.jinja2 @@ -58,6 +58,8 @@ </includes> <include ref="${DETECTOR_PATH}/compact/optical_materials.xml"/> + <include ref="${DETECTOR_PATH}/compact/calibrations.xml"/> + <limits> <limitset name="world_limits"> </limitset> From 2ffa142d0bd7055cfbfd9ab7838f5e0b7f6c551c Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Mon, 15 Apr 2024 19:50:01 -0500 Subject: [PATCH 074/113] feat(ci): change pre-commit clang-format to run in ci [skip pre-commit.ci] (#705) ### Briefly, what does this PR introduce? This PR lets the CI pre-commit job run automatic clang-format. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No changes. ### Does this PR change default behavior? Yes, it might lead to developers seeing their code reformatted automatically. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .clang-format | 118 +- .devcontainer/devcontainer.json | 4 +- .pre-commit-config.yaml | 6 +- calibrations/calo_digi_default.json | 128 +- calibrations/emcal_barrel_calibration.json | 14 +- calibrations/ffi_zdc.json | 34 +- scripts/test_ACTS.cxx | 7 +- src/B0ECal_geo.cpp | 43 +- src/B0Preshower_geo.cpp | 133 +- src/B0Tracker_geo.cpp | 159 +- src/BackwardsBeamPipe_geo.cpp | 29 +- src/BackwardsCollimator.cpp | 31 +- src/BackwardsLumiVac_geo.cpp | 5 +- src/BackwardsTaggers_geo.cpp | 197 +-- src/BarrelBarDetectorWithSideFrame_geo.cpp | 68 +- src/BarrelCalorimeterImaging_geo.cpp | 301 ++-- src/BarrelCalorimeterScFi_geo.cpp | 182 +-- src/BarrelFluxReturn_geo.cpp | 16 +- src/BarrelHCalCalorimeter_geo.cpp | 293 ++-- src/BarrelPlanarMPGDTracker_geo.cpp | 107 +- src/BarrelTrackerWithFrame_geo.cpp | 132 +- src/BeamPipeChain_geo.cpp | 100 +- src/CompositeTracker_geo.cpp | 22 +- src/CylindricalDipoleMagnet_geo.cpp | 34 +- src/CylindricalMagnetChain_geo.cpp | 42 +- src/DD4hepDetectorHelper.h | 12 +- src/DD4hep_GdmlDetector.cpp | 38 +- src/DIRC_geo.cpp | 203 +-- src/DRICH_geo.cpp | 315 ++-- src/EcalLumiSpecWScFi_geo.cpp | 229 +-- src/EndcapCalorimeterWithInsertCutout_geo.cpp | 76 +- src/EndcapFluxReturn_geo.cpp | 53 +- src/EndcapTOF_geo.cpp | 91 +- src/FieldMapB.cpp | 223 ++- src/FileLoader.cpp | 21 +- src/FileLoaderHelper.h | 58 +- src/ForwardRomanPot_geo.cpp | 85 +- src/GeometryHelper.cpp | 301 ++-- src/GeometryHelper.h | 57 +- src/GeometryHelpers.cpp | 386 +++-- src/GeometryHelpers.h | 32 +- src/HomogeneousCalorimeter_geo.cpp | 315 ++-- src/IP6BeamPipe.cpp | 126 +- src/InsertCalorimeter_geo.cpp | 103 +- src/LFHCAL_geo.cpp | 1377 ++++++++++------- src/LumiCollimator_geo.cpp | 35 +- src/LumiDirectPC_geo.cpp | 47 +- src/LumiMagnets_geo.cpp | 114 +- src/LumiPhotonChamber_geo.cpp | 104 +- src/LumiSpecHomoCAL_geo.cpp | 71 +- src/LumiSpecTracker_geo.cpp | 75 +- src/LumiWindow_geo.cpp | 49 +- src/MRich_geo.cpp | 224 +-- src/OffMomentumTracker_geo.cpp | 101 +- src/PFRICH_geo.cpp | 987 ++++++------ src/PolyhedraEndcapCalorimeter2_geo.cpp | 73 +- src/ScFiCalorimeter_geo.cpp | 72 +- src/SimpleDiskDetector_geo.cpp | 54 +- src/Solenoid_geo.cpp | 43 +- src/SupportServiceMaterial_geo.cpp | 146 +- src/TaggerCalWSi_geo.cpp | 35 +- src/TrapEndcapTracker_geo.cpp | 203 +-- src/ZDC_Crystal_geo.cpp | 91 +- src/ZDC_ImagingCal_geo.cpp | 53 +- src/ZDC_SamplingCal_geo.cpp | 57 +- src/ZeroDegreeCalorimeterEcalWSciFi_geo.cpp | 58 +- src/ZeroDegreeCalorimeterEcal_geo.cpp | 43 +- src/ZeroDegreeCalorimeterSampling_geo.cpp | 51 +- src/ZeroDegreeCalorimeterSiPMonTile_geo.cpp | 106 +- src/forwardBeamPipeBrazil.cpp | 1017 ++++++------ src/hadronDownstreamBeamPipe.cpp | 262 ++-- src/magnetVacuumFF.cpp | 481 +++--- 72 files changed, 5702 insertions(+), 5256 deletions(-) diff --git a/.clang-format b/.clang-format index 48164f6bb..6041e2653 100644 --- a/.clang-format +++ b/.clang-format @@ -1,111 +1,17 @@ --- -Language: Cpp -BasedOnStyle: Chromium -AccessModifierOffset: -2 -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: true -AlignConsecutiveDeclarations: true -AlignEscapedNewlines: Right -AlignOperands: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: true -BinPackArguments: true -BinPackParameters: true -BraceWrapping: - AfterClass: false - AfterControlStatement: false - AfterEnum: false - AfterFunction: true - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: false - AfterUnion: false - AfterExternBlock: false - BeforeCatch: false - BeforeElse: false - IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: true - SplitEmptyNamespace: true -BreakBeforeBinaryOperators: None -BreakBeforeBraces: Custom -BreakBeforeInheritanceComma: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BreakConstructorInitializers: BeforeColon -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: true -ColumnLimit: 120 -CommentPragmas: '^ IWYU pragma:' -CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 +BasedOnStyle: LLVM +BreakConstructorInitializersBeforeComma: true +ConstructorInitializerAllOnOneLineOrOnePerLine: true Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: true -ForEachMacros: - - foreach - - Q_FOREACH - - BOOST_FOREACH +Standard: c++20 +#SpaceBeforeParens: ControlStatements +SpaceAfterControlStatementKeyword: true +PointerBindsToType: true IncludeBlocks: Preserve -IncludeCategories: - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Priority: 2 - - Regex: '^(<|"(gtest|gmock|isl|json)/)' - Priority: 3 - - Regex: '.*' - Priority: 1 -IncludeIsMainRegex: '(Test)?$' -IndentCaseLabels: false -IndentPPDirectives: None -IndentWidth: 2 -IndentWrappedFunctionNames: false -JavaScriptQuotes: Leave -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: All -ObjCBlockIndentWidth: 2 -ObjCSpaceAfterProperty: false -ObjCSpaceBeforeProtocolList: true -PenaltyBreakAssignment: 2 -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Left -ReflowComments: true -SortIncludes: true -SortUsingDeclarations: true -SpaceAfterCStyleCast: false -SpaceAfterTemplateKeyword: true -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -#SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: false -SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Cpp11 -TabWidth: 8 UseTab: Never +ColumnLimit: 100 +NamespaceIndentation: Inner +AlignConsecutiveAssignments: true +SortIncludes: Never +ReflowComments: false ... diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 140ae12d0..c0eb14386 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,4 @@ { - "name": "eic-shell", - "image": "ghcr.io/eic/jug_xl:nightly" + "name": "eic-shell", + "image": "ghcr.io/eic/jug_xl:nightly" } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f25a40848..812231abd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,3 @@ -ci: - skip: [clang-format] repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -7,8 +5,8 @@ repos: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace -- repo: https://github.com/pocc/pre-commit-hooks - rev: v1.3.5 +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.3 hooks: - id: clang-format - repo: https://github.com/Lucas-C/pre-commit-hooks diff --git a/calibrations/calo_digi_default.json b/calibrations/calo_digi_default.json index 387f1a18e..6f39a7fe6 100644 --- a/calibrations/calo_digi_default.json +++ b/calibrations/calo_digi_default.json @@ -1,66 +1,66 @@ { - "ecal_neg_endcap": { - "readout": "module", - "dynamicRange": "20*GeV", - "capacityBitsADC": 14, - "pedestalMean": 100, - "pedestalSigma": 1, - "thresholdValue": 3 - }, - "hcal_neg_endcap": { - "readout": "tile", - "dynamicRange": "20*MeV", - "capacityBitsADC": 8, - "pedestalMean": 20, - "pedestalSigma": 0.3, - "thresholdValue": 1 - }, - "ecal_pos_endcap": { - "readout": "module", - "dynamicRange": "3*GeV", - "capacityBitsADC": 14, - "pedestalMean": 100, - "pedestalSigma": 0.7, - "thresholdValue": 2 - }, - "hcal_pos_endcap": { - "readout": "tile", - "dynamicRange": "3.6*GeV", - "capacityBitsADC": 10, - "pedestalMean": 20, - "pedestalSigma": 0.8, - "thresholdValue": 3 - }, - "hcal_pos_endcap_insert": { - "readout": "tile", - "dynamicRange": "200*MeV", - "capacityBitsADC": 15, - "pedestalMean": 400, - "pedestalSigma": 10, - "thresholdValue": 0 - }, - "ecal_barrel_imaging": { - "readout": "pixel", - "dynamicRange": "3*MeV", - "capacityBitsADC": 13, - "pedestalMean": 100, - "pedestalSigma": 14, - "thresholdValue": 50 - }, - "ecal_barrel_scfi": { - "readout": "light_guide", - "dynamicRange": "750*MeV", - "capacityBitsADC": 14, - "pedestalMean": 20, - "pedestalSigma": 0.3, - "thresholdValue": 1 - }, - "hcal_barrel": { - "readout": "tile", - "dynamicRange": "20*MeV", - "capacityBitsADC": 8, - "pedestalMean": 20, - "pedestalSigma": 0.3, - "thresholdValue": 1 - } + "ecal_neg_endcap": { + "readout": "module", + "dynamicRange": "20*GeV", + "capacityBitsADC": 14, + "pedestalMean": 100, + "pedestalSigma": 1, + "thresholdValue": 3 + }, + "hcal_neg_endcap": { + "readout": "tile", + "dynamicRange": "20*MeV", + "capacityBitsADC": 8, + "pedestalMean": 20, + "pedestalSigma": 0.3, + "thresholdValue": 1 + }, + "ecal_pos_endcap": { + "readout": "module", + "dynamicRange": "3*GeV", + "capacityBitsADC": 14, + "pedestalMean": 100, + "pedestalSigma": 0.7, + "thresholdValue": 2 + }, + "hcal_pos_endcap": { + "readout": "tile", + "dynamicRange": "3.6*GeV", + "capacityBitsADC": 10, + "pedestalMean": 20, + "pedestalSigma": 0.8, + "thresholdValue": 3 + }, + "hcal_pos_endcap_insert": { + "readout": "tile", + "dynamicRange": "200*MeV", + "capacityBitsADC": 15, + "pedestalMean": 400, + "pedestalSigma": 10, + "thresholdValue": 0 + }, + "ecal_barrel_imaging": { + "readout": "pixel", + "dynamicRange": "3*MeV", + "capacityBitsADC": 13, + "pedestalMean": 100, + "pedestalSigma": 14, + "thresholdValue": 50 + }, + "ecal_barrel_scfi": { + "readout": "light_guide", + "dynamicRange": "750*MeV", + "capacityBitsADC": 14, + "pedestalMean": 20, + "pedestalSigma": 0.3, + "thresholdValue": 1 + }, + "hcal_barrel": { + "readout": "tile", + "dynamicRange": "20*MeV", + "capacityBitsADC": 8, + "pedestalMean": 20, + "pedestalSigma": 0.3, + "thresholdValue": 1 + } } diff --git a/calibrations/emcal_barrel_calibration.json b/calibrations/emcal_barrel_calibration.json index a24a048aa..8a696b9bb 100644 --- a/calibrations/emcal_barrel_calibration.json +++ b/calibrations/emcal_barrel_calibration.json @@ -1,9 +1,9 @@ { - "electron": { - "particle_name": "electron", - "sampling_fraction": 0.10856976476514045, - "sampling_fraction_img": 0.00595078393326404, - "sampling_fraction_scfi": 0.10262666247845109, - "thrown_energy": 4.975791477972636 - } + "electron": { + "particle_name": "electron", + "sampling_fraction": 0.10856976476514045, + "sampling_fraction_img": 0.00595078393326404, + "sampling_fraction_scfi": 0.10262666247845109, + "thrown_energy": 4.975791477972636 + } } diff --git a/calibrations/ffi_zdc.json b/calibrations/ffi_zdc.json index 40ba1d697..543b04599 100644 --- a/calibrations/ffi_zdc.json +++ b/calibrations/ffi_zdc.json @@ -1,16 +1,22 @@ { - "ffi_zdc_ecal": { - "sampling_fraction": 1.0, - "minClusterCenterEdep": "3.*MeV", - "minClusterHitEdep": "0.1*MeV", - "localDistXY": ["50*mm", "50*mm"], - "splitCluster": true - }, - "ffi_zdc_hcal": { - "sampling_fraction": 1.0, - "minClusterCenterEdep": "1.*MeV", - "minClusterHitEdep": "0.1*MeV", - "localDistXY": ["200*mm", "200*mm"], - "splitCluster": false - } + "ffi_zdc_ecal": { + "sampling_fraction": 1.0, + "minClusterCenterEdep": "3.*MeV", + "minClusterHitEdep": "0.1*MeV", + "localDistXY": [ + "50*mm", + "50*mm" + ], + "splitCluster": true + }, + "ffi_zdc_hcal": { + "sampling_fraction": 1.0, + "minClusterCenterEdep": "1.*MeV", + "minClusterHitEdep": "0.1*MeV", + "localDistXY": [ + "200*mm", + "200*mm" + ], + "splitCluster": false + } } diff --git a/scripts/test_ACTS.cxx b/scripts/test_ACTS.cxx index a949db76c..26416f9c4 100644 --- a/scripts/test_ACTS.cxx +++ b/scripts/test_ACTS.cxx @@ -11,8 +11,7 @@ * * */ -void test_ACTS(const char* compact = "epic.xml") -{ +void test_ACTS(const char* compact = "epic.xml") { // ------------------------- // Get the DD4hep instance // Load the compact XML file @@ -20,9 +19,9 @@ void test_ACTS(const char* compact = "epic.xml") auto detector = dd4hep::Detector::make_unique(""); detector->fromCompact(compact); - auto logger = Acts::getDefaultLogger("Acts", Acts::Logging::Level::VERBOSE); + auto logger = Acts::getDefaultLogger("Acts", Acts::Logging::Level::VERBOSE); auto acts_tracking_geometry = Acts::convertDD4hepDetector(detector->world(), *logger); // Visit all surfaces - acts_tracking_geometry->visitSurfaces([](const Acts::Surface *surface) { }); + acts_tracking_geometry->visitSurfaces([](const Acts::Surface* surface) {}); } diff --git a/src/B0ECal_geo.cpp b/src/B0ECal_geo.cpp index 6a8ad9bc4..f5c271266 100644 --- a/src/B0ECal_geo.cpp +++ b/src/B0ECal_geo.cpp @@ -22,13 +22,13 @@ using std::tuple; using std::vector; using namespace dd4hep; -static tuple<Volume, Position> build_module(Detector& desc, xml_coll_t& plm, SensitiveDetector& sens); +static tuple<Volume, Position> build_module(Detector& desc, xml_coll_t& plm, + SensitiveDetector& sens); -static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - string detName = x_det.nameStr(); - int detID = x_det.id(); +static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) { + xml_det_t x_det = e; + string detName = x_det.nameStr(); + int detID = x_det.id(); DetElement det(detName, detID); sens.setType("calorimeter"); @@ -39,9 +39,9 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) xml_dim_t rot = x_det.rotation(); // module placement - xml_comp_t plm = x_det.child(_Unicode(placements)); + xml_comp_t plm = x_det.child(_Unicode(placements)); map<int, int> sectorModuleNumbers; - auto addModuleNumbers = [§orModuleNumbers](int sector, int nmod) { + auto addModuleNumbers = [§orModuleNumbers](int sector, int nmod) { auto it = sectorModuleNumbers.find(sector); if (it != sectorModuleNumbers.end()) { it->second += nmod; @@ -53,7 +53,8 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) int sector_id = 1; for (xml_coll_t mod(plm, _Unicode(individuals)); mod; ++mod) { - auto [sector, nmod] = ip6::geo::add_individuals(build_module, desc, detVol, mod, sens, sector_id++); + auto [sector, nmod] = + ip6::geo::add_individuals(build_module, desc, detVol, mod, sens, sector_id++); addModuleNumbers(sector, nmod); } @@ -63,8 +64,8 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) } // position and rotation of parent volume - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume detPV = motherVol.placeVolume(detVol, tr); detPV.addPhysVolID("system", detID); det.setPlacement(detPV); @@ -72,14 +73,14 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) } // helper function to build module with or w/o wrapper -static tuple<Volume, Position> build_module(Detector& desc, xml::Collection_t& plm, SensitiveDetector& sens) -{ - auto mod = plm.child(_Unicode(module)); - auto sx = mod.attr<double>(_Unicode(sizex)); - auto sy = mod.attr<double>(_Unicode(sizey)); - auto sz = mod.attr<double>(_Unicode(sizez)); - Box modShape(sx / 2., sy / 2., sz / 2.); - auto modMat = desc.material(mod.attr<string>(_Unicode(material))); +static tuple<Volume, Position> build_module(Detector& desc, xml::Collection_t& plm, + SensitiveDetector& sens) { + auto mod = plm.child(_Unicode(module)); + auto sx = mod.attr<double>(_Unicode(sizex)); + auto sy = mod.attr<double>(_Unicode(sizey)); + auto sz = mod.attr<double>(_Unicode(sizez)); + Box modShape(sx / 2., sy / 2., sz / 2.); + auto modMat = desc.material(mod.attr<string>(_Unicode(material))); Volume modVol("module_vol", modShape, modMat); modVol.setSensitiveDetector(sens); modVol.setVisAttributes(desc.visAttributes(mod.attr<string>(_Unicode(vis)))); @@ -94,8 +95,8 @@ static tuple<Volume, Position> build_module(Detector& desc, xml::Collection_t& p if (thickness < 1e-12 * mm) { return make_tuple(modVol, Position{sx, sy, sz}); } - auto wrpMat = desc.material(wrp.attr<string>(_Unicode(material))); - Box wrpShape((sx + thickness) / 2., (sy + thickness) / 2., sz / 2.); + auto wrpMat = desc.material(wrp.attr<string>(_Unicode(material))); + Box wrpShape((sx + thickness) / 2., (sy + thickness) / 2., sz / 2.); Volume wrpVol("wrapper_vol", wrpShape, wrpMat); wrpVol.placeVolume(modVol, Position(0., 0., 0.)); wrpVol.setVisAttributes(desc.visAttributes(wrp.attr<string>(_Unicode(vis)))); diff --git a/src/B0Preshower_geo.cpp b/src/B0Preshower_geo.cpp index 27f8e49a9..f85e417fd 100644 --- a/src/B0Preshower_geo.cpp +++ b/src/B0Preshower_geo.cpp @@ -14,67 +14,66 @@ using namespace dd4hep::detail; * * This geometric element has been deprecated. ACTS tracking interface has also been removed. - Sakib Rahman (Dec 20, 2022) */ -static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; - Material vacuum = description.vacuum(); - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - bool reflect = x_det.reflect(false); - DetElement sdet(det_name, det_id); - Assembly assembly(det_name); - xml::Component pos = x_det.position(); - xml::Component rot = x_det.rotation(); + xml_det_t x_det = e; + Material vacuum = description.vacuum(); + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + bool reflect = x_det.reflect(false); + DetElement sdet(det_name, det_id); + Assembly assembly(det_name); + xml::Component pos = x_det.position(); + xml::Component rot = x_det.rotation(); // Material air = description.material("Air"); // Volume assembly (det_name,Box(10000,10000,10000),vacuum); - Volume motherVol = description.pickMotherVolume(sdet); - int m_id = 0, c_id = 0, n_sensor = 0; - map<string, Volume> modules; + Volume motherVol = description.pickMotherVolume(sdet); + int m_id = 0, c_id = 0, n_sensor = 0; + map<string, Volume> modules; map<string, Placements> sensitives; - PlacedVolume pv; + PlacedVolume pv; assembly.setVisAttributes(description.invisible()); sens.setType("tracker"); for (xml_coll_t mi(x_det, _U(module)); mi; ++mi, ++m_id) { xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); + string m_nam = x_mod.nameStr(); xml_comp_t trd = x_mod.trd(); - double posY; - double x1 = trd.x1(); - double x2 = trd.x2(); - double z = trd.z(); - double y1, y2, total_thickness = 0.; + double posY; + double x1 = trd.x1(); + double x2 = trd.x2(); + double z = trd.z(); + double y1, y2, total_thickness = 0.; xml_coll_t ci(x_mod, _U(module_component)); for (ci.reset(), total_thickness = 0.0; ci; ++ci) total_thickness += xml_comp_t(ci).thickness(); y1 = y2 = total_thickness / 2; Trapezoid m_solid(x1, x2, y1, y2, z); - Volume m_volume(m_nam, m_solid, vacuum); + Volume m_volume(m_nam, m_solid, vacuum); m_volume.setVisAttributes(description.visAttributes(x_mod.visStr())); Solid frame_s; if (x_mod.hasChild(_U(frame))) { // build frame from trd (assumed to be smaller) - xml_comp_t m_frame = x_mod.child(_U(frame)); - xml_comp_t f_pos = m_frame.child(_U(position)); - xml_comp_t frame_trd = m_frame.trd(); - double frame_thickness = getAttrOrDefault(m_frame, _U(thickness), total_thickness); - double frame_x1 = frame_trd.x1(); - double frame_x2 = frame_trd.x2(); - double frame_z = frame_trd.z(); + xml_comp_t m_frame = x_mod.child(_U(frame)); + xml_comp_t f_pos = m_frame.child(_U(position)); + xml_comp_t frame_trd = m_frame.trd(); + double frame_thickness = getAttrOrDefault(m_frame, _U(thickness), total_thickness); + double frame_x1 = frame_trd.x1(); + double frame_x2 = frame_trd.x2(); + double frame_z = frame_trd.z(); // make the frame match the total thickness if thickness attribute is not given - Trapezoid f_solid1(x1, x2, frame_thickness / 2.0, frame_thickness / 2.0, z); - Trapezoid f_solid(frame_x1, frame_x2, frame_thickness / 2.0, frame_thickness / 2.0, frame_z); + Trapezoid f_solid1(x1, x2, frame_thickness / 2.0, frame_thickness / 2.0, z); + Trapezoid f_solid(frame_x1, frame_x2, frame_thickness / 2.0, frame_thickness / 2.0, frame_z); SubtractionSolid frame_shape(f_solid1, f_solid); frame_s = frame_shape; Material f_mat = description.material(m_frame.materialStr()); - Volume f_vol(m_nam + "_frame", frame_shape, f_mat); + Volume f_vol(m_nam + "_frame", frame_shape, f_mat); f_vol.setVisAttributes(description.visAttributes(m_frame.visStr())); // figure out how to best place @@ -82,17 +81,17 @@ static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetecto } for (ci.reset(), n_sensor = 1, c_id = 0, posY = -y1; ci; ++ci, ++c_id) { - xml_comp_t c = ci; - double c_thick = c.thickness(); - auto comp_x1 = getAttrOrDefault(c, _Unicode(x1), x1); - auto comp_x2 = getAttrOrDefault(c, _Unicode(x2), x2); - auto comp_height = getAttrOrDefault(c, _Unicode(height), z); + xml_comp_t c = ci; + double c_thick = c.thickness(); + auto comp_x1 = getAttrOrDefault(c, _Unicode(x1), x1); + auto comp_x2 = getAttrOrDefault(c, _Unicode(x2), x2); + auto comp_height = getAttrOrDefault(c, _Unicode(height), z); - Material c_mat = description.material(c.materialStr()); - string c_name = _toString(c_id, "component%d"); + Material c_mat = description.material(c.materialStr()); + string c_name = _toString(c_id, "component%d"); Trapezoid comp_s1(comp_x1, comp_x2, c_thick / 2e0, c_thick / 2e0, comp_height); - Solid comp_shape = comp_s1; + Solid comp_shape = comp_s1; if (frame_s.isValid()) { comp_shape = SubtractionSolid(comp_s1, frame_s); } @@ -102,7 +101,8 @@ static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetecto pv = m_volume.placeVolume(c_vol, Position(0, posY + c_thick / 2, 0)); if (c.isSensitive()) { // std::cout << " adding sensitive volume" << c_name << "\n"; - sdet.check(n_sensor > 2, "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); + sdet.check(n_sensor > 2, + "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); pv.addPhysVolID("sensor", n_sensor); sens.setType("tracker"); c_vol.setSensitiveDetector(sens); @@ -116,11 +116,11 @@ static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetecto for (xml_coll_t li(x_det, _U(layer)); li; ++li) { xml_comp_t x_layer(li); - int l_id = x_layer.id(); - int mod_num = 1; + int l_id = x_layer.id(); + int mod_num = 1; - xml_comp_t l_env = x_layer.child(_U(envelope)); - string layer_name = det_name + std::string("_layer") + std::to_string(l_id); + xml_comp_t l_env = x_layer.child(_U(envelope)); + string layer_name = det_name + std::string("_layer") + std::to_string(l_id); std::string layer_vis = l_env.attr<std::string>(_Unicode(vis)); // double layer_rmin = l_env.attr<double>(_Unicode(rmin)); @@ -140,8 +140,8 @@ static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetecto PlacedVolume layer_pv; if (reflect) { - layer_pv = - assembly.placeVolume(layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z))); + layer_pv = assembly.placeVolume( + layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z))); layer_pv.addPhysVolID("barrel", 3).addPhysVolID("layer", l_id); layer_name += "_N"; } else { @@ -153,17 +153,17 @@ static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetecto layer_element.setPlacement(layer_pv); for (xml_coll_t ri(x_layer, _U(ring)); ri; ++ri) { - xml_comp_t x_ring = ri; - double r = x_ring.r(); - double phi0 = x_ring.phi0(0); - double zstart = x_ring.zstart(); - double dz = x_ring.dz(0); - int nmodules = x_ring.nmodules(); - string m_nam = x_ring.moduleStr(); - Volume m_vol = modules[m_nam]; - double iphi = 2 * M_PI / nmodules; - double dphi = dd4hep::getAttrOrDefault(x_ring, _Unicode(dphi), iphi); - double phi = phi0; + xml_comp_t x_ring = ri; + double r = x_ring.r(); + double phi0 = x_ring.phi0(0); + double zstart = x_ring.zstart(); + double dz = x_ring.dz(0); + int nmodules = x_ring.nmodules(); + string m_nam = x_ring.moduleStr(); + Volume m_vol = modules[m_nam]; + double iphi = 2 * M_PI / nmodules; + double dphi = dd4hep::getAttrOrDefault(x_ring, _Unicode(dphi), iphi); + double phi = phi0; Placements& sensVols = sensitives[m_nam]; for (int k = 0; k < nmodules; ++k) { @@ -173,27 +173,25 @@ static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetecto if (!reflect) { DetElement module(layer_element, m_base + "_pos", det_id); - pv = layer_vol.placeVolume( - m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, zstart + dz))); + pv = layer_vol.placeVolume(m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), + Position(x, y, zstart + dz))); pv.addPhysVolID("barrel", 1).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num); module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(module, sens_pv.volume().name(), mod_num); + DetElement comp_elt(module, sens_pv.volume().name(), mod_num); comp_elt.setPlacement(sens_pv); - } } else { - pv = layer_vol.placeVolume( - m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, -zstart - dz))); + pv = layer_vol.placeVolume(m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), + Position(x, y, -zstart - dz))); pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num); DetElement r_module(layer_element, m_base + "_neg", det_id); r_module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(r_module, sens_pv.volume().name(), mod_num); + DetElement comp_elt(r_module, sens_pv.volume().name(), mod_num); comp_elt.setPlacement(sens_pv); - } } dz = -dz; @@ -202,7 +200,8 @@ static Ref_t create_B0Preshower(Detector& description, xml_h e, SensitiveDetecto } } } - Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), + Position(pos.x(), pos.y(), pos.z())); pv = motherVol.placeVolume(assembly, posAndRot); pv.addPhysVolID("system", det_id); sdet.setPlacement(pv); diff --git a/src/B0Tracker_geo.cpp b/src/B0Tracker_geo.cpp index ab175d319..ac6a3dc9d 100644 --- a/src/B0Tracker_geo.cpp +++ b/src/B0Tracker_geo.cpp @@ -22,37 +22,35 @@ using namespace dd4hep::detail; * @author Whitney Armstrong * */ -static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; - Material vacuum = description.vacuum(); - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - DetElement sdet(det_name, det_id); - Assembly assembly(det_name); + xml_det_t x_det = e; + Material vacuum = description.vacuum(); + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + DetElement sdet(det_name, det_id); + Assembly assembly(det_name); xml::Component pos = x_det.position(); xml::Component rot = x_det.rotation(); - Volume motherVol = description.pickMotherVolume(sdet); - int m_id = 0, c_id = 0, n_sensor = 0; + Volume motherVol = description.pickMotherVolume(sdet); + int m_id = 0, c_id = 0, n_sensor = 0; PlacedVolume pv; - map<string, Volume> modules; - map<string, Placements> sensitives; + map<string, Volume> modules; + map<string, Placements> sensitives; map<string, std::vector<VolPlane>> volplane_surfaces; map<string, std::array<double, 2>> module_thicknesses; // Set detector type flag dd4hep::xml::setDetectorTypeFlag(x_det, sdet); - auto ¶ms = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( - sdet); + auto& params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(sdet); // Add the volume boundary material if configured for (xml_coll_t bmat(x_det, _Unicode(boundary_material)); bmat; ++bmat) { xml_comp_t x_boundary_material = bmat; DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, - "boundary_material"); + "boundary_material"); } assembly.setVisAttributes(description.invisible()); @@ -60,41 +58,41 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector for (xml_coll_t mi(x_det, _U(module)); mi; ++mi, ++m_id) { xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); + string m_nam = x_mod.nameStr(); xml_comp_t trd = x_mod.trd(); - double posY; - double x1 = trd.x1(); - double x2 = trd.x2(); - double z = trd.z(); - double y1, y2, total_thickness = 0.; + double posY; + double x1 = trd.x1(); + double x2 = trd.x2(); + double z = trd.z(); + double y1, y2, total_thickness = 0.; xml_coll_t ci(x_mod, _U(module_component)); for (ci.reset(), total_thickness = 0.0; ci; ++ci) total_thickness += xml_comp_t(ci).thickness(); y1 = y2 = total_thickness / 2; Trapezoid m_solid(x1, x2, y1, y2, z); - Volume m_volume(m_nam, m_solid, vacuum); + Volume m_volume(m_nam, m_solid, vacuum); m_volume.setVisAttributes(description.visAttributes(x_mod.visStr())); Solid frame_s; if (x_mod.hasChild(_U(frame))) { // build frame from trd (assumed to be smaller) - xml_comp_t m_frame = x_mod.child(_U(frame)); - xml_comp_t f_pos = m_frame.child(_U(position)); - xml_comp_t frame_trd = m_frame.trd(); - double frame_thickness = getAttrOrDefault(m_frame, _U(thickness), total_thickness); - double frame_x1 = frame_trd.x1(); - double frame_x2 = frame_trd.x2(); - double frame_z = frame_trd.z(); + xml_comp_t m_frame = x_mod.child(_U(frame)); + xml_comp_t f_pos = m_frame.child(_U(position)); + xml_comp_t frame_trd = m_frame.trd(); + double frame_thickness = getAttrOrDefault(m_frame, _U(thickness), total_thickness); + double frame_x1 = frame_trd.x1(); + double frame_x2 = frame_trd.x2(); + double frame_z = frame_trd.z(); // make the frame match the total thickness if thickness attribute is not given - Trapezoid f_solid1(x1, x2, frame_thickness / 2.0, frame_thickness / 2.0, z); - Trapezoid f_solid(frame_x1, frame_x2, frame_thickness / 2.0, frame_thickness / 2.0, frame_z); + Trapezoid f_solid1(x1, x2, frame_thickness / 2.0, frame_thickness / 2.0, z); + Trapezoid f_solid(frame_x1, frame_x2, frame_thickness / 2.0, frame_thickness / 2.0, frame_z); SubtractionSolid frame_shape(f_solid1, f_solid); frame_s = frame_shape; Material f_mat = description.material(m_frame.materialStr()); - Volume f_vol(m_nam + "_frame", frame_shape, f_mat); + Volume f_vol(m_nam + "_frame", frame_shape, f_mat); // f_vol.setVisAttributes(description.visAttributes(m_frame.visStr())); // figure out how to best place @@ -103,17 +101,17 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector double thickness_so_far = 0.0; for (ci.reset(), n_sensor = 1, c_id = 0, posY = -y1; ci; ++ci, ++c_id) { - xml_comp_t c = ci; - double c_thick = c.thickness(); - auto comp_x1 = getAttrOrDefault(c, _Unicode(x1), x1); - auto comp_x2 = getAttrOrDefault(c, _Unicode(x2), x2); - auto comp_height = getAttrOrDefault(c, _Unicode(height), z); + xml_comp_t c = ci; + double c_thick = c.thickness(); + auto comp_x1 = getAttrOrDefault(c, _Unicode(x1), x1); + auto comp_x2 = getAttrOrDefault(c, _Unicode(x2), x2); + auto comp_height = getAttrOrDefault(c, _Unicode(height), z); - Material c_mat = description.material(c.materialStr()); - string c_name = _toString(c_id, "component%d"); + Material c_mat = description.material(c.materialStr()); + string c_name = _toString(c_id, "component%d"); Trapezoid comp_s1(comp_x1, comp_x2, c_thick / 2e0, c_thick / 2e0, comp_height); - Solid comp_shape = comp_s1; + Solid comp_shape = comp_s1; if (frame_s.isValid()) { comp_shape = SubtractionSolid(comp_s1, frame_s); } @@ -123,7 +121,8 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector pv = m_volume.placeVolume(c_vol, Position(0, posY + c_thick / 2, 0)); if (c.isSensitive()) { // std::cout << " adding sensitive volume" << c_name << "\n"; - sdet.check(n_sensor > 2, "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); + sdet.check(n_sensor > 2, + "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); pv.addPhysVolID("sensor", n_sensor); c_vol.setSensitiveDetector(sens); sensitives[m_nam].push_back(pv); @@ -158,20 +157,20 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector for (xml_coll_t li(x_det, _U(layer)); li; ++li) { xml_comp_t x_layer(li); - int l_id = x_layer.id(); - int mod_num = 1; - - xml_comp_t l_env = x_layer.child(_U(envelope)); - string layer_name = det_name + std::string("_layer") + std::to_string(l_id); - - std::string layer_vis = l_env.attr<std::string>(_Unicode(vis)); - double layer_rmin_tolerance = l_env.attr<double>(_Unicode(rmin_tolerance)); - double layer_rmax_tolerance = l_env.attr<double>(_Unicode(rmax_tolerance)); - double layer_zmin_tolerance = l_env.attr<double>(_Unicode(zmin_tolerance)); - double layer_zmax_tolerance = l_env.attr<double>(_Unicode(zmax_tolerance)); - double layer_length = l_env.attr<double>(_Unicode(length)); - double layer_zstart = l_env.attr<double>(_Unicode(zstart)); - double layer_center_z = layer_zstart + layer_length / 2.0; + int l_id = x_layer.id(); + int mod_num = 1; + + xml_comp_t l_env = x_layer.child(_U(envelope)); + string layer_name = det_name + std::string("_layer") + std::to_string(l_id); + + std::string layer_vis = l_env.attr<std::string>(_Unicode(vis)); + double layer_rmin_tolerance = l_env.attr<double>(_Unicode(rmin_tolerance)); + double layer_rmax_tolerance = l_env.attr<double>(_Unicode(rmax_tolerance)); + double layer_zmin_tolerance = l_env.attr<double>(_Unicode(zmin_tolerance)); + double layer_zmax_tolerance = l_env.attr<double>(_Unicode(zmax_tolerance)); + double layer_length = l_env.attr<double>(_Unicode(length)); + double layer_zstart = l_env.attr<double>(_Unicode(zstart)); + double layer_center_z = layer_zstart + layer_length / 2.0; // printout(INFO,"ROOTGDMLParse","+++ Read geometry from GDML file file:%s",input.c_str()); // std::cout << "SiTracker Endcap layer " << l_id << " zstart = " << layer_zstart/dd4hep::mm << "mm ( " << // layer_length/dd4hep::mm << " mm thick )\n"; @@ -184,22 +183,21 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector DetElement layer_element(sdet, layer_name, l_id); layer_element.setPlacement(layer_pv); - auto &layerParams = - DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( - layer_element); + auto& layerParams = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(layer_element); for (xml_coll_t ri(x_layer, _U(ring)); ri; ++ri) { - xml_comp_t x_ring = ri; - double r = x_ring.r(); - double phi0 = x_ring.phi0(0); - double zstart = x_ring.zstart(); - double dz = x_ring.dz(0); - int nmodules = x_ring.nmodules(); - string m_nam = x_ring.moduleStr(); - Volume m_vol = modules[m_nam]; - double iphi = 2 * M_PI / nmodules; - double dphi = dd4hep::getAttrOrDefault(x_ring, _Unicode(dphi), iphi); - double phi = phi0; + xml_comp_t x_ring = ri; + double r = x_ring.r(); + double phi0 = x_ring.phi0(0); + double zstart = x_ring.zstart(); + double dz = x_ring.dz(0); + int nmodules = x_ring.nmodules(); + string m_nam = x_ring.moduleStr(); + Volume m_vol = modules[m_nam]; + double iphi = 2 * M_PI / nmodules; + double dphi = dd4hep::getAttrOrDefault(x_ring, _Unicode(dphi), iphi); + double phi = phi0; Placements& sensVols = sensitives[m_nam]; for (int k = 0; k < nmodules; ++k) { @@ -209,15 +207,16 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector // if (!reflect) { DetElement module(layer_element, m_base + "_pos", det_id); - pv = layer_vol.placeVolume( - m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, zstart + dz))); + pv = layer_vol.placeVolume(m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), + Position(x, y, zstart + dz))); pv.addPhysVolID("layer", l_id).addPhysVolID("module", mod_num); module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(module, sens_pv.volume().name(), mod_num); + DetElement comp_elt(module, sens_pv.volume().name(), mod_num); comp_elt.setPlacement(sens_pv); - auto &comp_elt_params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_elt); + auto& comp_elt_params = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_elt); comp_elt_params.set<std::string>("axis_definitions", "XZY"); volSurfaceList(comp_elt)->push_back(volplane_surfaces[m_nam][ic]); } @@ -227,17 +226,19 @@ static Ref_t create_B0Tracker(Detector& description, xml_h e, SensitiveDetector } } layer_vol->GetShape()->ComputeBBox(); - layerParams.set<double>("envelope_r_min", layer_rmin_tolerance/dd4hep::mm); - layerParams.set<double>("envelope_r_max", layer_rmax_tolerance/dd4hep::mm); - layerParams.set<double>("envelope_z_min", layer_zmin_tolerance/dd4hep::mm); - layerParams.set<double>("envelope_z_max", layer_zmax_tolerance/dd4hep::mm); + layerParams.set<double>("envelope_r_min", layer_rmin_tolerance / dd4hep::mm); + layerParams.set<double>("envelope_r_max", layer_rmax_tolerance / dd4hep::mm); + layerParams.set<double>("envelope_z_min", layer_zmin_tolerance / dd4hep::mm); + layerParams.set<double>("envelope_z_max", layer_zmax_tolerance / dd4hep::mm); for (xml_coll_t lmat(x_layer, _Unicode(layer_material)); lmat; ++lmat) { xml_comp_t x_layer_material = lmat; - DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, "layer_material"); + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, + "layer_material"); } } - Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), + Position(pos.x(), pos.y(), pos.z())); pv = motherVol.placeVolume(assembly, posAndRot); pv.addPhysVolID("system", det_id); sdet.setPlacement(pv); diff --git a/src/BackwardsBeamPipe_geo.cpp b/src/BackwardsBeamPipe_geo.cpp index 54d12bfcb..127aa1c7d 100644 --- a/src/BackwardsBeamPipe_geo.cpp +++ b/src/BackwardsBeamPipe_geo.cpp @@ -20,26 +20,27 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) { using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Al = det.material("Aluminum"); - Material m_Vacuum = det.material("Vacuum"); - string vis_name = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "BeamPipeVis"); + Assembly assembly(det_name + "_assembly"); + Material m_Al = det.material("Aluminum"); + Material m_Vacuum = det.material("Vacuum"); + string vis_name = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "BeamPipeVis"); xml::Component Pipe_c = x_det.child(_Unicode(Pipe)); // Get pipe dimensions from xml double thickness = Pipe_c.attr<double>(_Unicode(wall_thickness)); - double innerD1 = Pipe_c.hasAttr(_Unicode(innerD1)) ? Pipe_c.attr<double>(_Unicode(innerD1)) - : Pipe_c.attr<double>(_Unicode(outerD1)) - 2 * thickness; - double innerD2 = Pipe_c.hasAttr(_Unicode(innerD2)) ? Pipe_c.attr<double>(_Unicode(innerD2)) - : Pipe_c.attr<double>(_Unicode(outerD2)) - 2 * thickness; + double innerD1 = Pipe_c.hasAttr(_Unicode(innerD1)) + ? Pipe_c.attr<double>(_Unicode(innerD1)) + : Pipe_c.attr<double>(_Unicode(outerD1)) - 2 * thickness; + double innerD2 = Pipe_c.hasAttr(_Unicode(innerD2)) + ? Pipe_c.attr<double>(_Unicode(innerD2)) + : Pipe_c.attr<double>(_Unicode(outerD2)) - 2 * thickness; double end1z = Pipe_c.attr<double>(_Unicode(end1z)); double end2z = Pipe_c.attr<double>(_Unicode(end2z)); @@ -65,8 +66,8 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * // ----------------------------- // final placement - auto pv_assembly = - det.pickMotherVolume(sdet).placeVolume(assembly, Transform3D(RotationY(yrot), Position(end1x, 0.0, end1z))); + auto pv_assembly = det.pickMotherVolume(sdet).placeVolume( + assembly, Transform3D(RotationY(yrot), Position(end1x, 0.0, end1z))); pv_assembly.addPhysVolID("system", sdet.id()).addPhysVolID("barrel", 1); sdet.setPlacement(pv_assembly); assembly->GetShape()->ComputeBBox(); diff --git a/src/BackwardsCollimator.cpp b/src/BackwardsCollimator.cpp index d511e5cdc..d86a3aea0 100644 --- a/src/BackwardsCollimator.cpp +++ b/src/BackwardsCollimator.cpp @@ -31,30 +31,29 @@ using namespace dd4hep; * \endcode * */ -static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) { using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Steel = det.material("StainlessSteel"); - Material m_Vacuum = det.material("Vacuum"); - string vis_name = x_det.visStr(); + Assembly assembly(det_name + "_assembly"); + Material m_Steel = det.material("StainlessSteel"); + Material m_Vacuum = det.material("Vacuum"); + string vis_name = x_det.visStr(); xml::Component box_dim = x_det.child(_Unicode(dimensions)); - double height = box_dim.attr<double>(_Unicode(height)); - double width = box_dim.attr<double>(_Unicode(width)); - double depth = box_dim.attr<double>(_Unicode(depth)); + double height = box_dim.attr<double>(_Unicode(height)); + double width = box_dim.attr<double>(_Unicode(width)); + double depth = box_dim.attr<double>(_Unicode(depth)); - xml::Component col_XS = x_det.child(_Unicode(collimator)); - double colHeight = col_XS.attr<double>(_Unicode(height)); - double colWidth = col_XS.attr<double>(_Unicode(width)); - double colXOff = col_XS.attr<double>(_Unicode(xOff)); + xml::Component col_XS = x_det.child(_Unicode(collimator)); + double colHeight = col_XS.attr<double>(_Unicode(height)); + double colWidth = col_XS.attr<double>(_Unicode(width)); + double colXOff = col_XS.attr<double>(_Unicode(xOff)); xml::Component box_place = x_det.child(_Unicode(placement)); - double zOff = box_place.attr<double>(_Unicode(z)); + double zOff = box_place.attr<double>(_Unicode(z)); Box box_steel(width, height, depth); Box box_vacuum(colWidth, colHeight, depth); diff --git a/src/BackwardsLumiVac_geo.cpp b/src/BackwardsLumiVac_geo.cpp index e5d4974ff..fd89fa2fd 100644 --- a/src/BackwardsLumiVac_geo.cpp +++ b/src/BackwardsLumiVac_geo.cpp @@ -9,8 +9,7 @@ using namespace std; using namespace dd4hep; -static Ref_t createDetector(Detector& lccdd, xml_h e, SensitiveDetector /*sens*/) -{ +static Ref_t createDetector(Detector& lccdd, xml_h e, SensitiveDetector /*sens*/) { xml_det_t x_det = e; @@ -74,7 +73,7 @@ static Ref_t createDetector(Detector& lccdd, xml_h e, SensitiveDetector /*sens*/ DetElement det(x_det.nameStr(), x_det.id()); - Transform3D pos(RotationZYX(0, 0, 0), Position(0, 0, zcen)); + Transform3D pos(RotationZYX(0, 0, 0), Position(0, 0, zcen)); PlacedVolume pv = lccdd.pickMotherVolume(det).placeVolume(vol, pos); det.setPlacement(pv); diff --git a/src/BackwardsTaggers_geo.cpp b/src/BackwardsTaggers_geo.cpp index f10f53886..96745409d 100644 --- a/src/BackwardsTaggers_geo.cpp +++ b/src/BackwardsTaggers_geo.cpp @@ -7,7 +7,6 @@ #include "DDRec/DetectorData.h" #include "DDRec/Surface.h" - ////////////////////////////////////////////////// // Far backwards vacuum drift volume // Low Q2 tagger trackers placed either in or out of vacuum @@ -18,36 +17,35 @@ using namespace dd4hep; using namespace dd4hep::rec; // Helper function to make the tagger tracker detectors -static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetElement modElement, SensitiveDetector& sens); - +static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetElement modElement, + SensitiveDetector& sens); -static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { - xml_det_t x_det = e; - string detName = x_det.nameStr(); - int detID = x_det.id(); + xml_det_t x_det = e; + string detName = x_det.nameStr(); + int detID = x_det.id(); DetElement det(detName, detID); string vis_name = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "BackwardsBox"); // Dimensions of main beamline pipe - xml::Component dim = x_det.child(_Unicode(dimensions)); - double WidthL = dim.attr<double>(_Unicode(xL)); - double WidthR = dim.attr<double>(_Unicode(xR)); + xml::Component dim = x_det.child(_Unicode(dimensions)); + double WidthL = dim.attr<double>(_Unicode(xL)); + double WidthR = dim.attr<double>(_Unicode(xR)); double Width = (WidthL + WidthR) / 2; double Height = dim.y(); double Thickness = dim.z(); // Materials - Material Vacuum = desc.material("Vacuum"); - Material Steel = desc.material("StainlessSteel"); + Material Vacuum = desc.material("Vacuum"); + Material Steel = desc.material("StainlessSteel"); // Central focal point of the geometry xml::Component pos = x_det.child(_Unicode(focus)); - double off = pos.z(); + double off = pos.z(); // Beamline rotation xml_dim_t rot = x_det.rotation(); @@ -56,13 +54,13 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) double wall = dd4hep::getAttrOrDefault<double>(x_det, _Unicode(wall), 1 * mm); // Make bounding box to make IntersectionSolid with other components - xml::Component BB = x_det.child(_Unicode(bounding)); - double BB_MinX = BB.xmin(); - double BB_MinY = BB.ymin(); - double BB_MinZ = BB.zmin(); - double BB_MaxX = BB.xmax(); - double BB_MaxY = BB.ymax(); - double BB_MaxZ = BB.zmax(); + xml::Component BB = x_det.child(_Unicode(bounding)); + double BB_MinX = BB.xmin(); + double BB_MinY = BB.ymin(); + double BB_MinZ = BB.zmin(); + double BB_MaxX = BB.xmax(); + double BB_MaxY = BB.ymax(); + double BB_MaxZ = BB.zmax(); double BB_X = abs(BB_MaxX - BB_MinX); double BB_Y = abs(BB_MaxY - BB_MinY); @@ -71,11 +69,11 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) Box Far_Backwards_Box(BB_X, BB_Y, BB_Z); // Entry box geometry description joining magnet, taggers and lumi - xml::Component EB = x_det.child(_Unicode(exitdim)); - double ED_X = EB.x(); - double ED_Y = EB.y(); - double ED_Z = off - EB.attr<double>(_Unicode(lumiZ)); - double Lumi_R = EB.attr<double>(_Unicode(lumiR)); + xml::Component EB = x_det.child(_Unicode(exitdim)); + double ED_X = EB.x(); + double ED_Y = EB.y(); + double ED_Z = off - EB.attr<double>(_Unicode(lumiZ)); + double Lumi_R = EB.attr<double>(_Unicode(lumiR)); // Maximum theta to exit the dipole from double exitTheta = EB.attr<double>(_Unicode(maxTheta)); @@ -100,26 +98,28 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) Assembly DetAssembly("Tagger_vacuum_assembly"); Assembly DetAssemblyAir("Tagger_air_assembly"); - int nVacuum = 0; - int nAir = 0; + int nVacuum = 0; + int nAir = 0; //----------------------------------------------------------------- // Add Tagger box containers and vacuum box extension for modules //----------------------------------------------------------------- for (xml_coll_t mod(x_det, _Unicode(module)); mod; ++mod) { - int moduleID = dd4hep::getAttrOrDefault<int>(mod, _Unicode(id), 0); + int moduleID = dd4hep::getAttrOrDefault<int>(mod, _Unicode(id), 0); string moduleName = dd4hep::getAttrOrDefault<std::string>(mod, _Unicode(name), "Tagger0"); // Offset from the electron beam - double tagoff = dd4hep::getAttrOrDefault<double>(mod, _Unicode(offset_min), 50.0 * mm); + double tagoff = dd4hep::getAttrOrDefault<double>(mod, _Unicode(offset_min), 50.0 * mm); // Overlap left beyond theta setting double overlap = dd4hep::getAttrOrDefault<double>(mod, _Unicode(overlap), 0.0 * mm); // Theta coverage expected - double thetamin = dd4hep::getAttrOrDefault<double>(mod, _Unicode(theta_min), 0.030 * rad) - rot.theta(); - double thetamax = dd4hep::getAttrOrDefault<double>(mod, _Unicode(theta_max), 0.030 * rad) - rot.theta(); + double thetamin = + dd4hep::getAttrOrDefault<double>(mod, _Unicode(theta_min), 0.030 * rad) - rot.theta(); + double thetamax = + dd4hep::getAttrOrDefault<double>(mod, _Unicode(theta_max), 0.030 * rad) - rot.theta(); // Align box to max or minimum theta expected at the tagger from focal point bool max_align = dd4hep::getAttrOrDefault<bool>(mod, _Unicode(max_align), false); @@ -128,10 +128,10 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) bool extend_vacuum = dd4hep::getAttrOrDefault<bool>(mod, _Unicode(extend_vacuum), true); // Size f the actual tagger box, replicated in BackwardsTagger - xml_dim_t moddim = mod.child(_Unicode(dimensions)); - double w = moddim.x(); - double h = moddim.y(); - double tagboxL = moddim.z(); + xml_dim_t moddim = mod.child(_Unicode(dimensions)); + double w = moddim.x(); + double h = moddim.y(); + double tagboxL = moddim.z(); // Width and height of vacuum volume auto vac_w = w; @@ -142,8 +142,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) auto box_h = h + wall; // Angle in relation to the main beam - auto theta = thetamin; - + auto theta = thetamin; auto offsetx = -(box_w - wall) * (cos(theta)); auto offsetz = (box_w - wall) * (sin(theta)); @@ -151,18 +150,18 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) auto vacoffsetz = vac_w * (sin(theta)); auto l = (tagoff) / (sin(theta)) + tagboxL; - auto tagoffsetx = vacoffsetx - (l) * sin(theta); - auto tagoffsetz = vacoffsetz - (l) * cos(theta); + auto tagoffsetx = vacoffsetx - (l)*sin(theta); + auto tagoffsetz = vacoffsetz - (l)*cos(theta); if (max_align) { theta = thetamax; - offsetx = (overlap+box_w - wall) * (cos(theta)); - offsetz = -(overlap+box_w - wall) * (sin(theta)); - vacoffsetx = (overlap+vac_w) * (cos(theta)); - vacoffsetz = -(overlap+vac_w) * (sin(theta)); + offsetx = (overlap + box_w - wall) * (cos(theta)); + offsetz = -(overlap + box_w - wall) * (sin(theta)); + vacoffsetx = (overlap + vac_w) * (cos(theta)); + vacoffsetz = -(overlap + vac_w) * (sin(theta)); l = (2 * offsetx + tagoff) / sin(theta); - tagoffsetx = vacoffsetx - (l) * sin(theta); - tagoffsetz = vacoffsetz - (l) * cos(theta); + tagoffsetx = vacoffsetx - (l)*sin(theta); + tagoffsetz = vacoffsetz - (l)*cos(theta); } Box TagWallBox(box_w, box_h, l + wall); @@ -173,8 +172,10 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) Volume mother = DetAssemblyAir; if (extend_vacuum) { - Wall_Box = UnionSolid(Wall_Box, TagWallBox, Transform3D(rotate, Position(offsetx, 0, offsetz))); - Vacuum_Box = UnionSolid(Vacuum_Box, TagVacBox, Transform3D(rotate, Position(vacoffsetx, 0, vacoffsetz))); + Wall_Box = + UnionSolid(Wall_Box, TagWallBox, Transform3D(rotate, Position(offsetx, 0, offsetz))); + Vacuum_Box = UnionSolid(Vacuum_Box, TagVacBox, + Transform3D(rotate, Position(vacoffsetx, 0, vacoffsetz))); mother = DetAssembly; nVacuum++; } else { @@ -185,14 +186,16 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) PlacedVolume pv_mod2 = mother.placeVolume( TaggerAssembly, - Transform3D(rotate, Position(tagoffsetx, 0, - tagoffsetz))); // Very strange y is not centered and offset needs correcting for... - DetElement moddet(det,moduleName, moduleID); + Transform3D( + rotate, + Position( + tagoffsetx, 0, + tagoffsetz))); // Very strange y is not centered and offset needs correcting for... + DetElement moddet(det, moduleName, moduleID); pv_mod2.addPhysVolID("module", moduleID); moddet.setPlacement(pv_mod2); Make_Tagger(desc, mod, TaggerAssembly, moddet, sens); - } //----------------------------------------------------------------- @@ -230,23 +233,27 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) //----------------------------------------------------------------- double exitDist = BB_MinZ - off; double cutX = (ED_X - exitDist * tan(-rot.theta())) * cos(rot.theta()); - double cutZ = (ED_X - exitDist * tan(-rot.theta())) * sin(rot.theta()) + exitDist * cos(rot.theta()); + double cutZ = + (ED_X - exitDist * tan(-rot.theta())) * sin(rot.theta()) + exitDist * cos(rot.theta()); double cutXwall = (ED_X - wall - exitDist * tan(-rot.theta())) * cos(rot.theta()); - double cutZwall = (ED_X - wall - exitDist * tan(-rot.theta())) * sin(rot.theta()) + exitDist * cos(rot.theta()); + double cutZwall = + (ED_X - wall - exitDist * tan(-rot.theta())) * sin(rot.theta()) + exitDist * cos(rot.theta()); - Wall_Box = IntersectionSolid(Wall_Box, Cut_Box, Transform3D(RotationY(exitTheta), Position(xbox - cutX, 0, cutZ))); + Wall_Box = IntersectionSolid(Wall_Box, Cut_Box, + Transform3D(RotationY(exitTheta), Position(xbox - cutX, 0, cutZ))); Vacuum_Box = - IntersectionSolid(Vacuum_Box, Cut_Box, Transform3D(RotationY(exitTheta), Position(xbox - cutXwall, 0, cutZwall))); + IntersectionSolid(Vacuum_Box, Cut_Box, + Transform3D(RotationY(exitTheta), Position(xbox - cutXwall, 0, cutZwall))); //----------------------------------------------------------------- // Cut solids so they are only in the far backwards box //----------------------------------------------------------------- RotationY rotate2(-rot.theta()); - Position position(0, 0, (exitDist - BB_Z) / cos(rot.theta())); + Position position(0, 0, (exitDist - BB_Z) / cos(rot.theta())); IntersectionSolid Wall_Box_Sub(Wall_Box, Far_Backwards_Box, Transform3D(rotate2, position)); IntersectionSolid Vacuum_Box_Sub(Vacuum_Box, Far_Backwards_Box, Transform3D(rotate2, position)); - SubtractionSolid Wall_Box_Out(Wall_Box_Sub, Vacuum_Box_Sub); + SubtractionSolid Wall_Box_Out(Wall_Box_Sub, Vacuum_Box_Sub); Volume vacVol("TaggerStation_Vacuum", Vacuum_Box_Sub, Vacuum); vacVol.setVisAttributes(desc.visAttributes("BackwardsVac")); @@ -264,28 +271,27 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) backAssembly.placeVolume(DetAssemblyAir); // placement in mother volume - Transform3D tr(RotationY(rot.theta()), Position(pos.x(), pos.y(), pos.z())); + Transform3D tr(RotationY(rot.theta()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume detPV = desc.pickMotherVolume(det).placeVolume(backAssembly, tr); detPV.addPhysVolID("system", detID); det.setPlacement(detPV); - return det; } -static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetElement modElement, SensitiveDetector& sens) -{ +static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetElement modElement, + SensitiveDetector& sens) { sens.setType("tracker"); Material Air = desc.material("Air"); Material Silicon = desc.material("Silicon"); - xml_dim_t moddim = mod.child(_Unicode(dimensions)); - double tag_w = moddim.x(); - double tag_h = moddim.y(); - double tagboxL = moddim.z(); + xml_dim_t moddim = mod.child(_Unicode(dimensions)); + double tag_w = moddim.x(); + double tag_h = moddim.y(); + double tagboxL = moddim.z(); Volume Tagger_Air; @@ -295,12 +301,14 @@ static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetEleme // Add window layer and air-vacuum boxes for (xml_coll_t lay(mod, _Unicode(foilLayer)); lay; ++lay) { - string layerType = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(type), "foil"); - string layerVis = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(vis), "FFTrackerShieldingVis"); - double layerZ = dd4hep::getAttrOrDefault<double>(lay, _Unicode(z), 0 * mm); - double layerRot = dd4hep::getAttrOrDefault<double>(lay, _Unicode(angle), 45*deg); - double layerThickness = dd4hep::getAttrOrDefault<double>(lay, _Unicode(sensor_thickness), 100 * um); - string layerMaterial = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(material), "Copper"); + string layerType = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(type), "foil"); + string layerVis = + dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(vis), "FFTrackerShieldingVis"); + double layerZ = dd4hep::getAttrOrDefault<double>(lay, _Unicode(z), 0 * mm); + double layerRot = dd4hep::getAttrOrDefault<double>(lay, _Unicode(angle), 45 * deg); + double layerThickness = + dd4hep::getAttrOrDefault<double>(lay, _Unicode(sensor_thickness), 100 * um); + string layerMaterial = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(material), "Copper"); Material FoilMaterial = desc.material(layerMaterial); @@ -313,11 +321,12 @@ static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetEleme Tagger_Air = Volume("AirVolume", Box_Air, Air); Tagger_Air.setVisAttributes(desc.visAttributes("BackwardsAir")); - Box Foil_Box(tag_w/cos(layerRot)-0.5*layerThickness*tan(layerRot), tag_h, layerThickness / 2); + Box Foil_Box(tag_w / cos(layerRot) - 0.5 * layerThickness * tan(layerRot), tag_h, + layerThickness / 2); Volume layVol("FoilVolume", Foil_Box, FoilMaterial); layVol.setVisAttributes(desc.visAttributes(layerVis)); - env.placeVolume(layVol, Transform3D(rotate,Position(0, 0, tagboxL+tag_w*tan(layerRot)))); + env.placeVolume(layVol, Transform3D(rotate, Position(0, 0, tagboxL + tag_w * tan(layerRot)))); // Currently only one "foil" layer implemented break; @@ -326,12 +335,14 @@ static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetEleme // Add window layer and air-vacuum boxes for (xml_coll_t lay(mod, _Unicode(windowLayer)); lay; ++lay) { - string layerType = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(type), "window"); - string layerVis = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(vis), "FFTrackerShieldingVis"); - double layerZ = dd4hep::getAttrOrDefault<double>(lay, _Unicode(z), 0 * mm); - double layerRot = dd4hep::getAttrOrDefault<double>(lay, _Unicode(angle), 0); - double layerThickness = dd4hep::getAttrOrDefault<double>(lay, _Unicode(sensor_thickness), 1 * mm); - string layerMaterial = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(material), "Copper"); + string layerType = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(type), "window"); + string layerVis = + dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(vis), "FFTrackerShieldingVis"); + double layerZ = dd4hep::getAttrOrDefault<double>(lay, _Unicode(z), 0 * mm); + double layerRot = dd4hep::getAttrOrDefault<double>(lay, _Unicode(angle), 0); + double layerThickness = + dd4hep::getAttrOrDefault<double>(lay, _Unicode(sensor_thickness), 1 * mm); + string layerMaterial = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(material), "Copper"); Material WindowMaterial = desc.material(layerMaterial); @@ -344,7 +355,7 @@ static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetEleme Tagger_Air = Volume("AirVolume", Box_Air, Air); Tagger_Air.setVisAttributes(desc.visAttributes("BackwardsAir")); - Box Window_Box(tag_w, tag_h, layerThickness / 2); + Box Window_Box(tag_w, tag_h, layerThickness / 2); Volume layVol("WindowVolume", Window_Box, WindowMaterial); layVol.setVisAttributes(desc.visAttributes(layerVis)); @@ -360,12 +371,14 @@ static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetEleme int N_layers = 0; for (xml_coll_t lay(mod, _Unicode(trackLayer)); lay; ++lay, ++N_layers) { - int layerID = dd4hep::getAttrOrDefault<int>(lay, _Unicode(id), 0); - string layerType = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(type), "timepix"); - string layerVis = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(vis), "FFTrackerLayerVis"); - double layerRot = dd4hep::getAttrOrDefault<double>(lay, _Unicode(angle), 0); - double layerZ = dd4hep::getAttrOrDefault<double>(lay, _Unicode(z), 0 * mm); - double layerThickness = dd4hep::getAttrOrDefault<double>(lay, _Unicode(sensor_thickness), 200 * um); + int layerID = dd4hep::getAttrOrDefault<int>(lay, _Unicode(id), 0); + string layerType = dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(type), "timepix"); + string layerVis = + dd4hep::getAttrOrDefault<std::string>(lay, _Unicode(vis), "FFTrackerLayerVis"); + double layerRot = dd4hep::getAttrOrDefault<double>(lay, _Unicode(angle), 0); + double layerZ = dd4hep::getAttrOrDefault<double>(lay, _Unicode(z), 0 * mm); + double layerThickness = + dd4hep::getAttrOrDefault<double>(lay, _Unicode(sensor_thickness), 200 * um); Volume mother = env; double MotherThickness = tagboxL; @@ -378,19 +391,17 @@ static void Make_Tagger(Detector& desc, xml_coll_t& mod, Assembly& env, DetEleme MotherThickness = airThickness / 2; } - Box Layer_Box(tag_w, tag_h, layerThickness / 2); + Box Layer_Box(tag_w, tag_h, layerThickness / 2); Volume layVol("Tagger_tracker_layer", Layer_Box, Silicon); layVol.setSensitiveDetector(sens); layVol.setVisAttributes(desc.visAttributes(layerVis)); - - PlacedVolume pv_layer = mother.placeVolume(layVol, Transform3D(rotate, Position(0, 0, MotherThickness - layerZ + layerThickness / 2))); + PlacedVolume pv_layer = mother.placeVolume( + layVol, Transform3D(rotate, Position(0, 0, MotherThickness - layerZ + layerThickness / 2))); pv_layer.addPhysVolID("layer", layerID); - DetElement laydet(modElement,"layerName"+std::to_string(layerID), layerID); + DetElement laydet(modElement, "layerName" + std::to_string(layerID), layerID); laydet.setPlacement(pv_layer); - - } } diff --git a/src/BarrelBarDetectorWithSideFrame_geo.cpp b/src/BarrelBarDetectorWithSideFrame_geo.cpp index aaf60b42a..61c3c634e 100644 --- a/src/BarrelBarDetectorWithSideFrame_geo.cpp +++ b/src/BarrelBarDetectorWithSideFrame_geo.cpp @@ -32,24 +32,24 @@ using namespace dd4hep; * for e.g. the DIRC * */ -static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h e, SensitiveDetector sens) -{ - typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; - Material air = description.air(); - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - DetElement sdet(det_name, det_id); - map<string, Volume> volumes; - map<string, Placements> sensitives; +static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h e, + SensitiveDetector sens) { + typedef vector<PlacedVolume> Placements; + xml_det_t x_det = e; + Material air = description.air(); + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + DetElement sdet(det_name, det_id); + map<string, Volume> volumes; + map<string, Placements> sensitives; map<string, std::vector<rec::VolPlane>> volplane_surfaces; - PlacedVolume pv; - dd4hep::xml::Dimension dimensions(x_det.dimensions()); - xml_dim_t dirc_pos = x_det.position(); + PlacedVolume pv; + dd4hep::xml::Dimension dimensions(x_det.dimensions()); + xml_dim_t dirc_pos = x_det.position(); map<string, std::array<double, 2>> module_thicknesses; - Tube topVolumeShape(dimensions.rmin(), dimensions.rmax(), dimensions.length() * 0.5); + Tube topVolumeShape(dimensions.rmin(), dimensions.rmax(), dimensions.length() * 0.5); Volume assembly(det_name, topVolumeShape, air); sens.setType("tracker"); @@ -57,7 +57,7 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h // loop over the modules for (xml_coll_t mi(x_det, _U(module)); mi; ++mi) { xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); + string m_nam = x_mod.nameStr(); if (volumes.find(m_nam) != volumes.end()) { printout(ERROR, "BarrelBarDetectorWithSideFrame", @@ -65,7 +65,7 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h throw runtime_error("Logics error in building modules."); } - int ncomponents = 0; + int ncomponents = 0; double total_thickness = 0; // Compute module total thickness from components @@ -98,12 +98,12 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h double max_component_width = 0; for (xml_coll_t mci(x_mod, _U(module_component)); mci; ++mci, ++ncomponents) { xml_comp_t x_comp = mci; - string c_nam = _toString(ncomponents, "component%d"); + string c_nam = _toString(ncomponents, "component%d"); double box_width = x_comp.width() - 2 * frame_width; max_component_width = fmax(max_component_width, box_width); - Box c_box{box_width / 2, x_comp.length() / 2, x_comp.thickness() / 2}; + Box c_box{box_width / 2, x_comp.length() / 2, x_comp.thickness() / 2}; Volume c_vol{c_nam, c_box, description.material(x_comp.materialStr())}; pv = m_vol.placeVolume(c_vol, Position(0, 0, thickness_sum + x_comp.thickness() / 2.0)); @@ -136,8 +136,8 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h } // Now add-on the frame if (x_mod.hasChild(_U(frame))) { - xml_comp_t m_frame = x_mod.child(_U(frame)); - double frame_thickness = getAttrOrDefault<double>(m_frame, _U(thickness), total_thickness); + xml_comp_t m_frame = x_mod.child(_U(frame)); + double frame_thickness = getAttrOrDefault<double>(m_frame, _U(thickness), total_thickness); Box lframe_box{m_frame.width() / 2., m_frame.length() / 2., frame_thickness / 2.}; Box rframe_box{m_frame.width() / 2., m_frame.length() / 2., frame_thickness / 2.}; @@ -162,17 +162,17 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h xml_comp_t x_barrel = x_layer.child(_U(barrel_envelope)); xml_comp_t x_layout = x_layer.child(_U(rphi_layout)); xml_comp_t z_layout = x_layer.child(_U(z_layout)); // Get the <z_layout> element. - int lay_id = x_layer.id(); - string m_nam = x_layer.moduleStr(); - string lay_nam = _toString(x_layer.id(), "layer%d"); - Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2.0); - Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. + int lay_id = x_layer.id(); + string m_nam = x_layer.moduleStr(); + string lay_nam = _toString(x_layer.id(), "layer%d"); + Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2.0); + Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. lay_vol.setVisAttributes(description, x_layer.visStr()); double phi0 = x_layout.phi0(); // Starting phi of first module. double phi_tilt = x_layout.phi_tilt(); // Phi tilt of a module. double rc = x_layout.rc(); // Radius of the module center. - int nphi = x_layout.nphi(); // Number of modules in phi. + int nphi = x_layout.nphi(); // Number of modules in phi. double rphi_dr = x_layout.dr(); // The delta radius of every other module. double phi_incr = (M_PI * 2) / nphi; // Phi increment for one module. double phic = phi0; // Phi of the module center. @@ -180,8 +180,8 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h double nz = z_layout.nz(); // Number of modules to place in z. double z_dr = z_layout.dr(); // Radial displacement parameter, of every other module. - Volume module_env = volumes[m_nam]; - DetElement lay_elt(sdet, _toString(x_layer.id(), "layer%d"), lay_id); + Volume module_env = volumes[m_nam]; + DetElement lay_elt(sdet, _toString(x_layer.id(), "layer%d"), lay_id); Placements& sensVols = sensitives[m_nam]; // Z increment for module placement along Z axis. @@ -190,7 +190,7 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h double z_incr = nz > 1 ? (2.0 * z0) / (nz - 1) : 0.0; // Starting z for module placement along Z axis. double module_z = -z0; - int module = 1; + int module = 1; // Loop over the number of modules in phi. for (int ii = 0; ii < nphi; ii++) { @@ -201,10 +201,11 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h // Loop over the number of modules in z. for (int j = 0; j < nz; j++) { - string module_name = _toString(module, "module%d"); + string module_name = _toString(module, "module%d"); DetElement mod_elt(lay_elt, module_name, module); - Transform3D tr(RotationZYX(0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), Position(x, y, module_z)); + Transform3D tr(RotationZYX(0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), + Position(x, y, module_z)); pv = lay_vol.placeVolume(module_env, tr); pv.addPhysVolID("module", module); @@ -212,7 +213,7 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h mod_elt.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_de(mod_elt, std::string("de_") + sens_pv.volume().name(), module); + DetElement comp_de(mod_elt, std::string("de_") + sens_pv.volume().name(), module); comp_de.setPlacement(sens_pv); rec::volSurfaceList(comp_de)->push_back(volplane_surfaces[m_nam][ic]); } @@ -236,7 +237,8 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h // Create the PhysicalVolume for the layer. pv = assembly.placeVolume(lay_vol); // Place layer in mother pv.addPhysVolID("layer", lay_id); // Set the layer ID. - lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr()); + lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), + x_layer.visStr()); lay_elt.setPlacement(pv); } sdet.setAttributes(description, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr()); diff --git a/src/BarrelCalorimeterImaging_geo.cpp b/src/BarrelCalorimeterImaging_geo.cpp index 190c14eb5..93bb7c737 100644 --- a/src/BarrelCalorimeterImaging_geo.cpp +++ b/src/BarrelCalorimeterImaging_geo.cpp @@ -33,25 +33,25 @@ static void buildSupport(Detector& desc, Volume& mother, xml_comp_t x_support, const std::tuple<double, double, double, double>& dimensions); // barrel ecal layers contained in an assembly -static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_detector = e; - int detector_id = x_detector.id(); +static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { + xml_det_t x_detector = e; + int detector_id = x_detector.id(); std::string detector_name = x_detector.nameStr(); - double offset = x_detector.attr<double>(_Unicode(offset)); - xml_comp_t x_dimensions = x_detector.dimensions(); - int nsides = x_dimensions.numsides(); - double inner_r = x_dimensions.rmin(); - double dphi = (2 * M_PI / nsides); - double half_dphi = dphi / 2; + double offset = x_detector.attr<double>(_Unicode(offset)); + xml_comp_t x_dimensions = x_detector.dimensions(); + int nsides = x_dimensions.numsides(); + double inner_r = x_dimensions.rmin(); + double dphi = (2 * M_PI / nsides); + double half_dphi = dphi / 2; DetElement sdet(detector_name, detector_id); - Volume mother_volume = desc.pickMotherVolume(sdet); + Volume mother_volume = desc.pickMotherVolume(sdet); Assembly detector_volume(detector_name); - detector_volume.setAttributes(desc, x_detector.regionStr(), x_detector.limitsStr(), x_detector.visStr()); + detector_volume.setAttributes(desc, x_detector.regionStr(), x_detector.limitsStr(), + x_detector.visStr()); - Transform3D detector_tr = Translation3D(0, 0, offset) * RotationZ(half_dphi); + Transform3D detector_tr = Translation3D(0, 0, offset) * RotationZ(half_dphi); PlacedVolume detector_physvol = mother_volume.placeVolume(detector_volume, detector_tr); sens.setType("calorimeter"); @@ -60,7 +60,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // build a single sector DetElement sector_element("sector0", detector_id); - Assembly sector_volume("sector"); + Assembly sector_volume("sector"); if (x_detector.hasChild(_Unicode(sectors))) { xml_comp_t x_sectors = x_detector.child(_Unicode(sectors)); sector_volume.setVisAttributes(desc.visAttributes(x_sectors.visStr())); @@ -75,21 +75,22 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Loop over the modules using dd4hep::rec::VolPlane; - std::map<std::string, Volume> volumes; + std::map<std::string, Volume> volumes; std::map<std::string, std::vector<PlacedVolume>> sensitives; - std::map<std::string, std::vector<VolPlane>> volplane_surfaces; - std::map<std::string, std::array<double, 2>> module_thicknesses; + std::map<std::string, std::vector<VolPlane>> volplane_surfaces; + std::map<std::string, std::array<double, 2>> module_thicknesses; for (xml_coll_t i_module(x_detector, _U(module)); i_module; ++i_module) { - xml_comp_t x_module = i_module; + xml_comp_t x_module = i_module; std::string module_name = x_module.nameStr(); if (volumes.find(module_name) != volumes.end()) { - printout(ERROR, "BarrelCalorimeterImaging", "Module with name %s already exists", module_name.c_str()); + printout(ERROR, "BarrelCalorimeterImaging", "Module with name %s already exists", + module_name.c_str()); throw std::runtime_error("Logics error in building modules."); } // Compute module total thickness from components - double total_thickness = 0; + double total_thickness = 0; xml_coll_t ci(x_module, _U(module_component)); for (ci.reset(), total_thickness = 0.0; ci; ++ci) { total_thickness += xml_comp_t(ci).thickness(); @@ -101,35 +102,40 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) module_volume.setVisAttributes(desc.visAttributes(x_module.visStr())); // Add components - int sensor_number = 1; - int ncomponents = 0; + int sensor_number = 1; + int ncomponents = 0; double thickness_so_far = 0.0; double thickness_sum = -total_thickness / 2.0; - for (xml_coll_t i_component(x_module, _U(module_component)); i_component; ++i_component, ++ncomponents) { - xml_comp_t x_component = i_component; - xml_comp_t x_component_pos = x_component.position(false); - xml_comp_t x_component_rot = x_component.rotation(false); - const std::string component_name = _toString(ncomponents, "component%d"); - Box component_box(x_component.width() / 2, x_component.length() / 2, x_component.thickness() / 2); - Volume component_volume(component_name, component_box, desc.material(x_component.materialStr())); - component_volume.setAttributes(desc, x_component.regionStr(), x_component.limitsStr(), x_component.visStr()); + for (xml_coll_t i_component(x_module, _U(module_component)); i_component; + ++i_component, ++ncomponents) { + xml_comp_t x_component = i_component; + xml_comp_t x_component_pos = x_component.position(false); + xml_comp_t x_component_rot = x_component.rotation(false); + const std::string component_name = _toString(ncomponents, "component%d"); + Box component_box(x_component.width() / 2, x_component.length() / 2, + x_component.thickness() / 2); + Volume component_volume(component_name, component_box, + desc.material(x_component.materialStr())); + component_volume.setAttributes(desc, x_component.regionStr(), x_component.limitsStr(), + x_component.visStr()); // Loop over the slices for this component - int slice_num = 1; + int slice_num = 1; double slice_pos_z = -x_component.thickness() / 2; for (xml_coll_t i_slice(x_component, _U(slice)); i_slice; ++i_slice) { - xml_comp_t x_slice = i_slice; - std::string slice_name = Form("slice%d", slice_num); - double slice_dim_x = x_component.width() / 2; - double slice_dim_y = x_component.length() / 2; - double slice_dim_z = x_slice.thickness() / 2; - Box slice_shape(slice_dim_x, slice_dim_y, slice_dim_z); - Volume slice_volume(slice_name, slice_shape, desc.material(x_slice.materialStr())); - slice_volume.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); + xml_comp_t x_slice = i_slice; + std::string slice_name = Form("slice%d", slice_num); + double slice_dim_x = x_component.width() / 2; + double slice_dim_y = x_component.length() / 2; + double slice_dim_z = x_slice.thickness() / 2; + Box slice_shape(slice_dim_x, slice_dim_y, slice_dim_z); + Volume slice_volume(slice_name, slice_shape, desc.material(x_slice.materialStr())); + slice_volume.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), + x_slice.visStr()); // Place slice - PlacedVolume slice_physvol = - component_volume.placeVolume(slice_volume, Position(0, 0, slice_pos_z + x_slice.thickness() / 2)); + PlacedVolume slice_physvol = component_volume.placeVolume( + slice_volume, Position(0, 0, slice_pos_z + x_slice.thickness() / 2)); // Set sensitive if (x_slice.isSensitive()) { @@ -147,15 +153,19 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) const double zoff = thickness_sum + x_component.thickness() / 2.0; PlacedVolume component_physvol; if (x_component_pos && x_component_rot) { - Position component_pos(x_component_pos.x(0), x_component_pos.y(0), x_component_pos.z(0) + zoff); + Position component_pos(x_component_pos.x(0), x_component_pos.y(0), + x_component_pos.z(0) + zoff); RotationZYX component_rot(x_component_rot.z(0), x_component_rot.y(0), x_component_rot.x(0)); - component_physvol = module_volume.placeVolume(component_volume, Transform3D(component_rot, component_pos)); + component_physvol = + module_volume.placeVolume(component_volume, Transform3D(component_rot, component_pos)); } else if (x_component_rot) { - Position component_pos(0, 0, zoff); + Position component_pos(0, 0, zoff); RotationZYX component_rot(x_component_rot.z(0), x_component_rot.y(0), x_component_rot.x(0)); - component_physvol = module_volume.placeVolume(component_volume, Transform3D(component_rot, component_pos)); + component_physvol = + module_volume.placeVolume(component_volume, Transform3D(component_rot, component_pos)); } else if (x_component_pos) { - Position component_pos(x_component_pos.x(0), x_component_pos.y(0), x_component_pos.z(0) + zoff); + Position component_pos(x_component_pos.x(0), x_component_pos.y(0), + x_component_pos.z(0) + zoff); component_physvol = module_volume.placeVolume(component_volume, component_pos); } else { Position component_pos(0, 0, zoff); @@ -167,7 +177,8 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) component_volume.setSensitiveDetector(sens); sensitives[module_name].push_back(component_physvol); module_thicknesses[module_name] = {thickness_so_far + x_component.thickness() / 2.0, - total_thickness - thickness_so_far - x_component.thickness() / 2.0}; + total_thickness - thickness_so_far - + x_component.thickness() / 2.0}; } thickness_sum += x_component.thickness(); @@ -181,35 +192,36 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) } } if (x_detector.hasChild(_Unicode(support))) { - buildSupport(desc, sector_volume, x_detector.child(_Unicode(support)), {inner_r, layer_pos_z, x_dimensions.z(), half_dphi}); + buildSupport(desc, sector_volume, x_detector.child(_Unicode(support)), + {inner_r, layer_pos_z, x_dimensions.z(), half_dphi}); } //Loop over the sets of layer elements in the detector. int layer_num = 1; for (xml_coll_t i_layer(x_detector, _U(layer)); i_layer; ++i_layer) { - xml_comp_t x_layer = i_layer; - int layer_repeat = x_layer.repeat(); - double layer_thickness = x_layer.thickness(); - bool layer_has_frame = x_layer.hasChild(_Unicode(frame)); - double layer_space_between = getAttrOrDefault(x_layer, _Unicode(space_between), 0.); - double layer_space_before = getAttrOrDefault(x_layer, _Unicode(space_before), 0.); + xml_comp_t x_layer = i_layer; + int layer_repeat = x_layer.repeat(); + double layer_thickness = x_layer.thickness(); + bool layer_has_frame = x_layer.hasChild(_Unicode(frame)); + double layer_space_between = getAttrOrDefault(x_layer, _Unicode(space_between), 0.); + double layer_space_before = getAttrOrDefault(x_layer, _Unicode(space_before), 0.); layer_pos_z += layer_space_before; // Loop over number of repeats for this layer. for (int layer_j = 0; layer_j < layer_repeat; layer_j++) { // Make an envelope for this layer - std::string layer_name = Form("layer%d", layer_num); - double layer_dim_x = tan_half_dphi * layer_pos_z; - auto layer_mat = desc.air(); - - Position layer_pos(0, 0, layer_pos_z + layer_thickness / 2.); - double layer_trd_x1 = layer_dim_x; - double layer_trd_x2 = layer_dim_x + layer_thickness * tan_half_dphi; - double layer_trd_y1 = layer_dim_y; - double layer_trd_y2 = layer_trd_y1; - double layer_trd_z = layer_thickness / 2; // account for frame - Trapezoid layer_shape(layer_trd_x1, layer_trd_x2, layer_trd_y1, layer_trd_y2, layer_trd_z); - Volume layer_volume(layer_name, layer_shape, layer_mat); + std::string layer_name = Form("layer%d", layer_num); + double layer_dim_x = tan_half_dphi * layer_pos_z; + auto layer_mat = desc.air(); + + Position layer_pos(0, 0, layer_pos_z + layer_thickness / 2.); + double layer_trd_x1 = layer_dim_x; + double layer_trd_x2 = layer_dim_x + layer_thickness * tan_half_dphi; + double layer_trd_y1 = layer_dim_y; + double layer_trd_y2 = layer_trd_y1; + double layer_trd_z = layer_thickness / 2; // account for frame + Trapezoid layer_shape(layer_trd_x1, layer_trd_x2, layer_trd_y1, layer_trd_y2, layer_trd_z); + Volume layer_volume(layer_name, layer_shape, layer_mat); DetElement layer_element(sector_element, layer_name, detector_id); // Set region, limitset, and vis of layer. @@ -218,25 +230,26 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Loop over the staves for this layer. int stave_num = 1; for (xml_coll_t i_stave(x_layer, _U(stave)); i_stave; ++i_stave) { - xml_comp_t x_stave = i_stave; - int stave_repeat = x_stave.repeat(); - double stave_thick = x_stave.thickness(); - double stave_dim_x = x_stave.width() / 2.0; - double stave_dim_y = x_stave.length() / 2.0; - double stave_dim_z = stave_thick / 2.0; - double stave_rot_y = getAttrOrDefault(x_stave, _Unicode(angle), 0.); - double stave_off_z = getAttrOrDefault(x_stave, _Unicode(offset), 0.); + xml_comp_t x_stave = i_stave; + int stave_repeat = x_stave.repeat(); + double stave_thick = x_stave.thickness(); + double stave_dim_x = x_stave.width() / 2.0; + double stave_dim_y = x_stave.length() / 2.0; + double stave_dim_z = stave_thick / 2.0; + double stave_rot_y = getAttrOrDefault(x_stave, _Unicode(angle), 0.); + double stave_off_z = getAttrOrDefault(x_stave, _Unicode(offset), 0.); // Arrange staves symmetrically around center of layer double stave_pos_x = -layer_dim_x + stave_dim_x; double stave_pitch = -2.0 * stave_pos_x / (stave_repeat - 1); // Make one stave - std::string stave_name = Form("stave%d", stave_num); - auto stave_material = desc.air(); - Box stave_shape(stave_dim_x, stave_dim_y, stave_dim_z); - Volume stave_volume(stave_name, stave_shape, stave_material); - stave_volume.setAttributes(desc, x_stave.regionStr(), x_stave.limitsStr(), x_stave.visStr()); + std::string stave_name = Form("stave%d", stave_num); + auto stave_material = desc.air(); + Box stave_shape(stave_dim_x, stave_dim_y, stave_dim_z); + Volume stave_volume(stave_name, stave_shape, stave_material); + stave_volume.setAttributes(desc, x_stave.regionStr(), x_stave.limitsStr(), + x_stave.visStr()); DetElement stave_element(layer_element, stave_name, detector_id); // Loop over the slices for this stave @@ -244,26 +257,26 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Place in xy_layout if (x_stave.hasChild(_Unicode(xy_layout))) { - auto module_str = x_stave.moduleStr(); + auto module_str = x_stave.moduleStr(); auto& module_volume = volumes[module_str]; auto& module_sensitives = sensitives[module_str]; // Get layout grid pitch xml_comp_t x_xy_layout = x_stave.child(_Unicode(xy_layout)); - auto dx = x_xy_layout.attr<double>(_Unicode(dx)); - auto dy = x_xy_layout.attr<double>(_Unicode(dy)); + auto dx = x_xy_layout.attr<double>(_Unicode(dx)); + auto dy = x_xy_layout.attr<double>(_Unicode(dy)); // Default to filling auto nx = getAttrOrDefault<int>(x_xy_layout, _Unicode(nx), floor(2. * stave_dim_x / dx)); auto ny = getAttrOrDefault<int>(x_xy_layout, _Unicode(ny), floor(2. * stave_dim_y / dy)); - printout(DEBUG, "BarrelCalorimeterImaging", "Stave %s layout with %d by %d modules", stave_name.c_str(), nx, - ny); + printout(DEBUG, "BarrelCalorimeterImaging", "Stave %s layout with %d by %d modules", + stave_name.c_str(), nx, ny); // Default to centered auto x0 = getAttrOrDefault<double>(x_xy_layout, _Unicode(x0), -(nx - 1) * dx / 2.); auto y0 = getAttrOrDefault<double>(x_xy_layout, _Unicode(x0), -(ny - 1) * dy / 2.); - printout(DEBUG, "BarrelCalorimeterImaging", "Stave %s modules starting at x=%f, y=%f", stave_name.c_str(), x0, - y0); + printout(DEBUG, "BarrelCalorimeterImaging", "Stave %s modules starting at x=%f, y=%f", + stave_name.c_str(), x0, y0); // Place modules int i_module = 0; @@ -272,23 +285,25 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Create module std::string module_name = _toString(i_module, "module%d"); - DetElement module_element(stave_element, module_name, i_module); + DetElement module_element(stave_element, module_name, i_module); // Place module - auto x = x0 + i_x * dx; - auto y = y0 + i_y * dy; - Position module_pos(x, y, 0); + auto x = x0 + i_x * dx; + auto y = y0 + i_y * dy; + Position module_pos(x, y, 0); PlacedVolume module_physvol = stave_volume.placeVolume(module_volume, module_pos); module_physvol.addPhysVolID("module", i_module); module_element.setPlacement(module_physvol); // Add sensitive volumes for (auto& sensitive_physvol : module_sensitives) { - DetElement sensitive_element(module_element, sensitive_physvol.volume().name(), i_module); + DetElement sensitive_element(module_element, sensitive_physvol.volume().name(), + i_module); sensitive_element.setPlacement(sensitive_physvol); auto& sensitive_element_params = - DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(sensitive_element); + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( + sensitive_element); sensitive_element_params.set<std::string>("axis_definitions", "XYZ"); } @@ -301,15 +316,16 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Loop over the slices for this stave int slice_num = 1; for (xml_coll_t i_slice(x_stave, _U(slice)); i_slice; ++i_slice) { - xml_comp_t x_slice = i_slice; - std::string slice_name = Form("slice%d", slice_num); - double slice_thick = x_slice.thickness(); - double slice_dim_x = stave_dim_x; - double slice_dim_y = stave_dim_y; - double slice_dim_z = slice_thick / 2.; - Box slice_shape(slice_dim_x, slice_dim_y, slice_dim_z); - Volume slice_volume(slice_name, slice_shape, desc.material(x_slice.materialStr())); - slice_volume.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); + xml_comp_t x_slice = i_slice; + std::string slice_name = Form("slice%d", slice_num); + double slice_thick = x_slice.thickness(); + double slice_dim_x = stave_dim_x; + double slice_dim_y = stave_dim_y; + double slice_dim_z = slice_thick / 2.; + Box slice_shape(slice_dim_x, slice_dim_y, slice_dim_z); + Volume slice_volume(slice_name, slice_shape, desc.material(x_slice.materialStr())); + slice_volume.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), + x_slice.visStr()); DetElement slice_element(stave_element, slice_name, detector_id); // Set sensitive @@ -332,9 +348,9 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) for (int stave_j = 0; stave_j < stave_repeat; stave_j++) { // Stave placement - Position stave_pos(stave_pos_x, 0, layer_j % 2 == 0 ? +stave_off_z : -stave_off_z); - RotationY stave_rot(layer_j % 2 == 0 ? +stave_rot_y : -stave_rot_y); - Transform3D stave_tr(stave_rot, stave_pos); + Position stave_pos(stave_pos_x, 0, layer_j % 2 == 0 ? +stave_off_z : -stave_off_z); + RotationY stave_rot(layer_j % 2 == 0 ? +stave_rot_y : -stave_rot_y); + Transform3D stave_tr(stave_rot, stave_pos); PlacedVolume stave_physvol = layer_volume.placeVolume(stave_volume, stave_tr); stave_physvol.addPhysVolID("stave", stave_num); stave_element.setPlacement(stave_physvol); @@ -347,32 +363,40 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Place frame if (layer_has_frame) { - xml_comp_t x_frame = x_layer.child(_Unicode(frame)); - double frame_height = x_frame.height(); - double frame_thickness = x_frame.thickness(); - auto frame_material = desc.material(x_frame.materialStr()); - - std::string frame1_name = Form("frame_inner%d", layer_num); - double frame1_thick = frame_thickness; - double frame1_trd_x1 = layer_dim_x + (layer_thickness / 2 - frame_height / 2) * tan_half_dphi; - double frame1_trd_x2 = layer_dim_x + (layer_thickness / 2 - frame_height / 2 + frame1_thick) * tan_half_dphi; - double frame1_trd_y1 = layer_trd_y1; - double frame1_trd_y2 = frame1_trd_y1; - double frame1_trd_z = frame1_thick / 2.; - Trapezoid frame1_shape(frame1_trd_x1, frame1_trd_x2, frame1_trd_y1, frame1_trd_y2, frame1_trd_z); - Volume frame1_volume(frame1_name, frame1_shape, frame_material); - layer_volume.placeVolume(frame1_volume, Position(0, 0, -frame_height / 2.0 + frame_thickness / 2.0)); - - std::string frame2_name = Form("frame_outer%d", layer_num); - double frame2_thick = frame_thickness; - double frame2_trd_x1 = layer_dim_x + (layer_thickness / 2 - frame_height / 2) * tan_half_dphi; - double frame2_trd_x2 = layer_dim_x + (layer_thickness / 2 - frame_height / 2 + frame2_thick) * tan_half_dphi; - double frame2_trd_y1 = layer_trd_y1; - double frame2_trd_y2 = frame2_trd_y1; - double frame2_trd_z = frame2_thick / 2.; - Trapezoid frame2_shape(frame2_trd_x1, frame2_trd_x2, frame2_trd_y1, frame2_trd_y2, frame2_trd_z); - Volume frame2_volume(frame2_name, frame2_shape, frame_material); - layer_volume.placeVolume(frame2_volume, Position(0, 0, +frame_height / 2.0 - frame_thickness / 2.0)); + xml_comp_t x_frame = x_layer.child(_Unicode(frame)); + double frame_height = x_frame.height(); + double frame_thickness = x_frame.thickness(); + auto frame_material = desc.material(x_frame.materialStr()); + + std::string frame1_name = Form("frame_inner%d", layer_num); + double frame1_thick = frame_thickness; + double frame1_trd_x1 = + layer_dim_x + (layer_thickness / 2 - frame_height / 2) * tan_half_dphi; + double frame1_trd_x2 = + layer_dim_x + (layer_thickness / 2 - frame_height / 2 + frame1_thick) * tan_half_dphi; + double frame1_trd_y1 = layer_trd_y1; + double frame1_trd_y2 = frame1_trd_y1; + double frame1_trd_z = frame1_thick / 2.; + Trapezoid frame1_shape(frame1_trd_x1, frame1_trd_x2, frame1_trd_y1, frame1_trd_y2, + frame1_trd_z); + Volume frame1_volume(frame1_name, frame1_shape, frame_material); + layer_volume.placeVolume(frame1_volume, + Position(0, 0, -frame_height / 2.0 + frame_thickness / 2.0)); + + std::string frame2_name = Form("frame_outer%d", layer_num); + double frame2_thick = frame_thickness; + double frame2_trd_x1 = + layer_dim_x + (layer_thickness / 2 - frame_height / 2) * tan_half_dphi; + double frame2_trd_x2 = + layer_dim_x + (layer_thickness / 2 - frame_height / 2 + frame2_thick) * tan_half_dphi; + double frame2_trd_y1 = layer_trd_y1; + double frame2_trd_y2 = frame2_trd_y1; + double frame2_trd_z = frame2_thick / 2.; + Trapezoid frame2_shape(frame2_trd_x1, frame2_trd_x2, frame2_trd_y1, frame2_trd_y2, + frame2_trd_z); + Volume frame2_volume(frame2_name, frame2_shape, frame_material); + layer_volume.placeVolume(frame2_volume, + Position(0, 0, +frame_height / 2.0 - frame_thickness / 2.0)); } // Place layer into sector @@ -394,7 +418,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Create nsides sectors. for (int i = 0; i < nsides; i++, phi -= dphi) { // i is sector number // Compute the sector position - Transform3D tr(RotationZYX(0, phi, M_PI * 0.5), Translation3D(0, 0, 0)); + Transform3D tr(RotationZYX(0, phi, M_PI * 0.5), Translation3D(0, 0, 0)); PlacedVolume sector_physvol = detector_volume.placeVolume(sector_volume, tr); sector_physvol.addPhysVolID("sector", i + 1); DetElement sd = (i == 0) ? sector_element : sector_element.clone(Form("sector%d", i)); @@ -408,17 +432,16 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // simple aluminum sheet cover // dimensions: (inner r, position in z, length, phi) static void buildSupport(Detector& desc, Volume& sector_volume, xml_comp_t x_support, - const std::tuple<double, double, double, double>& dimensions) -{ + const std::tuple<double, double, double, double>& dimensions) { auto [inner_r, pos_z, sector_length, hphi] = dimensions; - double support_thickness = getAttrOrDefault(x_support, _Unicode(thickness), 0.5 * cm); - auto material = desc.material(x_support.materialStr()); - double trd_y = sector_length / 2.; - double trd_x1_support = std::tan(hphi) * pos_z; - double trd_x2_support = std::tan(hphi) * (pos_z + support_thickness); + double support_thickness = getAttrOrDefault(x_support, _Unicode(thickness), 0.5 * cm); + auto material = desc.material(x_support.materialStr()); + double trd_y = sector_length / 2.; + double trd_x1_support = std::tan(hphi) * pos_z; + double trd_x2_support = std::tan(hphi) * (pos_z + support_thickness); Trapezoid s_shape(trd_x1_support, trd_x2_support, trd_y, trd_y, support_thickness / 2.); - Volume s_vol("support_layer", s_shape, material); + Volume s_vol("support_layer", s_shape, material); s_vol.setVisAttributes(desc.visAttributes(x_support.visStr())); sector_volume.placeVolume(s_vol, Position(0.0, 0.0, pos_z + support_thickness / 2.)); } diff --git a/src/BarrelCalorimeterScFi_geo.cpp b/src/BarrelCalorimeterScFi_geo.cpp index 18de3be83..e0a2fa468 100644 --- a/src/BarrelCalorimeterScFi_geo.cpp +++ b/src/BarrelCalorimeterScFi_geo.cpp @@ -25,14 +25,13 @@ using namespace dd4hep; typedef ROOT::Math::XYPoint Point; // fiber placement helpers, defined below struct FiberGrid { - int ix = 0, iy = 0; + int ix = 0, iy = 0; std::vector<Point> points; - Point mean_centroid = Point(0., 0.); - Assembly* assembly_ptr = nullptr; + Point mean_centroid = Point(0., 0.); + Assembly* assembly_ptr = nullptr; // initialize with grid id and points - FiberGrid(int i, int j, const std::vector<Point>& pts) : ix(i), iy(j), points(pts) - { + FiberGrid(int i, int j, const std::vector<Point>& pts) : ix(i), iy(j), points(pts) { if (pts.empty()) { return; } @@ -48,37 +47,36 @@ struct FiberGrid { }; }; -std::vector<Point> fiberPositions(double r, double sx, double sz, double trx, double trz, double phi, - bool shift_first = false, double stol = 1e-2); +std::vector<Point> fiberPositions(double r, double sx, double sz, double trx, double trz, + double phi, bool shift_first = false, double stol = 1e-2); std::vector<FiberGrid> gridPoints(int div_n_phi, double div_dr, double x, double z, double phi); // geometry helpers -void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& mother, int layer_nunber, xml_comp_t x_fiber, - const std::tuple<double, double, double, double>& dimensions); +void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& mother, int layer_nunber, + xml_comp_t x_fiber, const std::tuple<double, double, double, double>& dimensions); void buildSupport(Detector& desc, Volume& mother, xml_comp_t x_support, const std::tuple<double, double, double, double>& dimensions); // barrel ecal layers contained in an assembly -static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) -{ - Layering layering(e); - xml_det_t x_det = e; - Material air = desc.air(); - int det_id = x_det.id(); - double offset = x_det.attr<double>(_Unicode(offset)); - xml_comp_t x_dim = x_det.dimensions(); - int nsides = x_dim.numsides(); - double inner_r = x_dim.rmin(); - double dphi = (2 * M_PI / nsides); - double hphi = dphi / 2; +static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { + Layering layering(e); + xml_det_t x_det = e; + Material air = desc.air(); + int det_id = x_det.id(); + double offset = x_det.attr<double>(_Unicode(offset)); + xml_comp_t x_dim = x_det.dimensions(); + int nsides = x_dim.numsides(); + double inner_r = x_dim.rmin(); + double dphi = (2 * M_PI / nsides); + double hphi = dphi / 2; std::string det_name = x_det.nameStr(); DetElement sdet(det_name, det_id); - Volume motherVol = desc.pickMotherVolume(sdet); + Volume motherVol = desc.pickMotherVolume(sdet); - Assembly envelope(det_name); - Transform3D tr_global = Translation3D(0, 0, offset) * RotationZ(hphi); - PlacedVolume env_phv = motherVol.placeVolume(envelope, tr_global); + Assembly envelope(det_name); + Transform3D tr_global = Translation3D(0, 0, offset) * RotationZ(hphi); + PlacedVolume env_phv = motherVol.placeVolume(envelope, tr_global); sens.setType("calorimeter"); env_phv.addPhysVolID("system", det_id); @@ -86,7 +84,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // build a single sector DetElement sector_det("sector0", det_id); - Assembly mod_vol("sector"); + Assembly mod_vol("sector"); // keep tracking of the total thickness double l_pos_z = inner_r; @@ -98,47 +96,48 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Loop over the sets of layer elements in the detector. int l_num = 1; for (xml_coll_t li(x_det, _U(layer)); li; ++li) { - xml_comp_t x_layer = li; - int repeat = x_layer.repeat(); - double l_space_between = getAttrOrDefault(x_layer, _Unicode(space_between), 0.); - double l_space_before = getAttrOrDefault(x_layer, _Unicode(space_before), 0.); + xml_comp_t x_layer = li; + int repeat = x_layer.repeat(); + double l_space_between = getAttrOrDefault(x_layer, _Unicode(space_between), 0.); + double l_space_before = getAttrOrDefault(x_layer, _Unicode(space_before), 0.); l_pos_z += l_space_before; // Loop over number of repeats for this layer. for (int j = 0; j < repeat; j++) { - std::string l_name = Form("layer%d", l_num); - double l_thickness = layering.layer(l_num - 1)->thickness(); // Layer's thickness. - double l_dim_x = tan_hphi * l_pos_z; + std::string l_name = Form("layer%d", l_num); + double l_thickness = layering.layer(l_num - 1)->thickness(); // Layer's thickness. + double l_dim_x = tan_hphi * l_pos_z; l_pos_z += l_thickness; - Position l_pos(0, 0, l_pos_z - l_thickness / 2.); // Position of the layer. - double l_trd_x1 = l_dim_x; - double l_trd_x2 = l_dim_x + l_thickness * tan_hphi; - double l_trd_y1 = l_dim_y; - double l_trd_y2 = l_trd_y1; - double l_trd_z = l_thickness / 2; - Trapezoid l_shape(l_trd_x1, l_trd_x2, l_trd_y1, l_trd_y2, l_trd_z); - Volume l_vol(l_name, l_shape, air); + Position l_pos(0, 0, l_pos_z - l_thickness / 2.); // Position of the layer. + double l_trd_x1 = l_dim_x; + double l_trd_x2 = l_dim_x + l_thickness * tan_hphi; + double l_trd_y1 = l_dim_y; + double l_trd_y2 = l_trd_y1; + double l_trd_z = l_thickness / 2; + Trapezoid l_shape(l_trd_x1, l_trd_x2, l_trd_y1, l_trd_y2, l_trd_z); + Volume l_vol(l_name, l_shape, air); DetElement layer(sector_det, l_name, det_id); // Loop over the sublayers or slices for this layer. - int s_num = 1; + int s_num = 1; double s_pos_z = -(l_thickness / 2.); for (xml_coll_t si(x_layer, _U(slice)); si; ++si) { - xml_comp_t x_slice = si; - std::string s_name = Form("slice%d", s_num); - double s_thick = x_slice.thickness(); - double s_trd_x1 = l_dim_x + (s_pos_z + l_thickness / 2) * tan_hphi; - double s_trd_x2 = l_dim_x + (s_pos_z + l_thickness / 2 + s_thick) * tan_hphi; - double s_trd_y1 = l_trd_y1; - double s_trd_y2 = s_trd_y1; - double s_trd_z = s_thick / 2.; - Trapezoid s_shape(s_trd_x1, s_trd_x2, s_trd_y1, s_trd_y2, s_trd_z); - Volume s_vol(s_name, s_shape, desc.material(x_slice.materialStr())); - DetElement slice(layer, s_name, det_id); + xml_comp_t x_slice = si; + std::string s_name = Form("slice%d", s_num); + double s_thick = x_slice.thickness(); + double s_trd_x1 = l_dim_x + (s_pos_z + l_thickness / 2) * tan_hphi; + double s_trd_x2 = l_dim_x + (s_pos_z + l_thickness / 2 + s_thick) * tan_hphi; + double s_trd_y1 = l_trd_y1; + double s_trd_y2 = s_trd_y1; + double s_trd_z = s_thick / 2.; + Trapezoid s_shape(s_trd_x1, s_trd_x2, s_trd_y1, s_trd_y2, s_trd_z); + Volume s_vol(s_name, s_shape, desc.material(x_slice.materialStr())); + DetElement slice(layer, s_name, det_id); // build fibers if (x_slice.hasChild(_Unicode(fiber))) { - buildFibers(desc, sens, s_vol, l_num, x_slice.child(_Unicode(fiber)), {s_trd_x1, s_thick, l_dim_y, hphi}); + buildFibers(desc, sens, s_vol, l_num, x_slice.child(_Unicode(fiber)), + {s_trd_x1, s_thick, l_dim_y, hphi}); } if (x_slice.isSensitive()) { @@ -174,7 +173,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) // Create nsides sectors. for (int i = 0; i < nsides; i++, phi -= dphi) { // i is module number // Compute the sector position - Transform3D tr(RotationZYX(0, phi, M_PI * 0.5), Translation3D(0, 0, 0)); + Transform3D tr(RotationZYX(0, phi, M_PI * 0.5), Translation3D(0, 0, 0)); PlacedVolume pv = envelope.placeVolume(mod_vol, tr); pv.addPhysVolID("sector", i + 1); DetElement sd = (i == 0) ? sector_det : sector_det.clone(Form("sector%d", i)); @@ -196,18 +195,18 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) return sdet; } -void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int layer_number, xml_comp_t x_fiber, - const std::tuple<double, double, double, double>& dimensions) -{ +void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int layer_number, + xml_comp_t x_fiber, const std::tuple<double, double, double, double>& dimensions) { auto [s_trd_x1, s_thick, s_length, hphi] = dimensions; - double f_radius = getAttrOrDefault(x_fiber, _U(radius), 0.1 * cm); - double f_cladding_thickness = getAttrOrDefault(x_fiber, _Unicode(cladding_thickness), 0.0 * cm); - double f_spacing_x = getAttrOrDefault(x_fiber, _Unicode(spacing_x), 0.122 * cm); - double f_spacing_z = getAttrOrDefault(x_fiber, _Unicode(spacing_z), 0.134 * cm); - int grid_n_phi = getAttrOrDefault(x_fiber, _Unicode(grid_n_phi), 5); - double grid_dr = getAttrOrDefault(x_fiber, _Unicode(grid_dr), 2.0 * cm); - std::string f_id_grid = getAttrOrDefault<std::string>(x_fiber, _Unicode(identifier_grid), "grid"); - std::string f_id_fiber = getAttrOrDefault<std::string>(x_fiber, _Unicode(identifier_fiber), "fiber"); + double f_radius = getAttrOrDefault(x_fiber, _U(radius), 0.1 * cm); + double f_cladding_thickness = getAttrOrDefault(x_fiber, _Unicode(cladding_thickness), 0.0 * cm); + double f_spacing_x = getAttrOrDefault(x_fiber, _Unicode(spacing_x), 0.122 * cm); + double f_spacing_z = getAttrOrDefault(x_fiber, _Unicode(spacing_z), 0.134 * cm); + int grid_n_phi = getAttrOrDefault(x_fiber, _Unicode(grid_n_phi), 5); + double grid_dr = getAttrOrDefault(x_fiber, _Unicode(grid_dr), 2.0 * cm); + std::string f_id_grid = getAttrOrDefault<std::string>(x_fiber, _Unicode(identifier_grid), "grid"); + std::string f_id_fiber = + getAttrOrDefault<std::string>(x_fiber, _Unicode(identifier_fiber), "fiber"); // Set up the readout grid for the fiber layers // Trapezoid is divided into segments with equal dz and equal number of divisions in x @@ -218,9 +217,9 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int lay // fiber and its cladding double f_radius_core = f_radius - f_cladding_thickness; - Tube f_tube_clad(0, f_radius, s_length); + Tube f_tube_clad(0, f_radius, s_length); Volume f_vol_clad("fiber_vol", f_tube_clad, desc.material(x_fiber.materialStr())); - Tube f_tube_core(0, f_radius_core, s_length); + Tube f_tube_core(0, f_radius_core, s_length); Volume f_vol_core("fiber_core_vol", f_tube_core, desc.material(x_fiber.materialStr())); if (x_fiber.isSensitive()) { f_vol_core.setSensitiveDetector(sens); @@ -229,14 +228,15 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int lay f_vol_clad.placeVolume(f_vol_core); // calculate polygonal grid coordinates (vertices) - auto grids = gridPoints(grid_n_phi, grid_dr, s_trd_x1, s_thick, hphi); + auto grids = gridPoints(grid_n_phi, grid_dr, s_trd_x1, s_thick, hphi); std::vector<int> f_id_count(grids.size(), 0); // use layer_number % 2 to add correct shifts for the adjacent fibers at layer boundary - auto f_pos = fiberPositions(f_radius, f_spacing_x, f_spacing_z, s_trd_x1, s_thick, hphi, (layer_number % 2 == 0)); + auto f_pos = fiberPositions(f_radius, f_spacing_x, f_spacing_z, s_trd_x1, s_thick, hphi, + (layer_number % 2 == 0)); // a helper struct to speed up searching struct Fiber { Point pos; - bool assigned = false; + bool assigned = false; Fiber(const Point& p) : pos(p){}; }; std::vector<Fiber> fibers(f_pos.begin(), f_pos.end()); @@ -253,7 +253,7 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int lay } // use TGeoPolygon to help check if fiber is inside a grid - TGeoPolygon poly(gr.points.size()); + TGeoPolygon poly(gr.points.size()); std::vector<double> vx, vy; std::transform(gr.points.begin(), gr.points.end(), back_inserter(vx), std::mem_fn(&Point::x)); std::transform(gr.points.begin(), gr.points.end(), back_inserter(vy), std::mem_fn(&Point::y)); @@ -276,8 +276,9 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int lay // only add this if this grid has fibers if (f_id > 1) { // fiber is along y-axis of the layer volume, so grids are arranged on X-Z plane - Transform3D gr_tr(RotationZYX(0., 0., M_PI * 0.5), Position(gr.mean_centroid.x(), 0., gr.mean_centroid.y())); - auto grid_phv = s_vol.placeVolume(grid_vol, gr_tr); + Transform3D gr_tr(RotationZYX(0., 0., M_PI * 0.5), + Position(gr.mean_centroid.x(), 0., gr.mean_centroid.y())); + auto grid_phv = s_vol.placeVolume(grid_vol, gr_tr); grid_phv.addPhysVolID(f_id_grid, gr.ix + gr.iy * grid_n_phi + 1); grid_vol.ptr()->Voxelize(""); } @@ -299,25 +300,23 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int lay // simple aluminum sheet cover // dimensions: (inner r, position in z, length, phi) void buildSupport(Detector& desc, Volume& mod_vol, xml_comp_t x_support, - const std::tuple<double, double, double, double>& dimensions) -{ + const std::tuple<double, double, double, double>& dimensions) { auto [inner_r, pos_z, sector_length, hphi] = dimensions; - double support_thickness = getAttrOrDefault(x_support, _Unicode(thickness), 3. * cm); - auto material = desc.material(x_support.materialStr()); - double trd_y = sector_length / 2.; - double trd_x1_support = std::tan(hphi) * pos_z; - double trd_x2_support = std::tan(hphi) * (pos_z + support_thickness); + double support_thickness = getAttrOrDefault(x_support, _Unicode(thickness), 3. * cm); + auto material = desc.material(x_support.materialStr()); + double trd_y = sector_length / 2.; + double trd_x1_support = std::tan(hphi) * pos_z; + double trd_x2_support = std::tan(hphi) * (pos_z + support_thickness); Trapezoid s_shape(trd_x1_support, trd_x2_support, trd_y, trd_y, support_thickness / 2.); - Volume s_vol("support_layer", s_shape, material); + Volume s_vol("support_layer", s_shape, material); s_vol.setVisAttributes(desc.visAttributes(x_support.visStr())); mod_vol.placeVolume(s_vol, Position(0.0, 0.0, pos_z + support_thickness / 2.)); } // Fill fiber lattice into trapezoid starting from position (0,0) in x-z coordinate system -std::vector<Point> fiberPositions(double r, double sx, double sz, double trx, double trz, double phi, bool shift, - double stol) -{ +std::vector<Point> fiberPositions(double r, double sx, double sz, double trx, double trz, + double phi, bool shift, double stol) { // r - fiber radius // sx, sz - spacing between fibers in x, z // trx - half-length of the shorter (bottom) base of the trapezoid @@ -326,10 +325,10 @@ std::vector<Point> fiberPositions(double r, double sx, double sz, double trx, do // stol - spacing tolerance std::vector<Point> positions; - int z_layers = floor((trz / 2 - r - stol) / sz); // number of layers that fits in half trapezoid-z + int z_layers = floor((trz / 2 - r - stol) / sz); // number of layers that fits in half trapezoid-z double px = 0., pz = 0.; - int start_line = shift ? 1 : 0; + int start_line = shift ? 1 : 0; for (int l = -z_layers; l < z_layers + 1; l++) { std::vector<Point> xline; @@ -345,7 +344,8 @@ std::vector<Point> fiberPositions(double r, double sx, double sz, double trx, do } // Sort fiber IDs for a better organization - sort(xline.begin(), xline.end(), [](const Point& p1, const Point& p2) { return p1.x() < p2.x(); }); + sort(xline.begin(), xline.end(), + [](const Point& p1, const Point& p2) { return p1.x() < p2.x(); }); positions.insert(positions.end(), xline.begin(), xline.end()); } return positions; @@ -353,8 +353,8 @@ std::vector<Point> fiberPositions(double r, double sx, double sz, double trx, do // Determine the number of divisions for the readout grid for the fiber layers // Calculate dimensions of the polygonal grid -std::vector<FiberGrid> gridPoints(int div_n_phi, double div_dr, double trd_x1, double height, double phi) -{ +std::vector<FiberGrid> gridPoints(int div_n_phi, double div_dr, double trd_x1, double height, + double phi) { /* // TODO: move this test to xml file double SiPMsize = 13.0 * mm; @@ -377,7 +377,7 @@ std::vector<FiberGrid> gridPoints(int div_n_phi, double div_dr, double trd_x1, d // grid vertices std::vector<FiberGrid> results; - double dr = height / nr; + double dr = height / nr; for (int ir = 0; ir <= nr; ir++) { for (int iph = 0; iph <= nph; iph++) { diff --git a/src/BarrelFluxReturn_geo.cpp b/src/BarrelFluxReturn_geo.cpp index 9ea328d6d..9b4f644d1 100644 --- a/src/BarrelFluxReturn_geo.cpp +++ b/src/BarrelFluxReturn_geo.cpp @@ -7,8 +7,8 @@ using namespace dd4hep; -static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[maybe_unused]] dd4hep::SensitiveDetector sens) -{ +static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, + [[maybe_unused]] dd4hep::SensitiveDetector sens) { xml_det_t x_det = e; xml_comp_t x_dim = x_det.dimensions(); @@ -25,18 +25,18 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[m std::map<std::string, dd4hep::Volume> volumes_by_name; for (xml_coll_t shape(e, _U(shape)); shape; ++shape) { xml_comp_t x_shape = shape; - Solid solid = xml::createShape(description, x_shape.typeStr(), shape); - Material mat = description.material(x_shape.materialStr()); + Solid solid = xml::createShape(description, x_shape.typeStr(), shape); + Material mat = description.material(x_shape.materialStr()); volumes_by_name[x_shape.nameStr()] = - Volume(x_shape.nameStr(), solid, mat) - .setVisAttributes(description.visAttributes(x_shape.visStr())); + Volume(x_shape.nameStr(), solid, mat) + .setVisAttributes(description.visAttributes(x_shape.visStr())); } // Replicate volumes for (xml_coll_t repl(e, _U(replicate)); repl; ++repl) { xml_comp_t x_repl = repl; - Volume& vol = volumes_by_name[x_repl.attr<std::string>(_U(shape))]; - Transform3D tf = xml::createTransformation(x_repl); + Volume& vol = volumes_by_name[x_repl.attr<std::string>(_U(shape))]; + Transform3D tf = xml::createTransformation(x_repl); for (int i = 0; i < x_repl.count(); ++i) { double phi = x_repl.phi0() + i * x_repl.attr<double>(_Unicode(dphi)); env_vol.placeVolume(vol, Transform3D(RotationZ(phi)) * tf); diff --git a/src/BarrelHCalCalorimeter_geo.cpp b/src/BarrelHCalCalorimeter_geo.cpp index 3f53b5374..499080494 100644 --- a/src/BarrelHCalCalorimeter_geo.cpp +++ b/src/BarrelHCalCalorimeter_geo.cpp @@ -29,18 +29,17 @@ using namespace std; using namespace dd4hep; using namespace dd4hep::detail; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { // printout(WARNING, "BarrelHCalCalorimeter", "called create_detector "); - xml_det_t x_det = e; - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - Material air = description.air(); + xml_det_t x_det = e; + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + Material air = description.air(); DetElement sdet(det_name, det_id); - Volume motherVol = description.pickMotherVolume(sdet); + Volume motherVol = description.pickMotherVolume(sdet); // Create envelope to hold HCAL barrel @@ -52,12 +51,16 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // 5mm buffer on inner radius to acount for comb angle/tilt // (allows the combs to be added in later) - std::vector<double> rmins = {rmin2-0.5*cm, rmin2-0.5*cm, rmin1-1.5*cm, rmin1-1.5*cm, rmin2-0.5*cm, rmin2-0.5*cm}; + std::vector<double> rmins = {rmin2 - 0.5 * cm, rmin2 - 0.5 * cm, rmin1 - 1.5 * cm, + rmin1 - 1.5 * cm, rmin2 - 0.5 * cm, rmin2 - 0.5 * cm}; // 1cm buffer on outer radius to acount for comb angle/tilt // (allows the combs to be added in later) - std::vector<double> rmaxs = {rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm, rmax+1.0*cm}; + std::vector<double> rmaxs = {rmax + 1.0 * cm, rmax + 1.0 * cm, rmax + 1.0 * cm, + rmax + 1.0 * cm, rmax + 1.0 * cm, rmax + 1.0 * cm}; // leave room for dogbones at the ends (not part of det table) - std::vector<double> zs = {-length2 / 2. - 8.2*cm, -length1 / 2., -length1 / 2., length1 / 2., length1 / 2., length2 / 2. + 8.2*cm}; + std::vector<double> zs = { + -length2 / 2. - 8.2 * cm, -length1 / 2., -length1 / 2., length1 / 2., length1 / 2., + length2 / 2. + 8.2 * cm}; // printout(WARNING, "BarrelHCalCalorimeter", "%f %f %f %f %f", rmin1, rmin2, rmax, length1/2., length2/2.); @@ -72,40 +75,51 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // Pick up the constants - double tilePlaneRotate = 0.0; - double tile_tolerance = 0.2; // Tile tolerance in mm to avoid overlaps + double tilePlaneRotate = 0.0; + double tile_tolerance = 0.2; // Tile tolerance in mm to avoid overlaps // Sector steel tessellated shape gdml file info xml_comp_t x_det_sec_gdmlfile = x_det.child("sec_gdmlfile"); - std::string sec_gdml_file = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(file), " ");; - std::string sec_gdml_material = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(material), " "); + std::string sec_gdml_file = + getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(file), " "); + ; + std::string sec_gdml_material = + getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(material), " "); std::string sec_gdml_url = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(url), " "); - std::string sec_gdml_cache = getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(cache), " "); + std::string sec_gdml_cache = + getAttrOrDefault<std::string>(x_det_sec_gdmlfile, _Unicode(cache), " "); xml_comp_t x_det_csec_gdmlfile = x_det.child("csec_gdmlfile"); - std::string csec_gdml_file = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(file), " ");; - std::string csec_gdml_material = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(material), " "); - std::string csec_gdml_url = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(url), " "); - std::string csec_gdml_cache = getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(cache), " "); + std::string csec_gdml_file = + getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(file), " "); + ; + std::string csec_gdml_material = + getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(material), " "); + std::string csec_gdml_url = + getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(url), " "); + std::string csec_gdml_cache = + getAttrOrDefault<std::string>(x_det_csec_gdmlfile, _Unicode(cache), " "); xml_comp_t x_det_er_gdmlfile = x_det.child("er_gdmlfile"); - std::string er_gdml_file = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(file), " ");; - std::string er_gdml_material = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(material), " "); + std::string er_gdml_file = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(file), " "); + ; + std::string er_gdml_material = + getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(material), " "); std::string er_gdml_url = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(url), " "); - std::string er_gdml_cache = getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(cache), " "); + std::string er_gdml_cache = + getAttrOrDefault<std::string>(x_det_er_gdmlfile, _Unicode(cache), " "); // Loop over the defines section and pick up the tile offsets, ref location and angles for (xml_coll_t i(det_define, _Unicode(constant)); i; ++i) { xml_comp_t x_const = i; - std::string const_name = getAttrOrDefault<std::string>(x_const, _Unicode(name), " "); + std::string const_name = getAttrOrDefault<std::string>(x_const, _Unicode(name), " "); - if (const_name == "tilePlaneRotate"){ + if (const_name == "tilePlaneRotate") { std::string const_value = getAttrOrDefault<std::string>(x_const, _Unicode(value), " "); - tilePlaneRotate = atof(const_value.c_str()); - } - else + tilePlaneRotate = atof(const_value.c_str()); + } else printout(WARNING, "BarrelHCalCalorimeter", "unrecognized <constant> data!"); } @@ -150,7 +164,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s } std::string delimiter = " "; - size_t pos = 0; + size_t pos = 0; std::string token; while ((pos = mtrx_values.find(delimiter)) != std::string::npos) { token = mtrx_values.substr(0, pos); @@ -169,12 +183,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s EnsureFileFromURLExists(sec_gdml_url, sec_gdml_file, sec_gdml_cache); if (!fs::exists(fs::path(sec_gdml_file))) { printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + sec_gdml_file + " does not exist"); - printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + printout(ERROR, "BarrelHCalCalorimeter_geo", + "use a FileLoader plugin before the field element"); std::_Exit(EXIT_FAILURE); } Volume barrel_sector_vol = parser.GDMLReadFile(sec_gdml_file.c_str()); - if(!barrel_sector_vol.isValid()){ + if (!barrel_sector_vol.isValid()) { printout(WARNING, "BarrelHCalCalorimeter", "%s", sec_gdml_file.c_str()); printout(WARNING, "BarrelHCalCalorimeter", "barrel_sector_vol invalid, GDML parser failed!"); std::_Exit(EXIT_FAILURE); @@ -190,12 +205,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s EnsureFileFromURLExists(csec_gdml_url, csec_gdml_file, csec_gdml_cache); if (!fs::exists(fs::path(csec_gdml_file))) { printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + csec_gdml_file + " does not exist"); - printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + printout(ERROR, "BarrelHCalCalorimeter_geo", + "use a FileLoader plugin before the field element"); std::_Exit(EXIT_FAILURE); } Volume barrel_csector_vol = parser.GDMLReadFile(csec_gdml_file.c_str()); - if(!barrel_csector_vol.isValid()){ + if (!barrel_csector_vol.isValid()) { printout(WARNING, "BarrelHCalCalorimeter", "%s", csec_gdml_file.c_str()); printout(WARNING, "BarrelHCalCalorimeter", "barrel_csector_vol invalid, GDML parser failed!"); std::_Exit(EXIT_FAILURE); @@ -211,12 +227,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s EnsureFileFromURLExists(er_gdml_url, er_gdml_file, er_gdml_cache); if (!fs::exists(fs::path(er_gdml_file))) { printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + er_gdml_file + " does not exist"); - printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + printout(ERROR, "BarrelHCalCalorimeter_geo", + "use a FileLoader plugin before the field element"); std::_Exit(EXIT_FAILURE); } Volume barrel_er_vol = parser.GDMLReadFile(er_gdml_file.c_str()); - if(!barrel_er_vol.isValid()){ + if (!barrel_er_vol.isValid()) { printout(WARNING, "BarrelHCalCalorimeter", "%s", er_gdml_file.c_str()); printout(WARNING, "BarrelHCalCalorimeter", "barrel_er_vol invalid, GDML parser failed!"); std::_Exit(EXIT_FAILURE); @@ -230,61 +247,74 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // Place steel in envelope - double sec_rot_angle = 360.0/32.0; + double sec_rot_angle = 360.0 / 32.0; - for(int k=0; k<29; k++){ - BarrelHCAL.placeVolume(barrel_sector_vol, k, Transform3D(RotationZ(-k*sec_rot_angle*dd4hep::deg)*RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); + for (int k = 0; k < 29; k++) { + BarrelHCAL.placeVolume( + barrel_sector_vol, k, + Transform3D(RotationZ(-k * sec_rot_angle * dd4hep::deg) * RotationY(180.0 * dd4hep::deg), + Translation3D(0, 0, 0))); } - BarrelHCAL.placeVolume(barrel_csector_vol, 0, Transform3D(RotationZ(sec_rot_angle*dd4hep::deg)*RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); - BarrelHCAL.placeVolume(barrel_csector_vol, 1, Transform3D(RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); - BarrelHCAL.placeVolume(barrel_csector_vol, 2, Transform3D(RotationZ(-sec_rot_angle*dd4hep::deg)*RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); - BarrelHCAL.placeVolume(barrel_er_vol, 0, Transform3D(RotationY(180.0* dd4hep::deg),Translation3D(0, 0, 0))); - BarrelHCAL.placeVolume(barrel_er_vol, 1, Transform3D(RotationY(0.0* dd4hep::deg),Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume( + barrel_csector_vol, 0, + Transform3D(RotationZ(sec_rot_angle * dd4hep::deg) * RotationY(180.0 * dd4hep::deg), + Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume(barrel_csector_vol, 1, + Transform3D(RotationY(180.0 * dd4hep::deg), Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume( + barrel_csector_vol, 2, + Transform3D(RotationZ(-sec_rot_angle * dd4hep::deg) * RotationY(180.0 * dd4hep::deg), + Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume(barrel_er_vol, 0, + Transform3D(RotationY(180.0 * dd4hep::deg), Translation3D(0, 0, 0))); + BarrelHCAL.placeVolume(barrel_er_vol, 1, + Transform3D(RotationY(0.0 * dd4hep::deg), Translation3D(0, 0, 0))); // Loop over the tile solids, create them and add them to the detector volume Volume Tile[12]; Volume ChimneyTile[4]; - for(int j=1; j<17; j++){ + for (int j = 1; j < 17; j++) { std::string gdmlname; std::string solid_name; - if(j<13){ + if (j < 13) { // standard tiles - gdmlname = _toString(j,"tile%d_gdmlfile"); - solid_name = _toString(j,"OuterHCalTile%02d"); + gdmlname = _toString(j, "tile%d_gdmlfile"); + solid_name = _toString(j, "OuterHCalTile%02d"); - } - else{ + } else { // chimney tiles - gdmlname = _toString(j-4,"ctile%d_gdmlfile"); - solid_name = _toString(j-4,"OuterHCalChimneyTile%02d"); - + gdmlname = _toString(j - 4, "ctile%d_gdmlfile"); + solid_name = _toString(j - 4, "OuterHCalChimneyTile%02d"); } // tile shape gdml file info xml_comp_t x_det_tgdmlfile = x_det.child(gdmlname); - std::string tgdml_file = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(file), " ");; - std::string tgdml_material = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(material), " "); - std::string tgdml_url = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(url), " "); + std::string tgdml_file = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(file), " "); + ; + std::string tgdml_material = + getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(material), " "); + std::string tgdml_url = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(url), " "); std::string tgdml_cache = getAttrOrDefault<std::string>(x_det_tgdmlfile, _Unicode(cache), " "); EnsureFileFromURLExists(tgdml_url, tgdml_file, tgdml_cache); if (!fs::exists(fs::path(tgdml_file))) { printout(ERROR, "BarrelHCalCalorimeter_geo", "file " + tgdml_file + " does not exist"); - printout(ERROR, "BarrelHCalCalorimeter_geo", "use a FileLoader plugin before the field element"); + printout(ERROR, "BarrelHCalCalorimeter_geo", + "use a FileLoader plugin before the field element"); std::_Exit(EXIT_FAILURE); } Volume solidVolume = parser.GDMLReadFile(tgdml_file.c_str()); - if(!solidVolume.isValid()){ + if (!solidVolume.isValid()) { printout(WARNING, "BarrelHCalCalorimeter_geo", "%s", tgdml_file.c_str()); printout(WARNING, "BarrelHCalCalorimeter_geo", "solidVolume invalid, GDML parser failed!"); std::_Exit(EXIT_FAILURE); @@ -308,19 +338,17 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s if (type == "OuterHCalTile" || type == "OuterHCalChimneyTile") { std::string stnum = solid_name.substr(solid_name.size() - 2, solid_name.size()); - int tnum = atoi(stnum.c_str()) - 1; + int tnum = atoi(stnum.c_str()) - 1; // Tile numbers are indexed by the center (eta=0) out, we want them starting zero at one end. if (type == "OuterHCalTile") { - Tile[11-tnum] = solidVolume; - - } - else if ((tnum > 7) && (type == "OuterHCalChimneyTile")) { + Tile[11 - tnum] = solidVolume; - ChimneyTile[11-tnum] = solidVolume; + } else if ((tnum > 7) && (type == "OuterHCalChimneyTile")) { + ChimneyTile[11 - tnum] = solidVolume; } } else @@ -332,13 +360,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // Place the tiles into the calorimeter volume - double increment_angle = (360.0/320.0)*dd4hep::deg; - double increment_offset = -10.01*increment_angle; + double increment_angle = (360.0 / 320.0) * dd4hep::deg; + double increment_offset = -10.01 * increment_angle; DetElement tile_det("eta0 phi0", det_id); sens.setType("calorimeter"); - for (int i_eta = 0; i_eta < 12; i_eta++) { // eta ring + for (int i_eta = 0; i_eta < 12; i_eta++) { // eta ring int tnum = 11 - i_eta; @@ -349,117 +377,126 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // ordinary sector tiles PlacedVolume phv1 = BarrelHCAL.placeVolume( - Tile[i_eta], i_phi + i_eta * 320, - RotationZ(i_phi * increment_angle + increment_offset) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Transform3D(RotationY(180.0 * dd4hep::deg), - Translation3D(-(xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTile[tnum] * dd4hep::mm, -zposTile[tnum] * dd4hep::mm))); - - phv1.addPhysVolID("eta",i_eta).addPhysVolID("phi",i_phi); - DetElement sd1 = tile_det.clone(_toString(i_eta, "eta%d ")+_toString(i_phi, "phi%d")); + Tile[i_eta], i_phi + i_eta * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D( + RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Transform3D( + RotationY(180.0 * dd4hep::deg), + Translation3D(-(xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, -zposTile[tnum] * dd4hep::mm))); + + phv1.addPhysVolID("eta", i_eta).addPhysVolID("phi", i_phi); + DetElement sd1 = tile_det.clone(_toString(i_eta, "eta%d ") + _toString(i_phi, "phi%d")); sd1.setPlacement(phv1); sdet.add(sd1); PlacedVolume phv0 = BarrelHCAL.placeVolume( - Tile[i_eta], i_phi + (12 + tnum) * 320, - RotationZ(i_phi * increment_angle + increment_offset) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); - - phv0.addPhysVolID("eta",(12+tnum)).addPhysVolID("phi", i_phi); - DetElement sd0 = tile_det.clone(_toString((12+tnum), "eta%d ")+_toString(i_phi, "phi%d")); + Tile[i_eta], i_phi + (12 + tnum) * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D( + RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); + + phv0.addPhysVolID("eta", (12 + tnum)).addPhysVolID("phi", i_phi); + DetElement sd0 = + tile_det.clone(_toString((12 + tnum), "eta%d ") + _toString(i_phi, "phi%d")); sd0.setPlacement(phv0); sdet.add(sd0); - } else { // first three sectors are chimney sectors - if(i_phi>29){ + if (i_phi > 29) { // ordinary sector tiles PlacedVolume phv1 = BarrelHCAL.placeVolume( - Tile[i_eta], i_phi + i_eta * 320, - RotationZ(i_phi * increment_angle + increment_offset) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); + Tile[i_eta], i_phi + i_eta * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D( + RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); phv1.addPhysVolID("eta", i_eta).addPhysVolID("phi", i_phi); - DetElement sd1 = tile_det.clone(_toString(i_eta, "eta%d ")+_toString(i_phi, "phi%d")); + DetElement sd1 = tile_det.clone(_toString(i_eta, "eta%d ") + _toString(i_phi, "phi%d")); sd1.setPlacement(phv1); sdet.add(sd1); PlacedVolume phv0 = BarrelHCAL.placeVolume( - Tile[i_eta], i_phi + (12 + tnum) * 320, - RotationZ(i_phi * increment_angle + increment_offset) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Transform3D(RotationY(180.0 * dd4hep::deg), - Translation3D(-(xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTile[tnum] * dd4hep::mm, -zposTile[tnum] * dd4hep::mm))); + Tile[i_eta], i_phi + (12 + tnum) * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D( + RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Transform3D( + RotationY(180.0 * dd4hep::deg), + Translation3D(-(xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, -zposTile[tnum] * dd4hep::mm))); phv0.addPhysVolID("eta", (12 + tnum)).addPhysVolID("phi", i_phi); - DetElement sd0 = tile_det.clone(_toString((12+tnum), "eta%d ")+_toString(i_phi, "phi%d")); + DetElement sd0 = + tile_det.clone(_toString((12 + tnum), "eta%d ") + _toString(i_phi, "phi%d")); sd0.setPlacement(phv0); sdet.add(sd0); - } - else{ + } else { // chimney sector tile PlacedVolume phv1 = BarrelHCAL.placeVolume( - ChimneyTile[i_eta], i_phi + (12 + tnum) * 320, - RotationZ(i_phi * increment_angle + increment_offset) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Translation3D((xposChimneyTileS[tnum-8] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposChimneyTileS[tnum-8] * dd4hep::mm, zposChimneyTileS[tnum-8] * dd4hep::mm)); - + ChimneyTile[i_eta], i_phi + (12 + tnum) * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D( + RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposChimneyTileS[tnum - 8] + (tnum + 1) * tile_tolerance) * + dd4hep::mm, + yposChimneyTileS[tnum - 8] * dd4hep::mm, + zposChimneyTileS[tnum - 8] * dd4hep::mm)); phv1.addPhysVolID("eta", (12 + tnum)).addPhysVolID("phi", i_phi); - DetElement sd1 = tile_det.clone(_toString((12+tnum), "eta%d ")+_toString(i_phi, "phi%d")); + DetElement sd1 = + tile_det.clone(_toString((12 + tnum), "eta%d ") + _toString(i_phi, "phi%d")); sd1.setPlacement(phv1); sdet.add(sd1); PlacedVolume phv0 = BarrelHCAL.placeVolume( - Tile[i_eta], i_phi + i_eta * 320, - RotationZ(i_phi * increment_angle + increment_offset) * - Transform3D(RotationY(90.0 * dd4hep::deg), - Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * - RotationX(-tilePlaneRotate * dd4hep::deg) * - Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, - yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); + Tile[i_eta], i_phi + i_eta * 320, + RotationZ(i_phi * increment_angle + increment_offset) * + Transform3D( + RotationY(90.0 * dd4hep::deg), + Translation3D(xposOuter[0] * dd4hep::mm, yposOuter[0] * dd4hep::mm, 0.0)) * + RotationX(-tilePlaneRotate * dd4hep::deg) * + Translation3D((xposTile[tnum] + (tnum + 1) * tile_tolerance) * dd4hep::mm, + yposTile[tnum] * dd4hep::mm, zposTile[tnum] * dd4hep::mm)); phv0.addPhysVolID("eta", i_eta).addPhysVolID("phi", i_phi); - DetElement sd0 = tile_det.clone(_toString(i_eta, "eta%d ")+_toString(i_phi, "phi%d")); + DetElement sd0 = tile_det.clone(_toString(i_eta, "eta%d ") + _toString(i_phi, "phi%d")); sd0.setPlacement(phv0); sdet.add(sd0); - } - } } } // Place the detector into the envelope - envelope.placeVolume(BarrelHCAL, 0, Transform3D(RotationZ(0.0),Translation3D(0, 0, 0))); + envelope.placeVolume(BarrelHCAL, 0, Transform3D(RotationZ(0.0), Translation3D(0, 0, 0))); - std::string env_vis = getAttrOrDefault<std::string>(x_det, _Unicode(env_vis), "HcalBarrelEnvelopeVis"); + std::string env_vis = + getAttrOrDefault<std::string>(x_det, _Unicode(env_vis), "HcalBarrelEnvelopeVis"); envelope.setAttributes(description, x_det.regionStr(), x_det.limitsStr(), env_vis); return sdet; } diff --git a/src/BarrelPlanarMPGDTracker_geo.cpp b/src/BarrelPlanarMPGDTracker_geo.cpp index 02f75c7a8..23231b8cb 100644 --- a/src/BarrelPlanarMPGDTracker_geo.cpp +++ b/src/BarrelPlanarMPGDTracker_geo.cpp @@ -37,21 +37,21 @@ using namespace dd4hep::rec; * - Detector is setup as a "tracker" so we can use the hits * */ -static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, + SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; + xml_det_t x_det = e; // Material air = description.air(); - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - DetElement sdet(det_name, det_id); - map<string, Volume> volumes; - map<string, Placements> sensitives; + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + DetElement sdet(det_name, det_id); + map<string, Volume> volumes; + map<string, Placements> sensitives; map<string, std::vector<rec::VolPlane>> volplane_surfaces; - PlacedVolume pv; - dd4hep::xml::Dimension dimensions(x_det.dimensions()); - xml_dim_t mpgd_pos = x_det.position(); - Assembly assembly(det_name); + PlacedVolume pv; + dd4hep::xml::Dimension dimensions(x_det.dimensions()); + xml_dim_t mpgd_pos = x_det.position(); + Assembly assembly(det_name); // Set detector type flag dd4hep::xml::setDetectorTypeFlag(x_det, sdet); @@ -60,7 +60,8 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, // Add the volume boundary material if configured for (xml_coll_t bmat(x_det, _Unicode(boundary_material)); bmat; ++bmat) { xml_comp_t x_boundary_material = bmat; - DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, "boundary_material"); + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, + "boundary_material"); } map<string, std::array<double, 2>> module_thicknesses; @@ -69,7 +70,7 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, // loop over the modules for (xml_coll_t mi(x_det, _U(module)); mi; ++mi) { xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); + string m_nam = x_mod.nameStr(); if (volumes.find(m_nam) != volumes.end()) { printout(ERROR, "BarrelPlanarMPGDTracker_geo", @@ -77,8 +78,8 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, throw runtime_error("Logics error in building modules."); } - int ncomponents = 0; - int sensor_number = 1; + int ncomponents = 0; + int sensor_number = 1; double total_thickness = 0; // Compute module total thickness from components @@ -113,13 +114,13 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, double max_component_length = 0; double gas_thickness = 0.0; for (xml_coll_t mci(x_mod, _U(module_component)); mci; ++mci, ++ncomponents) { - xml_comp_t x_comp = mci; - string c_nam = _toString(ncomponents, "component%d"); - string comp_name = x_comp.nameStr(); + xml_comp_t x_comp = mci; + string c_nam = _toString(ncomponents, "component%d"); + string comp_name = x_comp.nameStr(); double box_width = x_comp.width(); double box_length = x_comp.length(); - Box c_box; + Box c_box; // Since MPGD frames are layed over the MPGD foils, the foil material is pressent under the frame as well. // The gas volumes are not present under the frames, so our frames must eat only the gas module areas // @@ -149,7 +150,8 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "Not gas: %s", comp_name.c_str()); printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "box_comp_width: %f", x_comp.width()); printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "box_comp_length: %f", x_comp.length()); - printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "box_comp_thickness: %f", x_comp.thickness()); + printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "box_comp_thickness: %f", + x_comp.thickness()); } Volume c_vol{c_nam, c_box, description.material(x_comp.materialStr())}; @@ -185,8 +187,8 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, } // Now add-on the frame if (x_mod.hasChild(_U(frame))) { - xml_comp_t m_frame = x_mod.child(_U(frame)); - double frame_thickness = getAttrOrDefault<double>(m_frame, _U(thickness), total_thickness); + xml_comp_t m_frame = x_mod.child(_U(frame)); + double frame_thickness = getAttrOrDefault<double>(m_frame, _U(thickness), total_thickness); Box lframe_box{m_frame.width() / 2.0, (max_component_length + 2.0 * m_frame.width()) / 2.0, frame_thickness / 2.0}; @@ -209,16 +211,21 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "frame_thickness: %f", frame_thickness); printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "total_thickness: %f", total_thickness); - printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "frame_thickness + total_thickness: %f", frame_thickness + total_thickness); + printout(DEBUG, "BarrelPlanarMPGDTracker_geo", "frame_thickness + total_thickness: %f", + frame_thickness + total_thickness); m_vol.placeVolume(lframe_vol, Position(frame_width / 2.0 + max_component_width / 2, 0.0, - frame_thickness / 2.0 - total_thickness / 2.0 - gas_thickness / 2.0)); + frame_thickness / 2.0 - total_thickness / 2.0 - + gas_thickness / 2.0)); m_vol.placeVolume(rframe_vol, Position(-frame_width / 2.0 - max_component_width / 2.0, 0.0, - frame_thickness / 2.0 - total_thickness / 2.0 - gas_thickness / 2.0)); + frame_thickness / 2.0 - total_thickness / 2.0 - + gas_thickness / 2.0)); m_vol.placeVolume(tframe_vol, Position(0.0, frame_width / 2.0 + max_component_length / 2, - frame_thickness / 2.0 - total_thickness / 2.0 - gas_thickness / 2.0)); + frame_thickness / 2.0 - total_thickness / 2.0 - + gas_thickness / 2.0)); m_vol.placeVolume(bframe_vol, Position(0.0, -frame_width / 2.0 - max_component_length / 2.0, - frame_thickness / 2.0 - total_thickness / 2.0 - gas_thickness / 2.0)); + frame_thickness / 2.0 - total_thickness / 2.0 - + gas_thickness / 2.0)); } } @@ -227,14 +234,14 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, xml_comp_t x_layer = li; xml_comp_t x_layout = x_layer.child(_U(rphi_layout)); xml_comp_t z_layout = x_layer.child(_U(z_layout)); - int lay_id = x_layer.id(); - string m_nam = x_layer.moduleStr(); - string lay_nam = det_name + _toString(x_layer.id(), "_layer%d"); + int lay_id = x_layer.id(); + string m_nam = x_layer.moduleStr(); + string lay_nam = det_name + _toString(x_layer.id(), "_layer%d"); xml_comp_t envelope_tolerance = x_layer.child(_Unicode(envelope_tolerance), false); - double envelope_r_min = 0; - double envelope_r_max = 0; - double envelope_z_min = 0; - double envelope_z_max = 0; + double envelope_r_min = 0; + double envelope_r_max = 0; + double envelope_z_min = 0; + double envelope_z_max = 0; if (envelope_tolerance) { envelope_r_min = getAttrOrDefault(envelope_tolerance, _Unicode(r_min), 0); envelope_r_max = getAttrOrDefault(envelope_tolerance, _Unicode(r_max), 0); @@ -245,7 +252,7 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, double phi0 = x_layout.phi0(); // starting phi of first module double phi_tilt = x_layout.phi_tilt(); // Phi tilit of module double rc = x_layout.rc(); // Radius of the module - int nphi = x_layout.nphi(); // Number of modules in phi + int nphi = x_layout.nphi(); // Number of modules in phi double rphi_dr = x_layout.dr(); // The delta radius of every other module double phi_incr = (2 * M_PI) / nphi; // Phi increment for one module double phic = phi0; // Phi of the module @@ -253,11 +260,12 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, double z_dr = z_layout.dr(); // Radial offest of modules in z double z0 = z_layout.z0(); // Sets how much overlap in z the nz modules have - Assembly layer_assembly(lay_nam); - Volume module_env = volumes[m_nam]; - DetElement lay_elt(sdet, lay_nam, lay_id); - Placements& sensVols = sensitives[m_nam]; - auto& layerParams = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(lay_elt); + Assembly layer_assembly(lay_nam); + Volume module_env = volumes[m_nam]; + DetElement lay_elt(sdet, lay_nam, lay_id); + Placements& sensVols = sensitives[m_nam]; + auto& layerParams = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(lay_elt); pv = assembly.placeVolume(layer_assembly); pv.addPhysVolID("layer", lay_id); @@ -272,12 +280,14 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, double dy = z_dr * std::sin(phic + phi_tilt); // Deta y of module position // loop over the modules in z for (int j = 0; j < nz; j++) { - string module_name = _toString(module, "module%d"); + string module_name = _toString(module, "module%d"); DetElement mod_elt(lay_elt, module_name, module); - double mod_z = 0.5 * dimensions.length(); - double z_placement = mod_z - j * nz * mod_z; // z location for module placement - double z_offset = - z_placement > 0 ? -z0 / 2.0 : z0 / 2.0; // determine the amount of overlap in z the z nz modules have + double mod_z = 0.5 * dimensions.length(); + double z_placement = mod_z - j * nz * mod_z; // z location for module placement + double z_offset = + z_placement > 0 + ? -z0 / 2.0 + : z0 / 2.0; // determine the amount of overlap in z the z nz modules have Transform3D tr(RotationZYX(0.0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), Position(xc, yc, mpgd_pos.z() + z_placement + z_offset)); // in x-y plane, @@ -286,7 +296,7 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, mod_elt.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_de(mod_elt, std::string("de_") + sens_pv.volume().name(), module); + DetElement comp_de(mod_elt, std::string("de_") + sens_pv.volume().name(), module); comp_de.setPlacement(sens_pv); } // increas module counter @@ -307,7 +317,8 @@ static Ref_t create_BarrelPlanarMPGDTracker_geo(Detector& description, xml_h e, for (xml_coll_t lmat(x_layer, _Unicode(layer_material)); lmat; ++lmat) { xml_comp_t x_layer_material = lmat; - DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, "layer_material"); + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, + "layer_material"); } } sdet.setAttributes(description, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr()); diff --git a/src/BarrelTrackerWithFrame_geo.cpp b/src/BarrelTrackerWithFrame_geo.cpp index c0d58bae5..e8fa910c0 100644 --- a/src/BarrelTrackerWithFrame_geo.cpp +++ b/src/BarrelTrackerWithFrame_geo.cpp @@ -44,17 +44,16 @@ using namespace dd4hep::detail; * * @author Whitney Armstrong */ -static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; - Material air = description.air(); - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - DetElement sdet(det_name, det_id); - - map<string, Volume> volumes; - map<string, Placements> sensitives; + xml_det_t x_det = e; + Material air = description.air(); + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + DetElement sdet(det_name, det_id); + + map<string, Volume> volumes; + map<string, Placements> sensitives; map<string, std::vector<VolPlane>> volplane_surfaces; map<string, std::array<double, 2>> module_thicknesses; @@ -62,14 +61,13 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi // Set detector type flag dd4hep::xml::setDetectorTypeFlag(x_det, sdet); - auto ¶ms = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( - sdet); + auto& params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(sdet); // Add the volume boundary material if configured for (xml_coll_t bmat(x_det, _Unicode(boundary_material)); bmat; ++bmat) { xml_comp_t x_boundary_material = bmat; DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, - "boundary_material"); + "boundary_material"); } // dd4hep::xml::Dimension dimensions(x_det.dimensions()); @@ -81,27 +79,29 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi // Loop over the suports for (xml_coll_t su(x_det, _U(support)); su; ++su) { - xml_comp_t x_support = su; - double support_thickness = getAttrOrDefault(x_support, _U(thickness), 2.0 * mm); - double support_length = getAttrOrDefault(x_support, _U(length), 2.0 * mm); - double support_rmin = getAttrOrDefault(x_support, _U(rmin), 2.0 * mm); - double support_zstart = getAttrOrDefault(x_support, _U(zstart), 2.0 * mm); - std::string support_name = getAttrOrDefault<std::string>(x_support, _Unicode(name), "support_tube"); - std::string support_vis = getAttrOrDefault<std::string>(x_support, _Unicode(vis), "AnlRed"); - xml_dim_t pos(x_support.child(_U(position), false)); - xml_dim_t rot(x_support.child(_U(rotation), false)); - Solid support_solid; + xml_comp_t x_support = su; + double support_thickness = getAttrOrDefault(x_support, _U(thickness), 2.0 * mm); + double support_length = getAttrOrDefault(x_support, _U(length), 2.0 * mm); + double support_rmin = getAttrOrDefault(x_support, _U(rmin), 2.0 * mm); + double support_zstart = getAttrOrDefault(x_support, _U(zstart), 2.0 * mm); + std::string support_name = + getAttrOrDefault<std::string>(x_support, _Unicode(name), "support_tube"); + std::string support_vis = getAttrOrDefault<std::string>(x_support, _Unicode(vis), "AnlRed"); + xml_dim_t pos(x_support.child(_U(position), false)); + xml_dim_t rot(x_support.child(_U(rotation), false)); + Solid support_solid; if (x_support.hasChild(_U(shape))) { xml_comp_t shape(x_support.child(_U(shape))); - string shape_type = shape.typeStr(); - support_solid = xml::createShape(description, shape_type, shape); + string shape_type = shape.typeStr(); + support_solid = xml::createShape(description, shape_type, shape); } else { support_solid = Tube(support_rmin, support_rmin + support_thickness, support_length / 2); } - Transform3D tr = Transform3D(Rotation3D(), Position(0, 0, (support_zstart + support_length / 2))); + Transform3D tr = + Transform3D(Rotation3D(), Position(0, 0, (support_zstart + support_length / 2))); if (pos.ptr() && rot.ptr()) { Rotation3D rot3D(RotationZYX(rot.z(0), rot.y(0), rot.x(0))); - Position pos3D(pos.x(0), pos.y(0), pos.z(0)); + Position pos3D(pos.x(0), pos.y(0), pos.z(0)); tr = Transform3D(rot3D, pos3D); } else if (pos.ptr()) { tr = Transform3D(Rotation3D(), Position(pos.x(0), pos.y(0), pos.z(0))); @@ -110,7 +110,7 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi tr = Transform3D(rot3D, Position()); } Material support_mat = description.material(x_support.materialStr()); - Volume support_vol(support_name, support_solid, support_mat); + Volume support_vol(support_name, support_solid, support_mat); support_vol.setVisAttributes(description.visAttributes(support_vis)); pv = assembly.placeVolume(support_vol, tr); // pv = assembly.placeVolume(support_vol, Position(0, 0, support_zstart + support_length / 2)); @@ -119,7 +119,7 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi // loop over the modules for (xml_coll_t mi(x_det, _U(module)); mi; ++mi) { xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); + string m_nam = x_mod.nameStr(); if (volumes.find(m_nam) != volumes.end()) { printout(ERROR, "BarrelTrackerWithFrame", @@ -127,8 +127,8 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi throw runtime_error("Logics error in building modules."); } - int ncomponents = 0; - int sensor_number = 1; + int ncomponents = 0; + int sensor_number = 1; double total_thickness = 0; // Compute module total thickness from components @@ -154,33 +154,38 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi double frame_width2 = 2.0 * frame_height2 / tanth; Trd1 moduleframe_part1(frame_width / 2, 0.001 * mm, m_frame.length() / 2, frame_height / 2); - Trd1 moduleframe_part2(frame_width2 / 2, 0.001 * mm, m_frame.length() / 2 + 0.01 * mm, frame_height2 / 2); + Trd1 moduleframe_part2(frame_width2 / 2, 0.001 * mm, m_frame.length() / 2 + 0.01 * mm, + frame_height2 / 2); - SubtractionSolid moduleframe(moduleframe_part1, moduleframe_part2, Position(0.0, frame_thickness, 0.0)); - Volume v_moduleframe(m_nam + "_vol", moduleframe, description.material(m_frame.materialStr())); + SubtractionSolid moduleframe(moduleframe_part1, moduleframe_part2, + Position(0.0, frame_thickness, 0.0)); + Volume v_moduleframe(m_nam + "_vol", moduleframe, + description.material(m_frame.materialStr())); v_moduleframe.setVisAttributes(description, m_frame.visStr()); - m_vol.placeVolume(v_moduleframe, Position(0.0, 0.0, frame_height / 2 + total_thickness / 2.0)); + m_vol.placeVolume(v_moduleframe, + Position(0.0, 0.0, frame_height / 2 + total_thickness / 2.0)); } double thickness_so_far = 0.0; double thickness_sum = -total_thickness / 2.0; for (xml_coll_t mci(x_mod, _U(module_component)); mci; ++mci, ++ncomponents) { - xml_comp_t x_comp = mci; - xml_comp_t x_pos = x_comp.position(false); - xml_comp_t x_rot = x_comp.rotation(false); - const string c_nam = _toString(ncomponents, "component%d"); - Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); - Volume c_vol(c_nam, c_box, description.material(x_comp.materialStr())); + xml_comp_t x_comp = mci; + xml_comp_t x_pos = x_comp.position(false); + xml_comp_t x_rot = x_comp.rotation(false); + const string c_nam = _toString(ncomponents, "component%d"); + Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); + Volume c_vol(c_nam, c_box, description.material(x_comp.materialStr())); // Utility variable for the relative z-offset based off the previous components const double zoff = thickness_sum + x_comp.thickness() / 2.0; if (x_pos && x_rot) { - Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); + Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0)); pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); } else if (x_rot) { Position c_pos(0, 0, zoff); - pv = m_vol.placeVolume(c_vol, Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); + pv = m_vol.placeVolume(c_vol, + Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); } else if (x_pos) { pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff)); } else { @@ -233,18 +238,18 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi xml_comp_t x_barrel = x_layer.child(_U(barrel_envelope)); xml_comp_t x_layout = x_layer.child(_U(rphi_layout)); xml_comp_t z_layout = x_layer.child(_U(z_layout)); // Get the <z_layout> element. - int lay_id = x_layer.id(); - string m_nam = x_layer.moduleStr(); - string lay_nam = det_name + _toString(x_layer.id(), "_layer%d"); - Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2.0); - Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. - Position lay_pos(0, 0, getAttrOrDefault(x_barrel, _U(z0), 0.)); + int lay_id = x_layer.id(); + string m_nam = x_layer.moduleStr(); + string lay_nam = det_name + _toString(x_layer.id(), "_layer%d"); + Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2.0); + Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. + Position lay_pos(0, 0, getAttrOrDefault(x_barrel, _U(z0), 0.)); lay_vol.setVisAttributes(description.visAttributes(x_layer.visStr())); double phi0 = x_layout.phi0(); // Starting phi of first module. double phi_tilt = x_layout.phi_tilt(); // Phi tilt of a module. double rc = x_layout.rc(); // Radius of the module center. - int nphi = x_layout.nphi(); // Number of modules in phi. + int nphi = x_layout.nphi(); // Number of modules in phi. double rphi_dr = x_layout.dr(); // The delta radius of every other module. double phi_incr = (M_PI * 2) / nphi; // Phi increment for one module. double phic = phi0; // Phi of the module center. @@ -252,19 +257,19 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi double nz = z_layout.nz(); // Number of modules to place in z. double z_dr = z_layout.dr(); // Radial displacement parameter, of every other module. - Volume module_env = volumes[m_nam]; - DetElement lay_elt(sdet, lay_nam, lay_id); + Volume module_env = volumes[m_nam]; + DetElement lay_elt(sdet, lay_nam, lay_id); Placements& sensVols = sensitives[m_nam]; // the local coordinate systems of modules in dd4hep and acts differ // see http://acts.web.cern.ch/ACTS/latest/doc/group__DD4hepPlugins.html - auto &layerParams = - DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( - lay_elt); + auto& layerParams = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(lay_elt); for (xml_coll_t lmat(x_layer, _Unicode(layer_material)); lmat; ++lmat) { xml_comp_t x_layer_material = lmat; - DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, "layer_material"); + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, + "layer_material"); } // Z increment for module placement along Z axis. @@ -273,7 +278,7 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi double z_incr = nz > 1 ? (2.0 * z0) / (nz - 1) : 0.0; // Starting z for module placement along Z axis. double module_z = -z0; - int module = 1; + int module = 1; // Loop over the number of modules in phi. for (int ii = 0; ii < nphi; ii++) { @@ -284,20 +289,22 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi // Loop over the number of modules in z. for (int j = 0; j < nz; j++) { - string module_name = _toString(module, "module%d"); + string module_name = _toString(module, "module%d"); DetElement mod_elt(lay_elt, module_name, module); - Transform3D tr(RotationZYX(0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), Position(x, y, module_z)); + Transform3D tr(RotationZYX(0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), + Position(x, y, module_z)); pv = lay_vol.placeVolume(module_env, tr); pv.addPhysVolID("module", module); mod_elt.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_de(mod_elt, std::string("de_") + sens_pv.volume().name(), module); + DetElement comp_de(mod_elt, std::string("de_") + sens_pv.volume().name(), module); comp_de.setPlacement(sens_pv); - auto &comp_de_params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_de); + auto& comp_de_params = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_de); comp_de_params.set<string>("axis_definitions", "XYZ"); // comp_de.setAttributes(description, sens_pv.volume(), x_layer.regionStr(), x_layer.limitsStr(), // xml_det_t(xmleles[m_nam]).visStr()); @@ -325,7 +332,8 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi // Create the PhysicalVolume for the layer. pv = assembly.placeVolume(lay_vol, lay_pos); // Place layer in mother pv.addPhysVolID("layer", lay_id); // Set the layer ID. - lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr()); + lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), + x_layer.visStr()); lay_elt.setPlacement(pv); } sdet.setAttributes(description, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr()); diff --git a/src/BeamPipeChain_geo.cpp b/src/BeamPipeChain_geo.cpp index 61021384f..8da51d510 100644 --- a/src/BeamPipeChain_geo.cpp +++ b/src/BeamPipeChain_geo.cpp @@ -18,18 +18,17 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /* sens */) { using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Al = description.material("Aluminum"); - Material m_Vacuum = description.material("Vacuum"); - string vis_name = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "BeamPipeVis"); - double thickness = getAttrOrDefault<double>(x_det, _Unicode(wall_thickness), 0); + Assembly assembly(det_name + "_assembly"); + Material m_Al = description.material("Aluminum"); + Material m_Vacuum = description.material("Vacuum"); + string vis_name = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "BeamPipeVis"); + double thickness = getAttrOrDefault<double>(x_det, _Unicode(wall_thickness), 0); vector<string> names; vector<double> xCenters; @@ -40,67 +39,82 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / vector<double> rOuters2; // Grab info for beamline magnets - for( xml_coll_t pipe_coll(x_det, _Unicode(pipe)); pipe_coll; pipe_coll++ ) { // pipes + for (xml_coll_t pipe_coll(x_det, _Unicode(pipe)); pipe_coll; pipe_coll++) { // pipes - xml_comp_t pipe( pipe_coll ); + xml_comp_t pipe(pipe_coll); - names.push_back( getAttrOrDefault<string>(pipe, _Unicode(name), "") ); + names.push_back(getAttrOrDefault<string>(pipe, _Unicode(name), "")); // Vectors momentarily filled with zeros for pipes in between magnets - xCenters.push_back( getAttrOrDefault<double>(pipe, _Unicode(xcenter), 0) ); - zCenters.push_back( getAttrOrDefault<double>(pipe, _Unicode(zcenter), 0) ); - lengths.push_back( getAttrOrDefault<double>(pipe, _Unicode(length), 0) ); - thetas.push_back( getAttrOrDefault<double>(pipe, _Unicode(theta), 0) ); - rOuters1.push_back( getAttrOrDefault<double>(pipe, _Unicode(rout1), 0) ); - rOuters2.push_back( getAttrOrDefault<double>(pipe, _Unicode(rout2), 0) ); + xCenters.push_back(getAttrOrDefault<double>(pipe, _Unicode(xcenter), 0)); + zCenters.push_back(getAttrOrDefault<double>(pipe, _Unicode(zcenter), 0)); + lengths.push_back(getAttrOrDefault<double>(pipe, _Unicode(length), 0)); + thetas.push_back(getAttrOrDefault<double>(pipe, _Unicode(theta), 0)); + rOuters1.push_back(getAttrOrDefault<double>(pipe, _Unicode(rout1), 0)); + rOuters2.push_back(getAttrOrDefault<double>(pipe, _Unicode(rout2), 0)); } // Calculate parameters for connecting pipes in between magnets - for( uint pipeN = 0; pipeN < names.size(); pipeN++ ) { - - if( lengths[pipeN] > 0 ) { continue; } // pipe parameters already set to nonzero values - if( pipeN == 0 ) { continue; } // can't create pipe for an empty starting slot - if( (pipeN+1) == names.size() ) { continue; } // can't create pipe for an empty end slot - - double x = ( xCenters[pipeN-1] - lengths[pipeN-1]/2.*sin(thetas[pipeN-1]) + xCenters[pipeN+1] + lengths[pipeN+1]/2.*sin(thetas[pipeN+1]) ) / 2.; - double z = ( zCenters[pipeN-1] - lengths[pipeN-1]/2.*cos(thetas[pipeN-1]) + zCenters[pipeN+1] + lengths[pipeN+1]/2.*cos(thetas[pipeN+1]) ) / 2.; - double deltaX = (xCenters[pipeN-1] - lengths[pipeN-1]/2.*sin(thetas[pipeN-1])) - (xCenters[pipeN+1] + lengths[pipeN+1]/2.*sin(thetas[pipeN+1])); - double deltaZ = (zCenters[pipeN-1] - lengths[pipeN-1]/2.*cos(thetas[pipeN-1])) - (zCenters[pipeN+1] + lengths[pipeN+1]/2.*cos(thetas[pipeN+1])); - double l = sqrt( pow(deltaX, 2) + pow(deltaZ, 2) ); - double theta = atan( deltaX / deltaZ ); + for (uint pipeN = 0; pipeN < names.size(); pipeN++) { + + if (lengths[pipeN] > 0) { + continue; + } // pipe parameters already set to nonzero values + if (pipeN == 0) { + continue; + } // can't create pipe for an empty starting slot + if ((pipeN + 1) == names.size()) { + continue; + } // can't create pipe for an empty end slot + + double x = (xCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * sin(thetas[pipeN - 1]) + + xCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * sin(thetas[pipeN + 1])) / + 2.; + double z = (zCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * cos(thetas[pipeN - 1]) + + zCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * cos(thetas[pipeN + 1])) / + 2.; + double deltaX = (xCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * sin(thetas[pipeN - 1])) - + (xCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * sin(thetas[pipeN + 1])); + double deltaZ = (zCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * cos(thetas[pipeN - 1])) - + (zCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * cos(thetas[pipeN + 1])); + double l = sqrt(pow(deltaX, 2) + pow(deltaZ, 2)); + double theta = atan(deltaX / deltaZ); // Small air gap between connecting and magnet beam pipes to avoid G4 overlap errors - if( (theta != thetas[pipeN-1]) || (theta != thetas[pipeN+1]) ) { + if ((theta != thetas[pipeN - 1]) || (theta != thetas[pipeN + 1])) { l -= 0.5; } xCenters[pipeN] = x; zCenters[pipeN] = z; - lengths[pipeN] = l; - thetas[pipeN] = theta; - rOuters1[pipeN] = rOuters2[pipeN-1]; - rOuters2[pipeN] = rOuters1[pipeN+1]; + lengths[pipeN] = l; + thetas[pipeN] = theta; + rOuters1[pipeN] = rOuters2[pipeN - 1]; + rOuters2[pipeN] = rOuters1[pipeN + 1]; } // Add all pipes to the assembly - for( uint pipeN = 0; pipeN < xCenters.size(); pipeN++ ) { + for (uint pipeN = 0; pipeN < xCenters.size(); pipeN++) { - ConeSegment s_tube( lengths[pipeN] / 2.0, rOuters2[pipeN] - thickness, rOuters2[pipeN], rOuters1[pipeN] - thickness, rOuters1[pipeN] ); - ConeSegment s_vacuum( lengths[pipeN] / 2.0, 0, rOuters2[pipeN] - thickness, 0, rOuters1[pipeN] - thickness ); + ConeSegment s_tube(lengths[pipeN] / 2.0, rOuters2[pipeN] - thickness, rOuters2[pipeN], + rOuters1[pipeN] - thickness, rOuters1[pipeN]); + ConeSegment s_vacuum(lengths[pipeN] / 2.0, 0, rOuters2[pipeN] - thickness, 0, + rOuters1[pipeN] - thickness); Volume v_tube("v_tube_" + names[pipeN], s_tube, m_Al); Volume v_vacuum("v_vacuum_" + names[pipeN], s_vacuum, m_Vacuum); - v_tube.setVisAttributes(description.visAttributes( vis_name ) ); - - assembly.placeVolume(v_tube, Transform3D( RotationY(thetas[pipeN]), Position(xCenters[pipeN], 0, zCenters[pipeN]))); - assembly.placeVolume(v_vacuum, Transform3D( RotationY(thetas[pipeN]), Position(xCenters[pipeN], 0, zCenters[pipeN]))); + v_tube.setVisAttributes(description.visAttributes(vis_name)); + assembly.placeVolume(v_tube, Transform3D(RotationY(thetas[pipeN]), + Position(xCenters[pipeN], 0, zCenters[pipeN]))); + assembly.placeVolume(v_vacuum, Transform3D(RotationY(thetas[pipeN]), + Position(xCenters[pipeN], 0, zCenters[pipeN]))); } // Final placement auto pv_assembly = - description.pickMotherVolume(sdet).placeVolume( assembly, Position(0.0, 0.0, 0.0)); + description.pickMotherVolume(sdet).placeVolume(assembly, Position(0.0, 0.0, 0.0)); sdet.setPlacement(pv_assembly); diff --git a/src/CompositeTracker_geo.cpp b/src/CompositeTracker_geo.cpp index a9d8d75ab..6e9dafe54 100644 --- a/src/CompositeTracker_geo.cpp +++ b/src/CompositeTracker_geo.cpp @@ -18,26 +18,24 @@ using namespace dd4hep; using namespace dd4hep::detail; -static Ref_t create_element(Detector& description, xml_h e, Ref_t) -{ - xml_det_t x_det(e); +static Ref_t create_element(Detector& description, xml_h e, Ref_t) { + xml_det_t x_det(e); const std::string det_name = x_det.nameStr(); - DetElement sdet(det_name, x_det.id()); - Volume vol; - Position pos; + DetElement sdet(det_name, x_det.id()); + Volume vol; + Position pos; const bool usePos = x_det.hasChild(_U(position)); // Set detector type flag dd4hep::xml::setDetectorTypeFlag(x_det, sdet); - auto ¶ms = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( - sdet); + auto& params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(sdet); // Add the volume boundary material if configured for (xml_coll_t bmat(x_det, _Unicode(boundary_material)); bmat; ++bmat) { xml_comp_t x_boundary_material = bmat; DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, - "boundary_material"); + "boundary_material"); } if (usePos) { @@ -46,7 +44,7 @@ static Ref_t create_element(Detector& description, xml_h e, Ref_t) vol = Assembly(det_name); vol.setAttributes(description, x_det.regionStr(), x_det.limitsStr(), x_det.visStr()); - Volume mother = description.pickMotherVolume(sdet); + Volume mother = description.pickMotherVolume(sdet); PlacedVolume pv; if (usePos) { pv = mother.placeVolume(vol, pos); @@ -55,8 +53,8 @@ static Ref_t create_element(Detector& description, xml_h e, Ref_t) } sdet.setPlacement(pv); for (xml_coll_t c(x_det, _U(composite)); c; ++c) { - xml_dim_t component = c; - const std::string nam = component.nameStr(); + xml_dim_t component = c; + const std::string nam = component.nameStr(); description.declareParent(nam, sdet); } return sdet; diff --git a/src/CylindricalDipoleMagnet_geo.cpp b/src/CylindricalDipoleMagnet_geo.cpp index b8ea34dfc..33f931884 100644 --- a/src/CylindricalDipoleMagnet_geo.cpp +++ b/src/CylindricalDipoleMagnet_geo.cpp @@ -14,43 +14,41 @@ using namespace dd4hep; using namespace dd4hep::rec; using namespace ROOT::Math; -static Ref_t build_magnet(Detector& dtor, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t build_magnet(Detector& dtor, xml_h e, SensitiveDetector /* sens */) { xml_det_t x_det = e; - int det_id = x_det.id(); - string det_name = x_det.nameStr(); + int det_id = x_det.id(); + string det_name = x_det.nameStr(); xml_dim_t pos = x_det.child(_U(placement)); - double pos_x = pos.x(); - double pos_y = pos.y(); - double pos_z = pos.z(); - double pos_theta = pos.attr<double>(_U(theta)); + double pos_x = pos.x(); + double pos_y = pos.y(); + double pos_z = pos.z(); + double pos_theta = pos.attr<double>(_U(theta)); xml_dim_t dims = x_det.dimensions(); - double dim_r = dims.r(); - double dim_z = dims.z(); + double dim_r = dims.r(); + double dim_z = dims.z(); xml_dim_t apperture = x_det.child(_Unicode(apperture)); - double app_r = apperture.r(); - Material iron = dtor.material("Iron"); - + double app_r = apperture.r(); + Material iron = dtor.material("Iron"); DetElement sdet(det_name, det_id); - Assembly assembly(det_name + "_assembly"); + Assembly assembly(det_name + "_assembly"); const string module_name = "Quad_magnet"; - const string yoke_vis = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "FFMagnetVis"); + const string yoke_vis = + dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "FFMagnetVis"); sdet.setAttributes(dtor, assembly, x_det.regionStr(), x_det.limitsStr(), yoke_vis); // -- yoke - Tube yoke_tube(app_r, dim_r, 0.5 * dim_z); + Tube yoke_tube(app_r, dim_r, 0.5 * dim_z); Volume yoke_vol("yoke_vol", yoke_tube, iron); - auto yoke_pv = assembly.placeVolume(yoke_vol); + auto yoke_pv = assembly.placeVolume(yoke_vol); yoke_pv.addPhysVolID("element", 1); DetElement yoke_de(sdet, "yoke_de", 1); yoke_de.setPlacement(yoke_pv); yoke_de.setAttributes(dtor, yoke_vol, x_det.regionStr(), x_det.limitsStr(), yoke_vis); - // -- finishing steps auto final_pos = Transform3D(Translation3D(pos_x, pos_y, pos_z) * RotationY(pos_theta)); auto pv = dtor.pickMotherVolume(sdet).placeVolume(assembly, final_pos); diff --git a/src/CylindricalMagnetChain_geo.cpp b/src/CylindricalMagnetChain_geo.cpp index 57395b79a..607a575f9 100644 --- a/src/CylindricalMagnetChain_geo.cpp +++ b/src/CylindricalMagnetChain_geo.cpp @@ -20,41 +20,39 @@ using namespace dd4hep; using namespace dd4hep::rec; using namespace ROOT::Math; -static Ref_t create_magnet(Detector& description, xml_h e, SensitiveDetector /* sens */) -{ - xml_det_t x_det = e; - string det_name = x_det.nameStr(); +static Ref_t create_magnet(Detector& description, xml_h e, SensitiveDetector /* sens */) { + xml_det_t x_det = e; + string det_name = x_det.nameStr(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Iron = description.material("Iron"); - string vis_name = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "FFMagnetVis"); + Assembly assembly(det_name + "_assembly"); + Material m_Iron = description.material("Iron"); + string vis_name = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(vis), "FFMagnetVis"); + for (xml_coll_t magnet_coll(x_det, _Unicode(magnet)); magnet_coll; magnet_coll++) { // magnets - for( xml_coll_t magnet_coll(x_det, _Unicode(magnet)); magnet_coll; magnet_coll++ ) { // magnets + xml_comp_t magnet(magnet_coll); - xml_comp_t magnet( magnet_coll ); - - string name = getAttrOrDefault<string>(magnet, _Unicode(name), ""); - double x = getAttrOrDefault<double>(magnet, _Unicode(x), 0); - double y = getAttrOrDefault<double>(magnet, _Unicode(y), 0); - double z = getAttrOrDefault<double>(magnet, _Unicode(z), 0); - double theta = getAttrOrDefault<double>(magnet, _Unicode(theta), 0); + string name = getAttrOrDefault<string>(magnet, _Unicode(name), ""); + double x = getAttrOrDefault<double>(magnet, _Unicode(x), 0); + double y = getAttrOrDefault<double>(magnet, _Unicode(y), 0); + double z = getAttrOrDefault<double>(magnet, _Unicode(z), 0); + double theta = getAttrOrDefault<double>(magnet, _Unicode(theta), 0); double length = getAttrOrDefault<double>(magnet, _Unicode(length), 0); - double rin = getAttrOrDefault<double>(magnet, _Unicode(rin), 0); - double rout = getAttrOrDefault<double>(magnet, _Unicode(rout), 0); + double rin = getAttrOrDefault<double>(magnet, _Unicode(rin), 0); + double rout = getAttrOrDefault<double>(magnet, _Unicode(rout), 0); // -- yoke - Tube yoke_tube( rin, rout, 0.5 * length ); - Volume v_yoke( "v_yoke_" + name, yoke_tube, m_Iron ); + Tube yoke_tube(rin, rout, 0.5 * length); + Volume v_yoke("v_yoke_" + name, yoke_tube, m_Iron); - v_yoke.setVisAttributes(description.visAttributes( vis_name ) ); + v_yoke.setVisAttributes(description.visAttributes(vis_name)); - assembly.placeVolume(v_yoke, Transform3D( RotationY(theta), Position(x, y, z))); + assembly.placeVolume(v_yoke, Transform3D(RotationY(theta), Position(x, y, z))); } // Final placement auto pv_assembly = - description.pickMotherVolume(sdet).placeVolume( assembly, Position(0.0, 0.0, 0.0)); + description.pickMotherVolume(sdet).placeVolume(assembly, Position(0.0, 0.0, 0.0)); sdet.setPlacement(pv_assembly); diff --git a/src/DD4hepDetectorHelper.h b/src/DD4hepDetectorHelper.h index 0499c38b8..843c57619 100644 --- a/src/DD4hepDetectorHelper.h +++ b/src/DD4hepDetectorHelper.h @@ -10,11 +10,9 @@ #include "DD4hep/DetFactoryHelper.h" - namespace DD4hepDetectorHelper { -template <typename T> -T& ensureExtension(dd4hep::DetElement& elt) { +template <typename T> T& ensureExtension(dd4hep::DetElement& elt) { T* ext = elt.extension<T>(false); if (ext == nullptr) { ext = new T(); @@ -39,11 +37,11 @@ inline void xmlToProtoSurfaceMaterial(const xml_comp_t& x_material, const auto n = std::distance(binTokens.begin(), binTokens.end()); if (n == 2) { // Fill the bins - auto bin = binTokens.begin(); + auto bin = binTokens.begin(); std::string bin0 = *(bin); std::string bin1 = *(++bin); - size_t nBins0 = x_material.attr<int>("bins0"); - size_t nBins1 = x_material.attr<int>("bins1"); + size_t nBins0 = x_material.attr<int>("bins0"); + size_t nBins1 = x_material.attr<int>("bins1"); // Add the material tags std::string btmSurface = baseTag + "_"s + mSurface; params.set<bool>(btmSurface, true); @@ -52,4 +50,4 @@ inline void xmlToProtoSurfaceMaterial(const xml_comp_t& x_material, } } -} // namespace DD4hepDetectorHelper +} // namespace DD4hepDetectorHelper diff --git a/src/DD4hep_GdmlDetector.cpp b/src/DD4hep_GdmlDetector.cpp index 707377b5e..be33c147d 100644 --- a/src/DD4hep_GdmlDetector.cpp +++ b/src/DD4hep_GdmlDetector.cpp @@ -39,40 +39,39 @@ using namespace dd4hep; #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 13, 0) /// Factory to import subdetectors from GDML fragment -static Ref_t create_detector(Detector& description, xml_h e, Ref_t /* sens_det */) -{ +static Ref_t create_detector(Detector& description, xml_h e, Ref_t /* sens_det */) { using namespace dd4hep::detail; - xml_det_t x_det = e; - int id = x_det.hasAttr(_U(id)) ? x_det.id() : 0; - xml_dim_t x_pos(x_det.child(_U(position), false)); - xml_dim_t x_rot(x_det.child(_U(rotation), false)); - xml_dim_t x_gdml(x_det.child(_U(gdmlFile))); - xml_dim_t x_par(x_det.child(_U(parent))); - string name = x_det.nameStr(); - string par_nam = x_par.nameStr(); - string gdml = x_gdml.attr<string>(_U(ref)); - string gdml_physvol = dd4hep::getAttrOrDefault<string>(x_gdml, _Unicode(physvol), ""); - DetElement det_parent = description.detector(par_nam); + xml_det_t x_det = e; + int id = x_det.hasAttr(_U(id)) ? x_det.id() : 0; + xml_dim_t x_pos(x_det.child(_U(position), false)); + xml_dim_t x_rot(x_det.child(_U(rotation), false)); + xml_dim_t x_gdml(x_det.child(_U(gdmlFile))); + xml_dim_t x_par(x_det.child(_U(parent))); + string name = x_det.nameStr(); + string par_nam = x_par.nameStr(); + string gdml = x_gdml.attr<string>(_U(ref)); + string gdml_physvol = dd4hep::getAttrOrDefault<string>(x_gdml, _Unicode(physvol), ""); + DetElement det_parent = description.detector(par_nam); TGDMLParse parser; if (!gdml.empty() && gdml[0] == '/') { TUri uri(gdml.c_str()); gdml = uri.GetRelativePart(); } else { string path = xml::DocumentHandler::system_path(e, gdml); - TUri uri(path.c_str()); + TUri uri(path.c_str()); gdml = uri.GetRelativePart(); } if (!det_parent.isValid()) { except(name, "+++ Cannot access detector parent: %s", par_nam.c_str()); } DetElement sdet(name, id); - Volume volume = parser.GDMLReadFile(gdml.c_str()); + Volume volume = parser.GDMLReadFile(gdml.c_str()); if (!volume.isValid()) { except("ROOTGDMLParse", "+++ Failed to parse GDML file:%s", gdml.c_str()); } volume.import(); // We require the extensions in dd4hep. printout(INFO, "ROOTGDMLParse", "+++ Attach GDML volume %s", volume.name()); - Volume mother = det_parent.volume(); + Volume mother = det_parent.volume(); PlacedVolume pv; if (!gdml_physvol.empty()) { @@ -81,17 +80,18 @@ static Ref_t create_detector(Detector& description, xml_h e, Ref_t /* sens_det * printout(ERROR, "ROOTGDMLParse", "+++ Invalid gdml placed volume %s", gdml_physvol.c_str()); printout(ERROR, "ROOTGDMLParse", "+++ Valid top-level nodes are:"); volume->PrintNodes(); - except("ROOTGDMLParse", "+++ Failed to parse GDML file:%s for node:%s", gdml.c_str(), gdml_physvol.c_str()); + except("ROOTGDMLParse", "+++ Failed to parse GDML file:%s for node:%s", gdml.c_str(), + gdml_physvol.c_str()); } volume = node.volume(); } if (x_pos && x_rot) { - Rotation3D rot(RotationZYX(x_rot.z(), x_rot.y(), x_rot.x())); + Rotation3D rot(RotationZYX(x_rot.z(), x_rot.y(), x_rot.x())); Transform3D transform(rot, Position(x_pos.x(), x_pos.y(), x_pos.z())); pv = mother.placeVolume(volume, transform); } else if (x_rot) { - Rotation3D rot(RotationZYX(x_rot.z(), x_rot.y(), x_rot.x())); + Rotation3D rot(RotationZYX(x_rot.z(), x_rot.y(), x_rot.x())); Transform3D transform(rot, Position(0, 0, 0)); pv = mother.placeVolume(volume, transform); } else if (x_pos) { diff --git a/src/DIRC_geo.cpp b/src/DIRC_geo.cpp index d65bd9994..71af13add 100644 --- a/src/DIRC_geo.cpp +++ b/src/DIRC_geo.cpp @@ -15,23 +15,23 @@ using namespace std; using namespace dd4hep; -static dd4hep::Trap MakeTrap(const std::string& pName, double pZ, double pY, double pX, double pLTX); +static dd4hep::Trap MakeTrap(const std::string& pName, double pZ, double pY, double pX, + double pLTX); -static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) -{ +static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) { xml_det_t xml_det = e; // Detector element - string det_name = xml_det.nameStr(); - int det_id = xml_det.id(); + string det_name = xml_det.nameStr(); + int det_id = xml_det.id(); DetElement det(det_name, det_id); // Detector dimension, position, rotation xml_dim_t dirc_dim = xml_det.dimensions(); xml_dim_t dirc_pos = xml_det.position(); - double det_rmin = dirc_dim.rmin(); - double det_rmax = dirc_dim.rmax(); - double det_ravg = (det_rmin + det_rmax) / 2; + double det_rmin = dirc_dim.rmin(); + double det_rmax = dirc_dim.rmax(); + double det_ravg = (det_rmin + det_rmax) / 2; // Detector type sens.setType("tracker"); @@ -40,7 +40,8 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) Assembly det_volume("DIRC"); det_volume.setVisAttributes(desc.visAttributes(xml_det.visStr())); Transform3D det_tr(RotationY(0), Position(0.0, 0.0, dirc_pos.z())); - det.setPlacement(desc.pickMotherVolume(det).placeVolume(det_volume, det_tr).addPhysVolID("system", det_id)); + det.setPlacement( + desc.pickMotherVolume(det).placeVolume(det_volume, det_tr).addPhysVolID("system", det_id)); // Construct module xml_comp_t xml_module = xml_det.child(_U(module)); @@ -49,19 +50,19 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) dirc_module.setVisAttributes(desc.visAttributes(xml_module.visStr())); // Bar - xml_comp_t xml_bar = xml_module.child(_Unicode(bar)); - double bar_height = xml_bar.height(); - double bar_width = xml_bar.width(); - double bar_length = xml_bar.length(); - Box bar_box("bar_box", bar_height / 2, bar_width / 2, bar_length / 2); - Volume bar_vol("bar_vol", bar_box, desc.material(xml_bar.materialStr())); + xml_comp_t xml_bar = xml_module.child(_Unicode(bar)); + double bar_height = xml_bar.height(); + double bar_width = xml_bar.width(); + double bar_length = xml_bar.length(); + Box bar_box("bar_box", bar_height / 2, bar_width / 2, bar_length / 2); + Volume bar_vol("bar_vol", bar_box, desc.material(xml_bar.materialStr())); bar_vol.setVisAttributes(desc.visAttributes(xml_bar.visStr())); // Glue - xml_comp_t xml_glue = xml_module.child(_Unicode(glue)); - double glue_thickness = xml_glue.thickness(); - Box glue_box("glue_box", bar_height / 2, bar_width / 2, glue_thickness / 2); - Volume glue_vol("glue_vol", glue_box, desc.material(xml_glue.materialStr())); + xml_comp_t xml_glue = xml_module.child(_Unicode(glue)); + double glue_thickness = xml_glue.thickness(); + Box glue_box("glue_box", bar_height / 2, bar_width / 2, glue_thickness / 2); + Volume glue_vol("glue_vol", glue_box, desc.material(xml_glue.materialStr())); glue_vol.setVisAttributes(desc.visAttributes(xml_glue.visStr())); auto bar_repeat_y = xml_bar.attr<int>(_Unicode(repeat_y)); @@ -71,31 +72,36 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) auto bar_assm_length = (bar_length + glue_thickness) * bar_repeat_z; // Mirror construction - xml_comp_t xml_mirror = xml_module.child(_Unicode(mirror)); - auto mirror_width = xml_mirror.width(); - auto mirror_height = xml_mirror.height(); - auto mirror_thickness = xml_mirror.thickness(); - Box mirror_box("mirror_box", mirror_height / 2, mirror_width / 2, mirror_thickness / 2); - Volume mirror_vol("mirror_vol", mirror_box, desc.material(xml_mirror.materialStr())); + xml_comp_t xml_mirror = xml_module.child(_Unicode(mirror)); + auto mirror_width = xml_mirror.width(); + auto mirror_height = xml_mirror.height(); + auto mirror_thickness = xml_mirror.thickness(); + Box mirror_box("mirror_box", mirror_height / 2, mirror_width / 2, mirror_thickness / 2); + Volume mirror_vol("mirror_vol", mirror_box, desc.material(xml_mirror.materialStr())); mirror_vol.setVisAttributes(desc.visAttributes(xml_mirror.visStr())); // Mirror optical surface - auto surfMgr = desc.surfaceManager(); - auto surf = surfMgr.opticalSurface("DIRC_MirrorOpticalSurface"); + auto surfMgr = desc.surfaceManager(); + auto surf = surfMgr.opticalSurface("DIRC_MirrorOpticalSurface"); SkinSurface skin(desc, det, Form("dirc_mirror_optical_surface"), surf, mirror_vol); skin.isValid(); // Envelope for bars + mirror - Box Envelope_box("Envelope_box", (mirror_height + 1*mm)/2, 5*(bar_width + 0.15*mm), 2*(bar_length + glue_thickness) + 0.5*mirror_thickness); + Box Envelope_box("Envelope_box", (mirror_height + 1 * mm) / 2, 5 * (bar_width + 0.15 * mm), + 2 * (bar_length + glue_thickness) + 0.5 * mirror_thickness); Volume Envelope_box_vol("Envelope_box_vol", Envelope_box, desc.material("AirOptical")); - dirc_module.placeVolume(Envelope_box_vol, Position(0, 0, 0.5*mirror_thickness)); + dirc_module.placeVolume(Envelope_box_vol, Position(0, 0, 0.5 * mirror_thickness)); for (int y_index = 0; y_index < bar_repeat_y; y_index++) { double y = 0.5 * bar_assm_width - 0.5 * bar_width - (bar_width + bar_gap) * y_index; for (int z_index = 0; z_index < bar_repeat_z; z_index++) { - double z = 0.5 * bar_assm_length - 0.5 * mirror_thickness - 0.5 * bar_length - (bar_length + glue_thickness) * z_index; - Envelope_box_vol.placeVolume(glue_vol, Position(0, y, z - 0.5 * (bar_length + glue_thickness))); - Envelope_box_vol.placeVolume(bar_vol, Position(0, y, z)).addPhysVolID("section", z_index).addPhysVolID("bar", y_index); + double z = 0.5 * bar_assm_length - 0.5 * mirror_thickness - 0.5 * bar_length - + (bar_length + glue_thickness) * z_index; + Envelope_box_vol.placeVolume(glue_vol, + Position(0, y, z - 0.5 * (bar_length + glue_thickness))); + Envelope_box_vol.placeVolume(bar_vol, Position(0, y, z)) + .addPhysVolID("section", z_index) + .addPhysVolID("bar", y_index); } } @@ -103,17 +109,17 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) Envelope_box_vol.placeVolume(mirror_vol, Position(0, 0, 0.5 * bar_assm_length)); // Prism variables - xml_comp_t xml_prism = xml_module.child(_Unicode(prism)); - double prism_angle = xml_prism.angle(); - double prism_width = xml_prism.width(); - double prism_length = xml_prism.length(); - double prism_short_edge = getAttrOrDefault(xml_prism, _Unicode(short_edge), 50 * mm); - double prism_long_edge = prism_short_edge + prism_length * tan(prism_angle); + xml_comp_t xml_prism = xml_module.child(_Unicode(prism)); + double prism_angle = xml_prism.angle(); + double prism_width = xml_prism.width(); + double prism_length = xml_prism.length(); + double prism_short_edge = getAttrOrDefault(xml_prism, _Unicode(short_edge), 50 * mm); + double prism_long_edge = prism_short_edge + prism_length * tan(prism_angle); // Lens variables - xml_comp_t xml_lens = xml_module.child(_Unicode(lens)); - double lens_shift = getAttrOrDefault(xml_lens, _Unicode(shift), 0 * mm); - double lens_width = getAttrOrDefault(xml_lens, _Unicode(width), 35 * mm); + xml_comp_t xml_lens = xml_module.child(_Unicode(lens)); + double lens_shift = getAttrOrDefault(xml_lens, _Unicode(shift), 0 * mm); + double lens_width = getAttrOrDefault(xml_lens, _Unicode(width), 35 * mm); double lens_thickness = getAttrOrDefault(xml_lens, _Unicode(thickness), 12 * mm); double lens_r1 = getAttrOrDefault(xml_lens, _Unicode(r1), 62 * mm); double lens_r2 = getAttrOrDefault(xml_lens, _Unicode(r2), 36 * mm); @@ -125,10 +131,13 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) double lens_min_thickness = 2.0 * mm; - double ztrans1 = -lens_thickness / 2. - sqrt(lens_r1 * lens_r1 - lens_radius * lens_radius) + lens_min_thickness; - double ztrans2 = -lens_thickness / 2. - sqrt(lens_r2 * lens_r2 - lens_radius * lens_radius) + lens_min_thickness * 2; + double ztrans1 = -lens_thickness / 2. - sqrt(lens_r1 * lens_r1 - lens_radius * lens_radius) + + lens_min_thickness; + double ztrans2 = -lens_thickness / 2. - sqrt(lens_r2 * lens_r2 - lens_radius * lens_radius) + + lens_min_thickness * 2; - Box lens_symm_box("lens_symm_box", 0.5 * prism_short_edge, 0.5 * lens_width, 0.5 * lens_thickness); + Box lens_symm_box("lens_symm_box", 0.5 * prism_short_edge, 0.5 * lens_width, + 0.5 * lens_thickness); Volume Envelope_lens_vol("Envelope_lens_vol", lens_symm_box, desc.material("AirOptical")); Tube lens_symm_tube(0, lens_radius, 0.5 * lens_thickness); @@ -136,15 +145,21 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) Sphere lens_sphere1(0, lens_r1); Sphere lens_sphere2(0, lens_r2); - IntersectionSolid lens_box("lens_box", lens_symm_box, lens_symm_box, Position(0, 0, -lens_min_thickness * 2)); - IntersectionSolid lens_tube("lens_tube", lens_symm_tube, lens_symm_box, Position(0, 0, lens_min_thickness * 2)); - UnionSolid lens_box_tube("lens_box_tube", lens_box, lens_tube); + IntersectionSolid lens_box("lens_box", lens_symm_box, lens_symm_box, + Position(0, 0, -lens_min_thickness * 2)); + IntersectionSolid lens_tube("lens_tube", lens_symm_tube, lens_symm_box, + Position(0, 0, lens_min_thickness * 2)); + UnionSolid lens_box_tube("lens_box_tube", lens_box, lens_tube); - IntersectionSolid lens_layer1_solid("lens_layer1_solid", lens_box_tube, lens_sphere1, Position(0, 0, -ztrans1)); - SubtractionSolid lens_layer23_solid("lens_layer23_solid", lens_box_tube, lens_sphere1, Position(0, 0, -ztrans1)); + IntersectionSolid lens_layer1_solid("lens_layer1_solid", lens_box_tube, lens_sphere1, + Position(0, 0, -ztrans1)); + SubtractionSolid lens_layer23_solid("lens_layer23_solid", lens_box_tube, lens_sphere1, + Position(0, 0, -ztrans1)); - IntersectionSolid lens_layer2_solid("lens_layer2_solid", lens_layer23_solid, lens_sphere2, Position(0, 0, -ztrans2)); - SubtractionSolid lens_layer3_solid("lens_layer3_solid", lens_layer23_solid, lens_sphere2, Position(0, 0, -ztrans2)); + IntersectionSolid lens_layer2_solid("lens_layer2_solid", lens_layer23_solid, lens_sphere2, + Position(0, 0, -ztrans2)); + SubtractionSolid lens_layer3_solid("lens_layer3_solid", lens_layer23_solid, lens_sphere2, + Position(0, 0, -ztrans2)); Volume lens_layer1_vol("lens_layer1_vol", lens_layer1_solid, desc.material(xml_lens.attr<std::string>(_Unicode(material1)))); @@ -157,54 +172,57 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) lens_layer2_vol.setVisAttributes(desc.visAttributes(xml_lens.attr<std::string>(_Unicode(vis2)))); lens_layer3_vol.setVisAttributes(desc.visAttributes(xml_lens.attr<std::string>(_Unicode(vis3)))); - double lens_position_x = lens_shift; - double lens_position_z = -0.5 * (bar_assm_length + lens_thickness); + double lens_position_x = lens_shift; + double lens_position_z = -0.5 * (bar_assm_length + lens_thickness); - for(int y_index = 0; y_index < bar_repeat_y; y_index++) - { - double lens_position_y = y_index*lens_width - 0.5*(prism_width - lens_width); + for (int y_index = 0; y_index < bar_repeat_y; y_index++) { + double lens_position_y = y_index * lens_width - 0.5 * (prism_width - lens_width); - Position lens_position(lens_position_x, lens_position_y, lens_position_z); - dirc_module.placeVolume(Envelope_lens_vol, lens_position); - } + Position lens_position(lens_position_x, lens_position_y, lens_position_z); + dirc_module.placeVolume(Envelope_lens_vol, lens_position); + } Envelope_lens_vol.placeVolume(lens_layer1_vol); Envelope_lens_vol.placeVolume(lens_layer2_vol); Envelope_lens_vol.placeVolume(lens_layer3_vol); // Prism construction - Trap prism_trap = MakeTrap("prism_trap", prism_width, prism_length, prism_long_edge, prism_short_edge); + Trap prism_trap = + MakeTrap("prism_trap", prism_width, prism_length, prism_long_edge, prism_short_edge); Volume prism_vol("prism_vol", prism_trap, desc.material(xml_prism.materialStr())); prism_vol.setVisAttributes(desc.visAttributes(xml_prism.visStr())); - double prism_position_x = (prism_long_edge + prism_short_edge) / 4. - 0.5 * prism_short_edge + lens_shift; - double prism_position_z = -0.5 * (bar_assm_length + prism_length) - lens_thickness; + double prism_position_x = + (prism_long_edge + prism_short_edge) / 4. - 0.5 * prism_short_edge + lens_shift; + double prism_position_z = -0.5 * (bar_assm_length + prism_length) - lens_thickness; RotationX prism_rotation(M_PI / 2.); - Position prism_position(prism_position_x, 0, prism_position_z); + Position prism_position(prism_position_x, 0, prism_position_z); // Envelope for prism + mcp - double Envelope_trap_width = prism_width + 1*mm; - double Envelope_trap_length = prism_length + 1*mm; // mcp thickness is 1 mm - double Envelope_trap_short_edge = prism_short_edge + 1*mm; - double Envelope_trap_long_edge = Envelope_trap_short_edge + Envelope_trap_length * tan(prism_angle); + double Envelope_trap_width = prism_width + 1 * mm; + double Envelope_trap_length = prism_length + 1 * mm; // mcp thickness is 1 mm + double Envelope_trap_short_edge = prism_short_edge + 1 * mm; + double Envelope_trap_long_edge = + Envelope_trap_short_edge + Envelope_trap_length * tan(prism_angle); - Trap Envelope_trap = MakeTrap("Envelope_trap", Envelope_trap_width, Envelope_trap_length, Envelope_trap_long_edge, Envelope_trap_short_edge); - Position Envelope_trap_position(prism_position_x, 0, prism_position_z - 0.5*mm); + Trap Envelope_trap = MakeTrap("Envelope_trap", Envelope_trap_width, Envelope_trap_length, + Envelope_trap_long_edge, Envelope_trap_short_edge); + Position Envelope_trap_position(prism_position_x, 0, prism_position_z - 0.5 * mm); Volume Envelope_trap_vol("Envelope_trap_vol", Envelope_trap, desc.material("AirOptical")); dirc_module.placeVolume(Envelope_trap_vol, Transform3D(prism_rotation, Envelope_trap_position)); - Envelope_trap_vol.placeVolume(prism_vol, Position(0, 0.5*mm, 0)); + Envelope_trap_vol.placeVolume(prism_vol, Position(0, 0.5 * mm, 0)); // MCP variables - xml_comp_t xml_mcp = xml_module.child(_Unicode(mcp)); - double mcp_thickness = xml_mcp.thickness(); - double mcp_height = xml_mcp.height(); - double mcp_width = xml_mcp.width(); + xml_comp_t xml_mcp = xml_module.child(_Unicode(mcp)); + double mcp_thickness = xml_mcp.thickness(); + double mcp_height = xml_mcp.height(); + double mcp_width = xml_mcp.width(); // MCP construction - Box mcp_box("mcp_box", mcp_height / 2, mcp_width / 2, mcp_thickness / 2); + Box mcp_box("mcp_box", mcp_height / 2, mcp_width / 2, mcp_thickness / 2); Volume mcp_vol("mcp_vol", mcp_box, desc.material(xml_mcp.materialStr())); mcp_vol.setVisAttributes(desc.visAttributes(xml_mcp.visStr())).setSensitiveDetector(sens); @@ -215,8 +233,8 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) Envelope_trap_vol.placeVolume(mcp_vol, Transform3D(mcp_rotation, mcp_position)); // Place modules - const int module_repeat = xml_module.repeat(); - const double dphi = 2. * M_PI / module_repeat; + const int module_repeat = xml_module.repeat(); + const double dphi = 2. * M_PI / module_repeat; for (int i = 0; i < module_repeat; i++) { double phi = dphi * i; double x = det_ravg * cos(phi); @@ -232,18 +250,17 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) dirc_support.setVisAttributes(desc.visAttributes(xml_support.visStr())); // Rail - xml_comp_t xml_rail = xml_support.child(_Unicode(rail)); - xml_dim_t rail_pos = xml_rail.position(); - double rail_height = xml_rail.height(); - double rail_width2 = xml_rail.width(); - double rail_distance_to_chord2 = rail_width2/2 / tan(dphi/2); - double rail_distance_to_chord1 = rail_distance_to_chord2 - rail_height; - double rail_width1 = 2*rail_distance_to_chord1 * tan(dphi/2); - double rail_length = xml_rail.length(); - Trap rail_trap("rail_trap", rail_length / 2, 0, 0, - rail_height / 2, rail_width1 / 2, rail_width2 / 2, 0, - rail_height / 2, rail_width1 / 2, rail_width2 / 2, 0); - Volume rail_vol("rail_vol", rail_trap, desc.material(xml_rail.materialStr())); + xml_comp_t xml_rail = xml_support.child(_Unicode(rail)); + xml_dim_t rail_pos = xml_rail.position(); + double rail_height = xml_rail.height(); + double rail_width2 = xml_rail.width(); + double rail_distance_to_chord2 = rail_width2 / 2 / tan(dphi / 2); + double rail_distance_to_chord1 = rail_distance_to_chord2 - rail_height; + double rail_width1 = 2 * rail_distance_to_chord1 * tan(dphi / 2); + double rail_length = xml_rail.length(); + Trap rail_trap("rail_trap", rail_length / 2, 0, 0, rail_height / 2, rail_width1 / 2, + rail_width2 / 2, 0, rail_height / 2, rail_width1 / 2, rail_width2 / 2, 0); + Volume rail_vol("rail_vol", rail_trap, desc.material(xml_rail.materialStr())); rail_vol.setVisAttributes(desc.visAttributes(xml_rail.visStr())); // Place rail @@ -261,12 +278,11 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) det_volume.placeVolume(dirc_support, tr); } - return det; } -static dd4hep::Trap MakeTrap(const std::string& pName, double pZ, double pY, double pX, double pLTX) -{ +static dd4hep::Trap MakeTrap(const std::string& pName, double pZ, double pY, double pX, + double pLTX) { // Fixed Trap constructor. This function is a workaround of this bug: // https://github.com/AIDASoft/DD4hep/issues/850 // Should be used instead of dd4hep::Trap(pName, pZ, pY, pX, pLTX) constructor @@ -283,7 +299,8 @@ static dd4hep::Trap MakeTrap(const std::string& pName, double pZ, double pY, dou double fDx4 = fDx2; double fTalpha2 = fTalpha1; - return Trap(pName, fDz, fTthetaCphi, fTthetaSphi, fDy1, fDx1, fDx2, fTalpha1, fDy2, fDx3, fDx4, fTalpha2); + return Trap(pName, fDz, fTthetaCphi, fTthetaSphi, fDy1, fDx1, fDx2, fTalpha1, fDy2, fDx3, fDx4, + fTalpha2); } DECLARE_DETELEMENT(epic_DIRC, createDetector) diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index dccafaebf..afb889935 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -24,15 +24,14 @@ using namespace dd4hep; using namespace dd4hep::rec; // create the detector -static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) -{ +static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) { - xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - xml::Component dims = detElem.dimensions(); + xml::DetElement detElem = handle; + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + xml::Component dims = detElem.dimensions(); OpticalSurfaceManager surfMgr = desc.surfaceManager(); - DetElement det(detName, detID); + DetElement det(detName, detID); sens.setType("tracker"); // attributes, from compact file ============================================= @@ -158,7 +157,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec * - `cellMask` is defined such that a hit's `cellID & cellMask` is the corresponding sensor's unique ID */ std::vector<std::string> sensorIDfields = {"pdu", "sipm", "sector"}; - const auto& readoutCoder = *desc.readout(readoutName).idSpec().decoder(); + const auto& readoutCoder = *desc.readout(readoutName).idSpec().decoder(); // determine `cellMask` based on `sensorIDfields` uint64_t cellMask = 0; for (const auto& idField : sensorIDfields) @@ -188,9 +187,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // snout solids double boreDelta = vesselRmin1 - vesselRmin0; double snoutDelta = vesselRmax1 - vesselRmax0; - Cone vesselSnout(snoutLength / 2.0, vesselRmin0, vesselRmax0, vesselRmin0 + boreDelta * snoutLength / vesselLength, - vesselRmax1); - Cone gasvolSnout( + Cone vesselSnout(snoutLength / 2.0, vesselRmin0, vesselRmax0, + vesselRmin0 + boreDelta * snoutLength / vesselLength, vesselRmax1); + Cone gasvolSnout( /* note: `gasvolSnout` extends a bit into the tank, so it touches `gasvolTank` * - the extension distance is equal to the tank `windowThickness`, so the * length of `gasvolSnout` == length of `vesselSnout` @@ -203,39 +202,51 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // tank solids: // - inner: cone along beamline // - outer: cone to back of sensor box, then fixed radius cylinder - Polycone vesselTank(0, 2 * M_PI, - /* rmin */ {vesselSnout.rMin2(), std::lerp(vesselSnout.rMin2(), vesselRmin1, (sensorboxLength - snoutLength) / tankLength), vesselRmin1}, - /* rmax */ {vesselSnout.rMax2(), vesselRmax2, vesselRmax2}, - /* z */ {-tankLength / 2.0, -tankLength / 2.0 + sensorboxLength - snoutLength, tankLength / 2.0}); - Polycone gasvolTank(0, 2 * M_PI, - /* rmin */ {gasvolSnout.rMin2(), std::lerp(gasvolSnout.rMin2(), vesselRmin1 + wallThickness, (sensorboxLength - snoutLength) / tankLength), vesselRmin1 + wallThickness}, - /* rmax */ {gasvolSnout.rMax2(), vesselRmax2 - wallThickness, vesselRmax2 - wallThickness}, - /* z */ {-tankLength / 2.0 + windowThickness, -tankLength / 2.0 + windowThickness + sensorboxLength - snoutLength, tankLength / 2.0 - windowThickness}); + Polycone vesselTank( + 0, 2 * M_PI, + /* rmin */ + {vesselSnout.rMin2(), + std::lerp(vesselSnout.rMin2(), vesselRmin1, (sensorboxLength - snoutLength) / tankLength), + vesselRmin1}, + /* rmax */ {vesselSnout.rMax2(), vesselRmax2, vesselRmax2}, + /* z */ + {-tankLength / 2.0, -tankLength / 2.0 + sensorboxLength - snoutLength, tankLength / 2.0}); + Polycone gasvolTank( + 0, 2 * M_PI, + /* rmin */ + {gasvolSnout.rMin2(), + std::lerp(gasvolSnout.rMin2(), vesselRmin1 + wallThickness, + (sensorboxLength - snoutLength) / tankLength), + vesselRmin1 + wallThickness}, + /* rmax */ {gasvolSnout.rMax2(), vesselRmax2 - wallThickness, vesselRmax2 - wallThickness}, + /* z */ + {-tankLength / 2.0 + windowThickness, + -tankLength / 2.0 + windowThickness + sensorboxLength - snoutLength, + tankLength / 2.0 - windowThickness}); // sensorbox solids double dphi = atan2(wallThickness, sensorboxRmax); // thickness only correct at Rmax - Tube vesselSensorboxTube(sensorboxRmin, sensorboxRmax, sensorboxLength / 2., - -sensorboxDphi / 2., sensorboxDphi / 2.); - Tube gasvolSensorboxTube(sensorboxRmin + wallThickness, sensorboxRmax - wallThickness, sensorboxLength / 2., - -sensorboxDphi / 2. + dphi, sensorboxDphi / 2. - dphi); + Tube vesselSensorboxTube(sensorboxRmin, sensorboxRmax, sensorboxLength / 2., -sensorboxDphi / 2., + sensorboxDphi / 2.); + Tube gasvolSensorboxTube(sensorboxRmin + wallThickness, sensorboxRmax - wallThickness, + sensorboxLength / 2., -sensorboxDphi / 2. + dphi, + sensorboxDphi / 2. - dphi); // union: snout + tank UnionSolid vesselUnion(vesselTank, vesselSnout, Position(0., 0., -vesselLength / 2.)); - UnionSolid gasvolUnion(gasvolTank, gasvolSnout, Position(0., 0., -vesselLength / 2. + windowThickness)); + UnionSolid gasvolUnion(gasvolTank, gasvolSnout, + Position(0., 0., -vesselLength / 2. + windowThickness)); // union: add sensorboxes for all sectors for (int isec = 0; isec < nSectors; isec++) { RotationZ sectorRotation((isec + 0.5) * 2 * M_PI / nSectors); - vesselUnion = UnionSolid(vesselUnion, vesselSensorboxTube, - Transform3D(sectorRotation, - Position(0., 0., -(snoutLength + sensorboxLength - 0.6) / 2.) - ) - ); - gasvolUnion = UnionSolid(gasvolUnion, gasvolSensorboxTube, - Transform3D(sectorRotation, - Position(0., 0., -(snoutLength + sensorboxLength) / 2. + windowThickness) - ) - ); + vesselUnion = UnionSolid( + vesselUnion, vesselSensorboxTube, + Transform3D(sectorRotation, Position(0., 0., -(snoutLength + sensorboxLength - 0.6) / 2.))); + gasvolUnion = UnionSolid( + gasvolUnion, gasvolSensorboxTube, + Transform3D(sectorRotation, + Position(0., 0., -(snoutLength + sensorboxLength) / 2. + windowThickness))); } // extra solids for `debugOptics` only @@ -279,12 +290,12 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // place gas volume PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0)); - DetElement gasvolDE(det, "gasvol_de", 0); + DetElement gasvolDE(det, "gasvol_de", 0); gasvolDE.setPlacement(gasvolPV); // place mother volume (vessel) - Volume motherVol = desc.pickMotherVolume(det); - PlacedVolume vesselPV = motherVol.placeVolume(vesselVol, vesselPos); + Volume motherVol = desc.pickMotherVolume(det); + PlacedVolume vesselPV = motherVol.placeVolume(vesselVol, vesselPos); vesselPV.addPhysVolID("system", detID); det.setPlacement(vesselPV); @@ -298,10 +309,14 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec radiatorRmax + snoutDelta * aerogelThickness / snoutLength, radiatorRmin + boreDelta * (aerogelThickness + airgapThickness) / vesselLength, radiatorRmax + snoutDelta * (aerogelThickness + airgapThickness) / snoutLength); - Cone filterSolid(filterThickness / 2, radiatorRmin + boreDelta * (aerogelThickness + airgapThickness) / vesselLength, - radiatorRmax + snoutDelta * (aerogelThickness + airgapThickness) / snoutLength, - radiatorRmin + boreDelta * (aerogelThickness + airgapThickness + filterThickness) / vesselLength, - radiatorRmax + snoutDelta * (aerogelThickness + airgapThickness + filterThickness) / snoutLength); + Cone filterSolid( + filterThickness / 2, + radiatorRmin + boreDelta * (aerogelThickness + airgapThickness) / vesselLength, + radiatorRmax + snoutDelta * (aerogelThickness + airgapThickness) / snoutLength, + radiatorRmin + + boreDelta * (aerogelThickness + airgapThickness + filterThickness) / vesselLength, + radiatorRmax + + snoutDelta * (aerogelThickness + airgapThickness + filterThickness) / snoutLength); Volume aerogelVol(detName + "_aerogel", aerogelSolid, aerogelMat); Volume airgapVol(detName + "_airgap", airgapSolid, airgapMat); @@ -313,10 +328,10 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // aerogel placement and surface properties // TODO [low-priority]: define skin properties for aerogel and filter // FIXME: radiatorPitch might not be working correctly (not yet used) - auto radiatorPos = Position(0., 0., radiatorFrontplane + 0.5 * aerogelThickness) + originFront; + auto radiatorPos = Position(0., 0., radiatorFrontplane + 0.5 * aerogelThickness) + originFront; auto aerogelPlacement = Translation3D(radiatorPos) * // re-center to originFront - RotationY(radiatorPitch); // change polar angle to specified pitch - auto aerogelPV = gasvolVol.placeVolume(aerogelVol, aerogelPlacement); + RotationY(radiatorPitch); // change polar angle to specified pitch + auto aerogelPV = gasvolVol.placeVolume(aerogelVol, aerogelPlacement); DetElement aerogelDE(det, "aerogel_de", 0); aerogelDE.setPlacement(aerogelPV); // SkinSurface aerogelSkin(desc, aerogelDE, "mirror_optical_surface", aerogelSurf, aerogelVol); @@ -326,18 +341,20 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec if (!debugOptics) { auto airgapPlacement = - Translation3D(radiatorPos) * // re-center to originFront - RotationY(radiatorPitch) * // change polar angle - Translation3D(0., 0., (aerogelThickness + airgapThickness) / 2.); // move to aerogel backplane + Translation3D(radiatorPos) * // re-center to originFront + RotationY(radiatorPitch) * // change polar angle + Translation3D(0., 0., + (aerogelThickness + airgapThickness) / 2.); // move to aerogel backplane auto airgapPV = gasvolVol.placeVolume(airgapVol, airgapPlacement); DetElement airgapDE(det, "airgap_de", 0); airgapDE.setPlacement(airgapPV); auto filterPlacement = - Translation3D(0., 0., airgapThickness) * // add an air gap - Translation3D(radiatorPos) * // re-center to originFront - RotationY(radiatorPitch) * // change polar angle - Translation3D(0., 0., (aerogelThickness + filterThickness) / 2.); // move to aerogel backplane + Translation3D(0., 0., airgapThickness) * // add an air gap + Translation3D(radiatorPos) * // re-center to originFront + RotationY(radiatorPitch) * // change polar angle + Translation3D(0., 0., + (aerogelThickness + filterThickness) / 2.); // move to aerogel backplane auto filterPV = gasvolVol.placeVolume(filterVol, filterPlacement); DetElement filterDE(det, "filter_de", 0); filterDE.setPlacement(filterPV); @@ -367,7 +384,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec continue; // sector rotation about z axis - RotationZ sectorRotation((isec + 0.5) * 2 * M_PI / nSectors); + RotationZ sectorRotation((isec + 0.5) * 2 * M_PI / nSectors); std::string secName = "sec" + std::to_string(isec); // BUILD MIRRORS ==================================================================== @@ -409,18 +426,19 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // solid : create sphere at origin, with specified angular limits; // phi limits are increased to fill gaps (overlaps are cut away later) - Sphere mirrorSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta2, -40 * degree, - 40 * degree); + Sphere mirrorSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta2, + -40 * degree, 40 * degree); // mirror placement transformation (note: transformations are in reverse order) auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; - auto mirrorPlacement(Translation3D(mirrorPos) * // re-center to specified position - RotationY(-mirrorThetaRot) // rotate about vertical axis, to be within vessel radial walls + auto mirrorPlacement( + Translation3D(mirrorPos) * // re-center to specified position + RotationY(-mirrorThetaRot) // rotate about vertical axis, to be within vessel radial walls ); // cut overlaps with other sectors using "pie slice" wedges, to the extent specified // by `mirrorPhiw` - Tube pieSlice(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); + Tube pieSlice(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); IntersectionSolid mirrorSolid2(pieSlice, mirrorSolid1, mirrorPlacement); // mirror volume, attributes, and placement @@ -432,7 +450,8 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // properties DetElement mirrorDE(det, "mirror_de_" + secName, isec); mirrorDE.setPlacement(mirrorPV); - SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, mirrorVol); + SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, + mirrorVol); mirrorSkin.isValid(); // reconstruction constants (w.r.t. IP) @@ -455,9 +474,12 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // reconstruction constants auto sensorSphPos = Position(sensorSphCenterX, 0., sensorSphCenterZ) + originFront; auto sensorSphFinalCenter = sectorRotation * Position(xS, 0.0, zS); - desc.add(Constant("DRICH_sensor_sph_center_x_" + secName, std::to_string(sensorSphFinalCenter.x()))); - desc.add(Constant("DRICH_sensor_sph_center_y_" + secName, std::to_string(sensorSphFinalCenter.y()))); - desc.add(Constant("DRICH_sensor_sph_center_z_" + secName, std::to_string(sensorSphFinalCenter.z()))); + desc.add( + Constant("DRICH_sensor_sph_center_x_" + secName, std::to_string(sensorSphFinalCenter.x()))); + desc.add( + Constant("DRICH_sensor_sph_center_y_" + secName, std::to_string(sensorSphFinalCenter.y()))); + desc.add( + Constant("DRICH_sensor_sph_center_z_" + secName, std::to_string(sensorSphFinalCenter.z()))); if (isec == 0) desc.add(Constant("DRICH_sensor_sph_radius", std::to_string(sensorSphRadius))); @@ -543,8 +565,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Box resinSolid(resinSide / 2., resinSide / 2., resinThickness / 2.); // embed pss solid in resin solid, by subtracting `pssSolid` from `resinSolid` - SubtractionSolid resinSolidEmbedded(resinSolid, pssSolid, - Transform3D(Translation3D(0., 0., (resinThickness - pssThickness) / 2. ))); + SubtractionSolid resinSolidEmbedded( + resinSolid, pssSolid, + Transform3D(Translation3D(0., 0., (resinThickness - pssThickness) / 2.))); /* NOTE: * Here we could add gaps (size=`DRICH_pixel_gap`) between the pixels @@ -590,20 +613,23 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Assembly pduAssembly(detName + "_pdu_" + secName); double pduSensorPitch = resinSide + pduSensorGap; double pduSensorOffsetMax = pduSensorPitch * (pduNumSensors - 1) / 2.0; - int isipm = 0; - for(int sensorIx = 0; sensorIx < pduNumSensors; sensorIx++) { - for(int sensorIy = 0; sensorIy < pduNumSensors; sensorIy++) { + int isipm = 0; + for (int sensorIx = 0; sensorIx < pduNumSensors; sensorIx++) { + for (int sensorIy = 0; sensorIy < pduNumSensors; sensorIy++) { Assembly sensorAssembly(detName + "_sensor_" + secName); // placement transformations // - placement of objects in `sensorAssembly` - auto pssPlacement = Transform3D(Translation3D(0., 0., -pssThickness / 2.0)); // set assembly origin to pss outermost surface centroid + auto pssPlacement = Transform3D(Translation3D( + 0., 0., + -pssThickness / 2.0)); // set assembly origin to pss outermost surface centroid auto resinPlacement = Transform3D(Translation3D(0., 0., -resinThickness / 2.0)); // - placement of a `sensorAssembly` in `pduAssembly` - auto pduSensorOffsetX = sensorIx * pduSensorPitch - pduSensorOffsetMax; - auto pduSensorOffsetY = sensorIy * pduSensorPitch - pduSensorOffsetMax; - auto sensorAssemblyPlacement = Transform3D(Translation3D(pduSensorOffsetX, pduSensorOffsetY, 0.0)); + auto pduSensorOffsetX = sensorIx * pduSensorPitch - pduSensorOffsetMax; + auto pduSensorOffsetY = sensorIy * pduSensorPitch - pduSensorOffsetMax; + auto sensorAssemblyPlacement = + Transform3D(Translation3D(pduSensorOffsetX, pduSensorOffsetY, 0.0)); // placements auto pssPV = sensorAssembly.placeVolume(pssVol, pssPlacement); @@ -611,40 +637,50 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec pduAssembly.placeVolume(sensorAssembly, sensorAssemblyPlacement); // sensor readout // NOTE: follow `sensorIDfields` - pssPV.addPhysVolID("sector", isec).addPhysVolID("pdu", ipdu).addPhysVolID("sipm", isipm); + pssPV.addPhysVolID("sector", isec) + .addPhysVolID("pdu", ipdu) + .addPhysVolID("sipm", isipm); // sensor DetElement - auto sensorID = encodeSensorID(pssPV.volIDs()); - std::string sensorIDname = secName + "_pdu" + std::to_string(ipdu) + "_sipm" + std::to_string(isipm); + auto sensorID = encodeSensorID(pssPV.volIDs()); + std::string sensorIDname = + secName + "_pdu" + std::to_string(ipdu) + "_sipm" + std::to_string(isipm); DetElement pssDE(det, "sensor_de_" + sensorIDname, sensorID); pssDE.setPlacement(pssPV); // sensor surface properties if (!debugOptics || debugOpticsMode == 3) { - SkinSurface pssSkin(desc, pssDE, "sensor_optical_surface_" + sensorIDname, pssSurf, pssVol); + SkinSurface pssSkin(desc, pssDE, "sensor_optical_surface_" + sensorIDname, pssSurf, + pssVol); pssSkin.isValid(); } // obtain some parameters useful for optics, so we don't have to figure them out downstream // - sensor position: the centroid of the active SURFACE of the `pss` - auto pduOrigin = ROOT::Math::XYZPoint(0,0,0); - auto sensorPos = - Translation3D(vesselPos) * // position of vessel in world - pduAssemblyPlacement * // position of PDU in vessel - sensorAssemblyPlacement * // position of SiPM in PDU - pduOrigin; - auto pduPos = - Translation3D(vesselPos) * // position of vessel in world - pduAssemblyPlacement * // position of PDU in vessel - pduOrigin; + auto pduOrigin = ROOT::Math::XYZPoint(0, 0, 0); + auto sensorPos = Translation3D(vesselPos) * // position of vessel in world + pduAssemblyPlacement * // position of PDU in vessel + sensorAssemblyPlacement * // position of SiPM in PDU + pduOrigin; + auto pduPos = Translation3D(vesselPos) * // position of vessel in world + pduAssemblyPlacement * // position of PDU in vessel + pduOrigin; // - sensor surface basis: the orientation of the sensor surface // NOTE: all sensors of a single PDU have the same surface orientation, but to avoid // loss of generality downstream, define the basis for each sensor - auto normVector = [pduAssemblyPlacement] (Direction n) { + auto normVector = [pduAssemblyPlacement](Direction n) { return pduAssemblyPlacement * n; }; - auto sensorNormX = normVector(Direction{1., 0., 0.,}); - auto sensorNormY = normVector(Direction{0., 1., 0.,}); + auto sensorNormX = normVector(Direction{ + 1., + 0., + 0., + }); + auto sensorNormY = normVector(Direction{ + 0., + 1., + 0., + }); // geometry tests /* - to help ensure the optics geometry is correctly interpreted by the reconstruction, @@ -653,73 +689,89 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec * `sensorNormX`, `sensorNormY` is wrong and/or the tests need to be updated */ // - test: check if the sensor position is on the sensor sphere (corrected for PDU matrix offset) - auto distActual = std::sqrt((sensorPos-sensorSphFinalCenter).Mag2()); + auto distActual = std::sqrt((sensorPos - sensorSphFinalCenter).Mag2()); auto distExpected = std::hypot(pduSensorOffsetX, pduSensorOffsetY, sensorSphRadius); auto testOnSphere = distActual - distExpected; - if(std::abs(testOnSphere) > 1e-6) { - printout(ERROR, "DRICH_geo", "sensor %s failed on-sphere test; testOnSphere=%f", sensorIDname.c_str(), testOnSphere); + if (std::abs(testOnSphere) > 1e-6) { + printout(ERROR, "DRICH_geo", "sensor %s failed on-sphere test; testOnSphere=%f", + sensorIDname.c_str(), testOnSphere); throw std::runtime_error("dRICH sensor position test failed"); } // - test: check the orientation - Direction radialDir = Direction(pduPos) - sensorSphFinalCenter; // sensor sphere radius direction - auto sensorNormZ = sensorNormX.Cross(sensorNormY); // sensor surface normal - auto testOrtho = sensorNormX.Dot(sensorNormY); // zero, if x and y vectors are orthogonal - auto testRadial = radialDir.Cross(sensorNormZ).Mag2(); // zero, if surface normal is parallel to radial direction - auto testDirection = radialDir.Dot(sensorNormZ); // positive, if radial direction == sensor normal direction (outward) - if(std::abs(testOrtho)>1e-6 || std::abs(testRadial)>1e-6 || testDirection<=0) { - printout(ERROR, "DRICH_geo", "sensor %s failed orientation test", sensorIDname.c_str()); + Direction radialDir = + Direction(pduPos) - sensorSphFinalCenter; // sensor sphere radius direction + auto sensorNormZ = sensorNormX.Cross(sensorNormY); // sensor surface normal + auto testOrtho = + sensorNormX.Dot(sensorNormY); // zero, if x and y vectors are orthogonal + auto testRadial = + radialDir.Cross(sensorNormZ) + .Mag2(); // zero, if surface normal is parallel to radial direction + auto testDirection = radialDir.Dot( + sensorNormZ); // positive, if radial direction == sensor normal direction (outward) + if (std::abs(testOrtho) > 1e-6 || std::abs(testRadial) > 1e-6 || testDirection <= 0) { + printout(ERROR, "DRICH_geo", "sensor %s failed orientation test", + sensorIDname.c_str()); printout(ERROR, "DRICH_geo", " testOrtho = %f; should be zero", testOrtho); printout(ERROR, "DRICH_geo", " testRadial = %f; should be zero", testRadial); - printout(ERROR, "DRICH_geo", " testDirection = %f; should be positive", testDirection); + printout(ERROR, "DRICH_geo", " testDirection = %f; should be positive", + testDirection); throw std::runtime_error("dRICH sensor orientation test failed"); } // add these optics parameters to this sensor's parameter map auto pssVarMap = pssDE.extension<VariantParameters>(false); - if(pssVarMap == nullptr) { + if (pssVarMap == nullptr) { pssVarMap = new VariantParameters(); pssDE.addExtension<VariantParameters>(pssVarMap); } - auto addVecToMap = [pssVarMap] (std::string key, auto vec) { - pssVarMap->set<double>(key+"_x", vec.x()); - pssVarMap->set<double>(key+"_y", vec.y()); - pssVarMap->set<double>(key+"_z", vec.z()); + auto addVecToMap = [pssVarMap](std::string key, auto vec) { + pssVarMap->set<double>(key + "_x", vec.x()); + pssVarMap->set<double>(key + "_y", vec.y()); + pssVarMap->set<double>(key + "_z", vec.z()); }; addVecToMap("pos", sensorPos); addVecToMap("normX", sensorNormX); addVecToMap("normY", sensorNormY); printout(DEBUG, "DRICH_geo", "sensor %s:", sensorIDname.c_str()); - for(auto kv : pssVarMap->variantParameters) - printout(DEBUG, "DRICH_geo", " %s: %f", kv.first.c_str(), pssVarMap->get<double>(kv.first)); + for (auto kv : pssVarMap->variantParameters) + printout(DEBUG, "DRICH_geo", " %s: %f", kv.first.c_str(), + pssVarMap->get<double>(kv.first)); // increment SIPM number isipm++; - } } // end PDU SiPM matrix loop // front service volumes - Transform3D frontServiceTransformation = Transform3D(Translation3D(0., 0., -resinThickness)); - for(xml::Collection_t serviceElem(pduElem.child(_Unicode(frontservices)), _Unicode(service)); serviceElem; ++serviceElem) { + Transform3D frontServiceTransformation = + Transform3D(Translation3D(0., 0., -resinThickness)); + for (xml::Collection_t serviceElem(pduElem.child(_Unicode(frontservices)), + _Unicode(service)); + serviceElem; ++serviceElem) { auto serviceName = serviceElem.attr<std::string>(_Unicode(name)); auto serviceSide = serviceElem.attr<double>(_Unicode(side)); auto serviceThickness = serviceElem.attr<double>(_Unicode(thickness)); - auto serviceMat = desc.material(serviceElem.attr<std::string>(_Unicode(material))); - auto serviceVis = desc.visAttributes(serviceElem.attr<std::string>(_Unicode(vis))); + auto serviceMat = desc.material(serviceElem.attr<std::string>(_Unicode(material))); + auto serviceVis = desc.visAttributes(serviceElem.attr<std::string>(_Unicode(vis))); Box serviceSolid(serviceSide / 2.0, serviceSide / 2.0, serviceThickness / 2.0); - Volume serviceVol(detName + "_" + serviceName + "_" + secName, serviceSolid, serviceMat); + Volume serviceVol(detName + "_" + serviceName + "_" + secName, serviceSolid, + serviceMat); serviceVol.setVisAttributes(serviceVis); - frontServiceTransformation = Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * frontServiceTransformation; + frontServiceTransformation = + Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * + frontServiceTransformation; pduAssembly.placeVolume(serviceVol, frontServiceTransformation); - frontServiceTransformation = Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * frontServiceTransformation; + frontServiceTransformation = + Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * + frontServiceTransformation; } // circuit board volumes auto boardsElem = pduElem.child(_Unicode(boards)); - auto boardsMat = desc.material(boardsElem.attr<std::string>(_Unicode(material))); - auto boardsVis = desc.visAttributes(boardsElem.attr<std::string>(_Unicode(vis))); + auto boardsMat = desc.material(boardsElem.attr<std::string>(_Unicode(material))); + auto boardsVis = desc.visAttributes(boardsElem.attr<std::string>(_Unicode(vis))); Transform3D backServiceTransformation; - for(xml::Collection_t boardElem(boardsElem, _Unicode(board)); boardElem; ++boardElem) { + for (xml::Collection_t boardElem(boardsElem, _Unicode(board)); boardElem; ++boardElem) { auto boardName = boardElem.attr<std::string>(_Unicode(name)); auto boardWidth = boardElem.attr<double>(_Unicode(width)); auto boardLength = boardElem.attr<double>(_Unicode(length)); @@ -728,25 +780,34 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Box boardSolid(boardWidth / 2.0, boardThickness / 2.0, boardLength / 2.0); Volume boardVol(detName + "_" + boardName + "+" + secName, boardSolid, boardsMat); boardVol.setVisAttributes(boardsVis); - auto boardTransformation = Translation3D(0., boardOffset, -boardLength / 2.0) * frontServiceTransformation; + auto boardTransformation = + Translation3D(0., boardOffset, -boardLength / 2.0) * frontServiceTransformation; pduAssembly.placeVolume(boardVol, boardTransformation); - if(boardName=="RDO") - backServiceTransformation = Translation3D(0., 0., -boardLength) * frontServiceTransformation; + if (boardName == "RDO") + backServiceTransformation = + Translation3D(0., 0., -boardLength) * frontServiceTransformation; } // back service volumes - for(xml::Collection_t serviceElem(pduElem.child(_Unicode(backservices)), _Unicode(service)); serviceElem; ++serviceElem) { + for (xml::Collection_t serviceElem(pduElem.child(_Unicode(backservices)), + _Unicode(service)); + serviceElem; ++serviceElem) { auto serviceName = serviceElem.attr<std::string>(_Unicode(name)); auto serviceSide = serviceElem.attr<double>(_Unicode(side)); auto serviceThickness = serviceElem.attr<double>(_Unicode(thickness)); - auto serviceMat = desc.material(serviceElem.attr<std::string>(_Unicode(material))); - auto serviceVis = desc.visAttributes(serviceElem.attr<std::string>(_Unicode(vis))); + auto serviceMat = desc.material(serviceElem.attr<std::string>(_Unicode(material))); + auto serviceVis = desc.visAttributes(serviceElem.attr<std::string>(_Unicode(vis))); Box serviceSolid(serviceSide / 2.0, serviceSide / 2.0, serviceThickness / 2.0); - Volume serviceVol(detName + "_" + serviceName + "_" + secName, serviceSolid, serviceMat); + Volume serviceVol(detName + "_" + serviceName + "_" + secName, serviceSolid, + serviceMat); serviceVol.setVisAttributes(serviceVis); - backServiceTransformation = Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * backServiceTransformation; + backServiceTransformation = + Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * + backServiceTransformation; pduAssembly.placeVolume(serviceVol, backServiceTransformation); - backServiceTransformation = Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * backServiceTransformation; + backServiceTransformation = + Transform3D(Translation3D(0., 0., -serviceThickness / 2.0)) * + backServiceTransformation; } // place PDU assembly @@ -756,8 +817,8 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec ipdu++; } // end patch cuts - } // end phiGen loop - } // end thetaGen loop + } // end phiGen loop + } // end thetaGen loop // END SENSOR MODULE LOOP ------------------------ diff --git a/src/EcalLumiSpecWScFi_geo.cpp b/src/EcalLumiSpecWScFi_geo.cpp index 048ca9d78..db986e36a 100644 --- a/src/EcalLumiSpecWScFi_geo.cpp +++ b/src/EcalLumiSpecWScFi_geo.cpp @@ -15,34 +15,35 @@ using namespace std; using namespace dd4hep; // Definition of function to build the modules -static tuple<Volume, Position> build_specScFiCAL_module(const Detector& description, const xml::Component& mod_x, SensitiveDetector& sens); +static tuple<Volume, Position> build_specScFiCAL_module(const Detector& description, + const xml::Component& mod_x, + SensitiveDetector& sens); // Driver Function -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { sens.setType("calorimeter"); - xml_det_t x_det = e; - xml_comp_t x_mod = x_det.child( _Unicode(module) ); - string det_name = x_det.nameStr(); - int det_ID = x_det.id(); + xml_det_t x_det = e; + xml_comp_t x_mod = x_det.child(_Unicode(module)); + string det_name = x_det.nameStr(); + int det_ID = x_det.id(); - Material Air = description.material("Air"); + Material Air = description.material("Air"); // Create main detector element to be returned at the end - DetElement det( det_name, det_ID ); + DetElement det(det_name, det_ID); // Mother volume - Volume motherVol = description.pickMotherVolume( det ); + Volume motherVol = description.pickMotherVolume(det); // Detector assembly - Assembly assembly( det_name ); - assembly.setVisAttributes( description.visAttributes(x_det.attr<std::string>(_Unicode(vis))) ); + Assembly assembly(det_name); + assembly.setVisAttributes(description.visAttributes(x_det.attr<std::string>(_Unicode(vis)))); - double detSizeXY = getAttrOrDefault( x_det, _Unicode(sizeXY), 180*mm); - double detSizeZ = getAttrOrDefault( x_det, _Unicode(sizeZ), 180*mm); - int nmod_perlayer = getAttrOrDefault( x_det, _Unicode(nmod_perlayer), 3); - int nlayer = getAttrOrDefault( x_det, _Unicode(nlayer), 20); + double detSizeXY = getAttrOrDefault(x_det, _Unicode(sizeXY), 180 * mm); + double detSizeZ = getAttrOrDefault(x_det, _Unicode(sizeZ), 180 * mm); + int nmod_perlayer = getAttrOrDefault(x_det, _Unicode(nmod_perlayer), 3); + int nlayer = getAttrOrDefault(x_det, _Unicode(nlayer), 20); // Global detector position and resolution xml_comp_t pos = x_det.position(); @@ -51,59 +52,65 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s auto [modVol, modSize] = build_specScFiCAL_module(description, x_mod, sens); // Position of first module, layer from center of CAL - double mod_pos0 = -(detSizeXY/2.0) + (modSize.x()/2.0); - double layer_pos0 = -(detSizeZ/2.0) + (modSize.y()/2.0); + double mod_pos0 = -(detSizeXY / 2.0) + (modSize.x() / 2.0); + double layer_pos0 = -(detSizeZ / 2.0) + (modSize.y() / 2.0); - Box layerBox ( detSizeXY/2, modSize.y()/2, detSizeXY/2 ); - Volume layerVol( "layer", layerBox, Air); - layerVol.setVisAttributes( description.visAttributes(x_mod.attr<std::string>(_Unicode(vis))) ); + Box layerBox(detSizeXY / 2, modSize.y() / 2, detSizeXY / 2); + Volume layerVol("layer", layerBox, Air); + layerVol.setVisAttributes(description.visAttributes(x_mod.attr<std::string>(_Unicode(vis)))); //Fill layer with modules - for(int mod_id=0; mod_id< nmod_perlayer; mod_id++){ + for (int mod_id = 0; mod_id < nmod_perlayer; mod_id++) { //Build // to z-axis, then rotate - double mod_pos_z = 0.0*cm; - double mod_pos_y = 0.0*cm; - double mod_pos_x = mod_id*modSize.x() + mod_pos0; + double mod_pos_z = 0.0 * cm; + double mod_pos_y = 0.0 * cm; + double mod_pos_x = mod_id * modSize.x() + mod_pos0; - PlacedVolume modPV = layerVol.placeVolume( modVol, Position( mod_pos_x, mod_pos_y, mod_pos_z ) ); - modPV.addPhysVolID( "module", mod_id ); - }//imod-loop close + PlacedVolume modPV = layerVol.placeVolume(modVol, Position(mod_pos_x, mod_pos_y, mod_pos_z)); + modPV.addPhysVolID("module", mod_id); + } //imod-loop close - Box sectorBox( detSizeXY/2, detSizeXY/2, detSizeZ/2 ); - Volume sectorVol( det_name+"_sector", sectorBox, Air); - sectorVol.setVisAttributes( description.visAttributes(x_mod.attr<std::string>(_Unicode(vis))) ); + Box sectorBox(detSizeXY / 2, detSizeXY / 2, detSizeZ / 2); + Volume sectorVol(det_name + "_sector", sectorBox, Air); + sectorVol.setVisAttributes(description.visAttributes(x_mod.attr<std::string>(_Unicode(vis)))); //Fill sector with layers - for(int layer_id=0; layer_id< nlayer; layer_id++){ + for (int layer_id = 0; layer_id < nlayer; layer_id++) { - double lay_pos_z = -layer_id*modSize.y() - layer_pos0; - double lay_pos_y = 0.0*cm; - double lay_pos_x = 0.0*cm; - int orientation = layer_id%2==0; + double lay_pos_z = -layer_id * modSize.y() - layer_pos0; + double lay_pos_y = 0.0 * cm; + double lay_pos_x = 0.0 * cm; + int orientation = layer_id % 2 == 0; - RotationZYX lay_rot = RotationZYX( 0, 0, -90.0*degree); - if(orientation) lay_rot*=RotationY(-90.0*degree); + RotationZYX lay_rot = RotationZYX(0, 0, -90.0 * degree); + if (orientation) + lay_rot *= RotationY(-90.0 * degree); - PlacedVolume layPV = sectorVol.placeVolume( layerVol, Transform3D( lay_rot, Position( lay_pos_x, lay_pos_y, lay_pos_z ) ) ); - layPV.addPhysVolID( "layer", layer_id ).addPhysVolID( "orientation", orientation ); + PlacedVolume layPV = sectorVol.placeVolume( + layerVol, Transform3D(lay_rot, Position(lay_pos_x, lay_pos_y, lay_pos_z))); + layPV.addPhysVolID("layer", layer_id).addPhysVolID("orientation", orientation); - }//layer_id-loop close + } //layer_id-loop close // loop over sectors(top, bottom) - for( xml_coll_t si(x_det, _Unicode(sector)); si; si++) { + for (xml_coll_t si(x_det, _Unicode(sector)); si; si++) { - xml_comp_t x_sector( si ); - int sector_id = x_sector.id(); + xml_comp_t x_sector(si); + int sector_id = x_sector.id(); xml_comp_t sec_pos = x_sector.position(); xml_comp_t sec_rot = x_sector.rotation(); - PlacedVolume secPV = assembly.placeVolume( sectorVol, Transform3D( RotationZYX(sec_rot.z(), sec_rot.y(), sec_rot.x() ), Position( sec_pos.x(), sec_pos.y(), sec_pos.z() ) ) ); - secPV.addPhysVolID( "sector", sector_id ); - }// sectors + PlacedVolume secPV = assembly.placeVolume( + sectorVol, Transform3D(RotationZYX(sec_rot.z(), sec_rot.y(), sec_rot.x()), + Position(sec_pos.x(), sec_pos.y(), sec_pos.z()))); + secPV.addPhysVolID("sector", sector_id); + } // sectors // Place assembly into mother volume. Assembly is centered at origin - PlacedVolume detPV = motherVol.placeVolume( assembly, Transform3D( RotationZYX( rot.z(), rot.y(), rot.x() ), Position( pos.x(), pos.y(), pos.z() ) ) ); + PlacedVolume detPV = + motherVol.placeVolume(assembly, Transform3D(RotationZYX(rot.z(), rot.y(), rot.x()), + Position(pos.x(), pos.y(), pos.z()))); detPV.addPhysVolID("system", det_ID); // Connect to system ID det.setPlacement(detPV); @@ -111,87 +118,91 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s return det; } //Driver class close -static tuple<Volume, Position> build_specScFiCAL_module( const Detector& description, const xml::Component& mod_x, SensitiveDetector& sens){ +static tuple<Volume, Position> build_specScFiCAL_module(const Detector& description, + const xml::Component& mod_x, + SensitiveDetector& sens) { - //--------------------Module Setup--------------------------------------------------------------------- - double sx = mod_x.attr<double>(_Unicode(sizex)); - double sy = mod_x.attr<double>(_Unicode(sizey)); - double sz = mod_x.attr<double>(_Unicode(sizez)); + //--------------------Module Setup--------------------------------------------------------------------- + double sx = mod_x.attr<double>(_Unicode(sizex)); + double sy = mod_x.attr<double>(_Unicode(sizey)); + double sz = mod_x.attr<double>(_Unicode(sizez)); - Position modSize(sx, sy, sz); + Position modSize(sx, sy, sz); - Box modShape( modSize.x()/2.0, modSize.y()/2.0, modSize.z()/2.0 ); - auto modMat = description.material(mod_x.attr<std::string>(_Unicode(material))); - Volume modVol("module_vol", modShape, modMat); + Box modShape(modSize.x() / 2.0, modSize.y() / 2.0, modSize.z() / 2.0); + auto modMat = description.material(mod_x.attr<std::string>(_Unicode(material))); + Volume modVol("module_vol", modShape, modMat); - modVol.setVisAttributes(description.visAttributes(mod_x.attr<std::string>(_Unicode(vis)))); - //----------------------------Scintillating fibers ----------------------------------------------------------- + modVol.setVisAttributes(description.visAttributes(mod_x.attr<std::string>(_Unicode(vis)))); + //----------------------------Scintillating fibers ----------------------------------------------------------- - //fibers - auto fiber_tube = mod_x.child(_Unicode(fiber)); - auto fr = fiber_tube.attr<double>(_Unicode(radius)); - auto fsx = fiber_tube.attr<double>(_Unicode(spacex)); - auto fsy = fiber_tube.attr<double>(_Unicode(spacey)); - auto fiberMat = description.material(fiber_tube.attr<std::string>(_Unicode(material))); - Tube fiberShape(0., fr, modSize.z() / 2.0); - Volume fiberVol("fiber_vol", fiberShape, fiberMat); - fiberVol.setVisAttributes(description.visAttributes(fiber_tube.attr<std::string>(_Unicode(vis)))); - fiberVol.setSensitiveDetector(sens); + //fibers + auto fiber_tube = mod_x.child(_Unicode(fiber)); + auto fr = fiber_tube.attr<double>(_Unicode(radius)); + auto fsx = fiber_tube.attr<double>(_Unicode(spacex)); + auto fsy = fiber_tube.attr<double>(_Unicode(spacey)); + auto fiberMat = description.material(fiber_tube.attr<std::string>(_Unicode(material))); + Tube fiberShape(0., fr, modSize.z() / 2.0); + Volume fiberVol("fiber_vol", fiberShape, fiberMat); + fiberVol.setVisAttributes(description.visAttributes(fiber_tube.attr<std::string>(_Unicode(vis)))); + fiberVol.setSensitiveDetector(sens); - //double submod_sizexy = 2.0*fr; // size of square = diameter of tubes. - int num_submodX = int (modSize.x() / (2*fr + 2.0*fsx) ); - int num_submodY = int (modSize.y() / (2*fr + 2.0*fsy) ); + //double submod_sizexy = 2.0*fr; // size of square = diameter of tubes. + int num_submodX = int(modSize.x() / (2 * fr + 2.0 * fsx)); + int num_submodY = int(modSize.y() / (2 * fr + 2.0 * fsy)); - double submod_xpos0 = -modSize.x()/2.0 + fr + fsx; - double submod_ypos0 = -modSize.y()/2.0 + fr + fsy; - int nfibers = 0; + double submod_xpos0 = -modSize.x() / 2.0 + fr + fsx; + double submod_ypos0 = -modSize.y() / 2.0 + fr + fsy; + int nfibers = 0; - //Fiber Holder - auto fiberholder_x = mod_x.child(_Unicode(fiberholder)); - double fh_dz = 0.6*mm; //thickness of fiber holder + //Fiber Holder + auto fiberholder_x = mod_x.child(_Unicode(fiberholder)); + double fh_dz = 0.6 * mm; //thickness of fiber holder - double fh_outerbox_y = 2.0*fr + 2.0*fsy; - double fh_outerbox_x = 2.0*fr + 2.0*fsx; - Box fh_outerbox(fh_outerbox_x/2.0, fh_outerbox_y/2.0, fh_dz/2.0); + double fh_outerbox_y = 2.0 * fr + 2.0 * fsy; + double fh_outerbox_x = 2.0 * fr + 2.0 * fsx; + Box fh_outerbox(fh_outerbox_x / 2.0, fh_outerbox_y / 2.0, fh_dz / 2.0); - double fh_innerbox_y = 2.0*fr; - double fh_innerbox_x = 2.0*fr; - Box fh_innerbox(fh_innerbox_x/2.0, fh_innerbox_y/2.0, fh_dz/2.0); + double fh_innerbox_y = 2.0 * fr; + double fh_innerbox_x = 2.0 * fr; + Box fh_innerbox(fh_innerbox_x / 2.0, fh_innerbox_y / 2.0, fh_dz / 2.0); - SubtractionSolid fiberholder_solid(fh_outerbox, fh_innerbox, Position(0.0, 0.0,0.0)); - auto fiberholderMat = description.material(fiberholder_x.attr<std::string>(_Unicode(material))); - Volume fiberholderVol("fiberholder_vol",fiberholder_solid, fiberholderMat); - fiberholderVol.setVisAttributes(description.visAttributes(fiberholder_x.attr<std::string>(_Unicode(vis)))); + SubtractionSolid fiberholder_solid(fh_outerbox, fh_innerbox, Position(0.0, 0.0, 0.0)); + auto fiberholderMat = description.material(fiberholder_x.attr<std::string>(_Unicode(material))); + Volume fiberholderVol("fiberholder_vol", fiberholder_solid, fiberholderMat); + fiberholderVol.setVisAttributes( + description.visAttributes(fiberholder_x.attr<std::string>(_Unicode(vis)))); - int nfh = 0; + int nfh = 0; - //placement of fibers and fiberholder - for(int iy = 0; iy< num_submodY; iy++){ + //placement of fibers and fiberholder + for (int iy = 0; iy < num_submodY; iy++) { - for(int ix=0; ix< num_submodX; ix++){ + for (int ix = 0; ix < num_submodX; ix++) { - double submod_pos_x = submod_xpos0 + ix*(2.0*fr + 2.0*fsx); //mm - double submod_pos_y = submod_ypos0 + iy*(2.0*fr + 2.0*fsy); //mm - double submod_pos_z = 0*mm ; //mm + double submod_pos_x = submod_xpos0 + ix * (2.0 * fr + 2.0 * fsx); //mm + double submod_pos_y = submod_ypos0 + iy * (2.0 * fr + 2.0 * fsy); //mm + double submod_pos_z = 0 * mm; //mm - //placement of fiber - auto fiberPV = modVol.placeVolume(fiberVol, nfibers++, Position{submod_pos_x, submod_pos_y, submod_pos_z}); - fiberPV.addPhysVolID("fiber_x", ix+1).addPhysVolID("fiber_y", iy+1); + //placement of fiber + auto fiberPV = modVol.placeVolume(fiberVol, nfibers++, + Position{submod_pos_x, submod_pos_y, submod_pos_z}); + fiberPV.addPhysVolID("fiber_x", ix + 1).addPhysVolID("fiber_y", iy + 1); - //placement of fiber holder 6.6*cm apart c-to-c - int num_holders = 4; // which means 4 regions - double fh_pos_z0 = -1*(modSize.z()/2.0) + (fh_dz/2.0); + //placement of fiber holder 6.6*cm apart c-to-c + int num_holders = 4; // which means 4 regions + double fh_pos_z0 = -1 * (modSize.z() / 2.0) + (fh_dz / 2.0); - for(int iz=0; iz<num_holders;iz++){ - double fh_pos_z = fh_pos_z0 + iz*( (modSize.z() - fh_dz)/(num_holders-1) ); - modVol.placeVolume(fiberholderVol, nfh++, Position{submod_pos_x, submod_pos_y, fh_pos_z}); - }//iz close + for (int iz = 0; iz < num_holders; iz++) { + double fh_pos_z = fh_pos_z0 + iz * ((modSize.z() - fh_dz) / (num_holders - 1)); + modVol.placeVolume(fiberholderVol, nfh++, Position{submod_pos_x, submod_pos_y, fh_pos_z}); + } //iz close - }//ix close - }//iy close + } //ix close + } //iy close - return make_tuple(modVol, modSize); + return make_tuple(modVol, modSize); -}// build_specScifiCAL_module function close +} // build_specScifiCAL_module function close DECLARE_DETELEMENT(EcalLumiSpecWScFi, create_detector) diff --git a/src/EndcapCalorimeterWithInsertCutout_geo.cpp b/src/EndcapCalorimeterWithInsertCutout_geo.cpp index e5752bd21..93e3849e7 100644 --- a/src/EndcapCalorimeterWithInsertCutout_geo.cpp +++ b/src/EndcapCalorimeterWithInsertCutout_geo.cpp @@ -13,76 +13,76 @@ using namespace dd4hep; -static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ - xml_det_t detElem = handle; +static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) { + xml_det_t detElem = handle; std::string detName = detElem.nameStr(); - int detID = detElem.id(); + int detID = detElem.id(); - xml_dim_t dim = detElem.dimensions(); - double rmin = dim.rmin(); // Dummy variable. Set to 0 since cutting out insert - double rmax = dim.rmax(); // Max radius of endcap - double length = dim.z(); // Size along z-axis + xml_dim_t dim = detElem.dimensions(); + double rmin = dim.rmin(); // Dummy variable. Set to 0 since cutting out insert + double rmax = dim.rmax(); // Max radius of endcap + double length = dim.z(); // Size along z-axis xml_dim_t pos = detElem.position(); Material air = desc.material("Air"); // Getting insert dimensions - const xml::Component& insert_xml = detElem.child(_Unicode(insert)); - xml_dim_t insert_dim = insert_xml.dimensions(); - xml_dim_t insert_local_pos = insert_xml.position(); + const xml::Component& insert_xml = detElem.child(_Unicode(insert)); + xml_dim_t insert_dim = insert_xml.dimensions(); + xml_dim_t insert_local_pos = insert_xml.position(); // Defining envelope Tube envelope(rmin, rmax, length / 2.0); // Removing insert shape from envelope - Box insert(insert_dim.x() / 2., insert_dim.y() / 2., length / 2.); - SubtractionSolid envelope_with_inserthole(envelope, insert, Position(insert_local_pos.x(), insert_local_pos.y(), 0.)); - Volume envelopeVol(detName, envelope_with_inserthole, air); + Box insert(insert_dim.x() / 2., insert_dim.y() / 2., length / 2.); + SubtractionSolid envelope_with_inserthole( + envelope, insert, Position(insert_local_pos.x(), insert_local_pos.y(), 0.)); + Volume envelopeVol(detName, envelope_with_inserthole, air); // Setting envelope attributes envelopeVol.setAttributes(desc, detElem.regionStr(), detElem.limitsStr(), detElem.visStr()); PlacedVolume pv; - int layer_num = 1; - double layer_z = -length / 2.; // Keeps track of layers' local z locations + int layer_num = 1; + double layer_z = -length / 2.; // Keeps track of layers' local z locations // Looping through all the different layer sections for (xml_coll_t c(detElem, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - double layer_thickness = x_layer.thickness(); + xml_comp_t x_layer = c; + int repeat = x_layer.repeat(); + double layer_thickness = x_layer.thickness(); // Looping through the number of repeated layers in each section for (int i = 0; i < repeat; i++) { layer_z += layer_thickness / 2.; // Going to halfway point in layer std::string layer_name = detName + _toString(layer_num, "_layer%d"); - Tube layer(rmin, rmax, layer_thickness / 2.); + Tube layer(rmin, rmax, layer_thickness / 2.); // Removing insert shape from each layer - Box layer_insert(insert_dim.x() / 2., insert_dim.y() / 2., layer_thickness / 2.); - SubtractionSolid layer_with_inserthole(layer, layer_insert, - Position(insert_local_pos.x(), insert_local_pos.y(), 0.)); - Volume layer_vol(layer_name, layer_with_inserthole, air); + Box layer_insert(insert_dim.x() / 2., insert_dim.y() / 2., layer_thickness / 2.); + SubtractionSolid layer_with_inserthole( + layer, layer_insert, Position(insert_local_pos.x(), insert_local_pos.y(), 0.)); + Volume layer_vol(layer_name, layer_with_inserthole, air); - int slice_num = 1; - double slice_z = -layer_thickness / 2.; // Keeps track of slices' z locations in each layer + int slice_num = 1; + double slice_z = -layer_thickness / 2.; // Keeps track of slices' z locations in each layer // Looping over each layer's slices for (xml_coll_t l(x_layer, _U(slice)); l; ++l) { - xml_comp_t x_slice = l; - double slice_thickness = x_slice.thickness(); - std::string slice_name = layer_name + _toString(slice_num, "slice%d"); - Material slice_mat = desc.material(x_slice.materialStr()); + xml_comp_t x_slice = l; + double slice_thickness = x_slice.thickness(); + std::string slice_name = layer_name + _toString(slice_num, "slice%d"); + Material slice_mat = desc.material(x_slice.materialStr()); slice_z += slice_thickness / 2.; // Going to slice halfway point Tube slice(rmin, rmax, slice_thickness / 2.); // Removing insert shape from each slice - Box slice_insert(insert_dim.x() / 2., insert_dim.y() / 2., slice_thickness / 2.0); - SubtractionSolid slice_with_inserthole(slice, slice_insert, - Position(insert_local_pos.x(), insert_local_pos.y(), 0.)); - Volume slice_vol(slice_name, slice_with_inserthole, slice_mat); + Box slice_insert(insert_dim.x() / 2., insert_dim.y() / 2., slice_thickness / 2.0); + SubtractionSolid slice_with_inserthole( + slice, slice_insert, Position(insert_local_pos.x(), insert_local_pos.y(), 0.)); + Volume slice_vol(slice_name, slice_with_inserthole, slice_mat); // Setting appropriate slices as sensitive if (x_slice.isSensitive()) { @@ -94,7 +94,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens slice_vol.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); // Placing slice within layer - pv = layer_vol.placeVolume(slice_vol, Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); + pv = layer_vol.placeVolume(slice_vol, + Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); pv.addPhysVolID("slice", slice_num); slice_z += slice_thickness / 2.; // Going to end of slice ++slice_num; @@ -108,7 +109,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens // layer_z is increased by layer_thickness/2 at the start of the layer loop // This moves to the middle of the layer (location of placement) // It's then increased by layer_thickness/2 again to move to end of layer - pv = envelopeVol.placeVolume(layer_vol, Transform3D(RotationZYX(0, 0, 0), Position(0., 0., layer_z))); + pv = envelopeVol.placeVolume(layer_vol, + Transform3D(RotationZYX(0, 0, 0), Position(0., 0., layer_z))); pv.addPhysVolID("layer", layer_num); layer_num++; layer_z += layer_thickness / 2.; @@ -116,7 +118,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens } DetElement det(detName, detID); - Volume motherVol = desc.pickMotherVolume(det); + Volume motherVol = desc.pickMotherVolume(det); // Placing endcap in world volume auto tr = Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.)); diff --git a/src/EndcapFluxReturn_geo.cpp b/src/EndcapFluxReturn_geo.cpp index 91cf9ef80..40e50ab2e 100644 --- a/src/EndcapFluxReturn_geo.cpp +++ b/src/EndcapFluxReturn_geo.cpp @@ -11,52 +11,57 @@ #include "TVector3.h" #include "XML/Layering.h" -static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, [[maybe_unused]] dd4hep::SensitiveDetector sens) -{ - xml_det_t x_det = e; - int det_id = x_det.id(); - std::string det_name = x_det.nameStr(); - bool reflect = x_det.reflect(false); - dd4hep::Material air = description.air(); - xml_comp_t x_pos = x_det.position(); - dd4hep::Assembly assembly(det_name); - dd4hep::DetElement sdet(det_name, det_id); +static dd4hep::Ref_t create_detector(dd4hep::Detector& description, xml_h e, + [[maybe_unused]] dd4hep::SensitiveDetector sens) { + xml_det_t x_det = e; + int det_id = x_det.id(); + std::string det_name = x_det.nameStr(); + bool reflect = x_det.reflect(false); + dd4hep::Material air = description.air(); + xml_comp_t x_pos = x_det.position(); + dd4hep::Assembly assembly(det_name); + dd4hep::DetElement sdet(det_name, det_id); dd4hep::PlacedVolume pv; double disksGap = 0.0; // Looping through all the different layer sections for (xml_coll_t xc(x_det, _U(layer)); xc; ++xc) { - xml_comp_t x_layer = xc; + xml_comp_t x_layer = xc; - int layer_id = x_layer.id(); - double layer_rmax = x_layer.rmax(); - double layer_rmin = x_layer.rmin(); - double layer_thickness = x_layer.thickness(); - double layer_zpos = x_layer.zpos(); - - dd4hep::Material l_mat = description.material(x_layer.materialStr()); + int layer_id = x_layer.id(); + double layer_rmax = x_layer.rmax(); + double layer_rmin = x_layer.rmin(); + double layer_thickness = x_layer.thickness(); + double layer_zpos = x_layer.zpos(); + dd4hep::Material l_mat = description.material(x_layer.materialStr()); dd4hep::DetElement disk_ele("disk_ele", layer_id); - dd4hep::Volume disk(x_layer.nameStr(), dd4hep::Tube(layer_rmin, layer_rmax, layer_thickness / 2, 0.0, 2.0 * M_PI), air); + dd4hep::Volume disk(x_layer.nameStr(), + dd4hep::Tube(layer_rmin, layer_rmax, layer_thickness / 2, 0.0, 2.0 * M_PI), + air); disk.setVisAttributes(description.visAttributes(x_layer.visStr())); - dd4hep::Volume halfdisk("halfdisk", dd4hep::Tube(layer_rmin, layer_rmax, layer_thickness / 2, M_PI / 2, M_PI * 3 / 2), l_mat); + dd4hep::Volume halfdisk( + "halfdisk", + dd4hep::Tube(layer_rmin, layer_rmax, layer_thickness / 2, M_PI / 2, M_PI * 3 / 2), l_mat); halfdisk.setVisAttributes(description.visAttributes(x_layer.visStr())); dd4hep::PlacedVolume s_phv1 = disk.placeVolume(halfdisk, dd4hep::Position(-disksGap / 2, 0, 0)); s_phv1.addPhysVolID("halfdisk", 0); - dd4hep::PlacedVolume s_phv2 = disk.placeVolume(halfdisk, dd4hep::Transform3D(dd4hep::RotationZYX(M_PI, 0, 0), dd4hep::Position(+disksGap / 2, 0, 0))); + dd4hep::PlacedVolume s_phv2 = + disk.placeVolume(halfdisk, dd4hep::Transform3D(dd4hep::RotationZYX(M_PI, 0, 0), + dd4hep::Position(+disksGap / 2, 0, 0))); s_phv2.addPhysVolID("halfdisk", 1); - - pv = assembly.placeVolume(disk, dd4hep::Position(0, 0, (reflect ? -1.0 : 1.0) * (layer_thickness/2 + layer_zpos))); + pv = assembly.placeVolume( + disk, dd4hep::Position(0, 0, (reflect ? -1.0 : 1.0) * (layer_thickness / 2 + layer_zpos))); pv.addPhysVolID("layer", layer_id); disk_ele.setPlacement(pv); } // Get position and place volume - dd4hep::Position pos(x_pos.x(), x_pos.y(), x_pos.z()); + dd4hep::Position pos(x_pos.x(), x_pos.y(), x_pos.z()); pv = description.pickMotherVolume(sdet).placeVolume(assembly, pos); sdet.setPlacement(pv); return sdet; diff --git a/src/EndcapTOF_geo.cpp b/src/EndcapTOF_geo.cpp index 9246bff1e..c4edc64a8 100644 --- a/src/EndcapTOF_geo.cpp +++ b/src/EndcapTOF_geo.cpp @@ -25,14 +25,13 @@ using namespace dd4hep; using namespace dd4hep::rec; using namespace dd4hep::detail; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - int det_id = x_det.id(); - std::string det_name = x_det.nameStr(); - DetElement sdet(det_name, det_id); - Material air = description.material("Air"); - Material carbon = description.material("CarbonFiber"); +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { + xml_det_t x_det = e; + int det_id = x_det.id(); + std::string det_name = x_det.nameStr(); + DetElement sdet(det_name, det_id); + Material air = description.material("Air"); + Material carbon = description.material("CarbonFiber"); PlacedVolume pv; map<string, std::array<double, 2>> module_thicknesses; @@ -43,7 +42,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // Add the volume boundary material if configured for (xml_coll_t bmat(x_det, _Unicode(boundary_material)); bmat; ++bmat) { xml_comp_t x_boundary_material = bmat; - DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, "boundary_material"); + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, + "boundary_material"); } Assembly assembly(det_name); @@ -54,11 +54,11 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // now build the envelope for the detector xml_comp_t x_layer = x_det.child(_Unicode(layer)); xml_comp_t envelope = x_layer.child(_Unicode(envelope), false); - int lay_id = x_layer.id(); - string l_nam = x_layer.moduleStr(); - string lay_nam = det_name + _toString(x_layer.id(), "_layer%d"); - Tube lay_tub(envelope.rmin(), envelope.rmax(), envelope.length() / 2.0); - Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. + int lay_id = x_layer.id(); + string l_nam = x_layer.moduleStr(); + string lay_nam = det_name + _toString(x_layer.id(), "_layer%d"); + Tube lay_tub(envelope.rmin(), envelope.rmax(), envelope.length() / 2.0); + Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. zPos = envelope.zstart(); Position lay_pos(0, 0, 0); lay_vol.setVisAttributes(description.visAttributes(x_layer.visStr())); @@ -67,11 +67,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // the local coordinate systems of modules in dd4hep and acts differ // see http://acts.web.cern.ch/ACTS/latest/doc/group__DD4hepPlugins.html - auto& layerParams = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(lay_elt); + auto& layerParams = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(lay_elt); for (xml_coll_t lmat(x_layer, _Unicode(layer_material)); lmat; ++lmat) { xml_comp_t x_layer_material = lmat; - DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, "layer_material"); + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, + "layer_material"); } // dimensions of the modules (2x2 sensors) @@ -86,9 +88,9 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s xml_comp_t x_supp = x_det.child(_Unicode(support)); xml_comp_t x_supp_envelope = x_supp.child(_Unicode(envelope), false); - double total_thickness = 0; - xml_comp_t x_modFront = x_det.child(_Unicode(moduleFront)); - xml_comp_t x_modBack = x_det.child(_Unicode(moduleBack)); + double total_thickness = 0; + xml_comp_t x_modFront = x_det.child(_Unicode(moduleFront)); + xml_comp_t x_modBack = x_det.child(_Unicode(moduleBack)); // Compute module total thickness from components xml_coll_t ci(x_modFront, _U(module_component)); @@ -114,21 +116,23 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s float corner_x2 = xcoord - module_x / 2; float corner_y1 = ycoord + module_y / 2; float corner_y2 = ycoord - module_y / 2; - float maxRadius = std::max(std::max(std::hypot(corner_x1, corner_y1), std::hypot(corner_x2, corner_y2)), - std::max(std::hypot(corner_x1, corner_y2), std::hypot(corner_x2, corner_y1))); - float minRadius = std::min(std::min(std::hypot(corner_x1, corner_y1), std::hypot(corner_x2, corner_y2)), - std::min(std::hypot(corner_x1, corner_y2), std::hypot(corner_x2, corner_y1))); + float maxRadius = + std::max(std::max(std::hypot(corner_x1, corner_y1), std::hypot(corner_x2, corner_y2)), + std::max(std::hypot(corner_x1, corner_y2), std::hypot(corner_x2, corner_y1))); + float minRadius = + std::min(std::min(std::hypot(corner_x1, corner_y1), std::hypot(corner_x2, corner_y2)), + std::min(std::hypot(corner_x1, corner_y2), std::hypot(corner_x2, corner_y1))); if (maxRadius > envelope.rmax() || minRadius < envelope.rmin()) { continue; } - string module_name = Form("module%d_%d_%d", module, ix, iy); + string module_name = Form("module%d_%d_%d", module, ix, iy); DetElement mod_elt(lay_elt, module_name, module); // create individual sensor layers here string m_nam = Form("EndcapTOF_Module1_%d_%d", ix, iy); - int ncomponents = 0; + int ncomponents = 0; // the module assembly volume Assembly m_vol(m_nam); m_vol.setVisAttributes(description.visAttributes(x_modCurr.visStr())); @@ -137,24 +141,25 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s double thickness_sum = -total_thickness / 2.0; double thickness_carbonsupp = 0.0; for (xml_coll_t mci(x_modCurr, _U(module_component)); mci; ++mci, ++ncomponents) { - xml_comp_t x_comp = mci; - xml_comp_t x_pos = x_comp.position(false); - xml_comp_t x_rot = x_comp.rotation(false); - const string c_nam = Form("component_%d_%d", ix, iy); - Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); - Volume c_vol(c_nam, c_box, description.material(x_comp.materialStr())); + xml_comp_t x_comp = mci; + xml_comp_t x_pos = x_comp.position(false); + xml_comp_t x_rot = x_comp.rotation(false); + const string c_nam = Form("component_%d_%d", ix, iy); + Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); + Volume c_vol(c_nam, c_box, description.material(x_comp.materialStr())); if (x_comp.materialStr() == "CarbonFiber") { thickness_carbonsupp = x_comp.thickness(); } // Utility variable for the relative z-offset based off the previous components const double zoff = thickness_sum + x_comp.thickness() / 2.0; if (x_pos && x_rot) { - Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); + Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0)); pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); } else if (x_rot) { Position c_pos(0, 0, zoff); - pv = m_vol.placeVolume(c_vol, Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); + pv = m_vol.placeVolume( + c_vol, Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); } else if (x_pos) { pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff)); } else { @@ -168,7 +173,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s pv.addPhysVolID("idy", iy); c_vol.setSensitiveDetector(sens); module_thicknesses[m_nam] = {thickness_so_far + x_comp.thickness() / 2.0, - total_thickness - thickness_so_far - x_comp.thickness() / 2.0}; + total_thickness - thickness_so_far - + x_comp.thickness() / 2.0}; // -------- create a measurement plane for the tracking surface attched to the sensitive volume ----- Vector3D u(-1., 0., 0.); @@ -187,7 +193,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s DetElement comp_de(mod_elt, std::string("de_") + pv.volume().name(), module); comp_de.setPlacement(pv); - auto& comp_de_params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_de); + auto& comp_de_params = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_de); comp_de_params.set<string>("axis_definitions", "XYZ"); volSurfaceList(comp_de)->push_back(surf); @@ -202,10 +209,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s } } - const string suppb_nam = Form("suppbar_%d_%d", ix, iy); //_toString(ncomponents, "component%d"); - Box suppb_box((module_x + module_spacing) / 2, thickness_carbonsupp / 2, x_supp_envelope.length() / 2); - Volume suppb_vol(suppb_nam, suppb_box, carbon); - Transform3D trsupp(RotationZYX(0, 0, 0), Position(xcoord, ycoord + module_y / 2 - module_overlap / 2, 0)); + const string suppb_nam = + Form("suppbar_%d_%d", ix, iy); //_toString(ncomponents, "component%d"); + Box suppb_box((module_x + module_spacing) / 2, thickness_carbonsupp / 2, + x_supp_envelope.length() / 2); + Volume suppb_vol(suppb_nam, suppb_box, carbon); + Transform3D trsupp(RotationZYX(0, 0, 0), + Position(xcoord, ycoord + module_y / 2 - module_overlap / 2, 0)); suppb_vol.setVisAttributes(description, "AnlGray"); pv = lay_vol.placeVolume(suppb_vol, trsupp); @@ -222,7 +232,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // Create the PhysicalVolume for the layer. pv = assembly.placeVolume(lay_vol, lay_pos); // Place layer in mother pv.addPhysVolID("layer", lay_id); // Set the layer ID. - lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr()); + lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), + x_layer.visStr()); lay_elt.setPlacement(pv); pv = description.pickMotherVolume(sdet).placeVolume(assembly, Position(0, 0, zPos)); diff --git a/src/FieldMapB.cpp b/src/FieldMapB.cpp index 377b0fe7a..9858da120 100644 --- a/src/FieldMapB.cpp +++ b/src/FieldMapB.cpp @@ -34,25 +34,21 @@ using namespace dd4hep; // implementation of the field map class FieldMapB : public dd4hep::CartesianField::Object { - enum FieldCoord { - BrBz, - BxByBz - }; - + enum FieldCoord { BrBz, BxByBz }; public: - FieldMapB(const std::string& field_type_str = "magnetic", const std::string& coord_type_str = "BrBz"); + FieldMapB(const std::string& field_type_str = "magnetic", + const std::string& coord_type_str = "BrBz"); void Configure(std::vector<xml_comp_t> dimensions); void LoadMap(const std::string& map_file, float scale); - bool GetIndices(float R, float Z, int *idxR, int *idxZ, float *deltaR, float *deltaZ); - bool GetIndices(float X, float Y, float Z, int *idxX, int *idxY, int *idxZ, float *deltaX, float *deltaY, float *deltaZ); - void SetCoordTranslation(const Transform3D& tr) - { + bool GetIndices(float R, float Z, int* idxR, int* idxZ, float* deltaR, float* deltaZ); + bool GetIndices(float X, float Y, float Z, int* idxX, int* idxY, int* idxZ, float* deltaX, + float* deltaY, float* deltaZ); + void SetCoordTranslation(const Transform3D& tr) { coordTranslate = tr; coordTranslate_inv = tr.Inverse(); } - void SetFieldRotation(const Transform3D& tr) - { + void SetFieldRotation(const Transform3D& tr) { fieldRot = tr; fieldRot_inv = tr.Inverse(); } @@ -60,20 +56,20 @@ class FieldMapB : public dd4hep::CartesianField::Object { virtual void fieldComponents(const double* pos, double* field); private: - FieldCoord fieldCoord; // field coordinate type - Transform3D coordTranslate, coordTranslate_inv; // coord translation - Transform3D fieldRot, fieldRot_inv; // field rotation - std::vector<float> steps, mins, maxs; // B map cell info - int ir, ix, iy, iz; // lookup indices - float idx_1_f, idx_2_f, idx_3_f; // transient float indicies - float dr, dx, dy, dz; // deltas for interpolation - std::vector<std::vector<std::array<float, 2>>> Bvals_RZ; // B map values: {R}, {Z}, {Br,Bz} - std::vector<std::vector<std::vector<std::array<float, 3>>>> Bvals_XYZ; // B map values: {X}, {Y}, {Z}, {Bx,By,Bz} + FieldCoord fieldCoord; // field coordinate type + Transform3D coordTranslate, coordTranslate_inv; // coord translation + Transform3D fieldRot, fieldRot_inv; // field rotation + std::vector<float> steps, mins, maxs; // B map cell info + int ir, ix, iy, iz; // lookup indices + float idx_1_f, idx_2_f, idx_3_f; // transient float indicies + float dr, dx, dy, dz; // deltas for interpolation + std::vector<std::vector<std::array<float, 2>>> Bvals_RZ; // B map values: {R}, {Z}, {Br,Bz} + std::vector<std::vector<std::vector<std::array<float, 3>>>> + Bvals_XYZ; // B map values: {X}, {Y}, {Z}, {Bx,By,Bz} }; // constructor -FieldMapB::FieldMapB(const std::string& field_type_str, const std::string& coord_type_str) -{ +FieldMapB::FieldMapB(const std::string& field_type_str, const std::string& coord_type_str) { std::string ftype = field_type_str; for (auto& c : ftype) { c = tolower(c); @@ -86,42 +82,39 @@ FieldMapB::FieldMapB(const std::string& field_type_str, const std::string& coord field_type = CartesianField::ELECTRIC; } else { field_type = CartesianField::UNKNOWN; - printout(ERROR, "FieldMap","Unknown field type " + ftype); + printout(ERROR, "FieldMap", "Unknown field type " + ftype); } - if( coord_type_str.compare("BrBz") == 0 ) { // BrBz + if (coord_type_str.compare("BrBz") == 0) { // BrBz fieldCoord = FieldCoord::BrBz; - } - else { // BxByBz + } else { // BxByBz fieldCoord = FieldCoord::BxByBz; } } // fill field vector -void FieldMapB::Configure(std::vector<xml_comp_t> dimensions) -{ +void FieldMapB::Configure(std::vector<xml_comp_t> dimensions) { // Fill vectors with step size, min, max for each dimension - for( auto el : dimensions ) { - steps.push_back( el.step() ); - mins.push_back( getAttrOrDefault<float>(el, _Unicode(min), 0) ); - maxs.push_back( getAttrOrDefault<float>(el, _Unicode(max), 0) ); + for (auto el : dimensions) { + steps.push_back(el.step()); + mins.push_back(getAttrOrDefault<float>(el, _Unicode(min), 0)); + maxs.push_back(getAttrOrDefault<float>(el, _Unicode(max), 0)); } - if( fieldCoord == FieldCoord::BrBz ) { + if (fieldCoord == FieldCoord::BrBz) { // N bins increased by 1 beyond grid size to account for edge cases at upper limits - int nr = std::roundf( (maxs[0] - mins[0]) / steps[0] ) + 2; - int nz = std::roundf( (maxs[1] - mins[1]) / steps[1] ) + 2; + int nr = std::roundf((maxs[0] - mins[0]) / steps[0]) + 2; + int nz = std::roundf((maxs[1] - mins[1]) / steps[1]) + 2; Bvals_RZ.resize(nr); for (auto& B2 : Bvals_RZ) { B2.resize(nz); } - } - else { + } else { // N bins increased by 1 beyond grid size to account for edge cases at upper limits - int nx = std::roundf( (maxs[0] - mins[0]) / steps[0] ) + 2; - int ny = std::roundf( (maxs[1] - mins[1]) / steps[1] ) + 2; - int nz = std::roundf( (maxs[2] - mins[2]) / steps[2] ) + 2; + int nx = std::roundf((maxs[0] - mins[0]) / steps[0]) + 2; + int ny = std::roundf((maxs[1] - mins[1]) / steps[1]) + 2; + int nz = std::roundf((maxs[2] - mins[2]) / steps[2]) + 2; Bvals_XYZ.resize(nx); for (auto& B3 : Bvals_XYZ) { @@ -134,48 +127,46 @@ void FieldMapB::Configure(std::vector<xml_comp_t> dimensions) } // get RZ cell indices corresponding to point of interest -bool FieldMapB::GetIndices(float R, float Z, int *idxR, int *idxZ, float *deltaR, float *deltaZ) -{ +bool FieldMapB::GetIndices(float R, float Z, int* idxR, int* idxZ, float* deltaR, float* deltaZ) { // boundary check - if( R > maxs[0] || R < mins[0] || Z > maxs[1] || Z < mins[1] ) { + if (R > maxs[0] || R < mins[0] || Z > maxs[1] || Z < mins[1]) { return false; } // get indices - *deltaR = std::modf( (R - mins[0]) / steps[0], &idx_1_f ); - *deltaZ = std::modf( (Z - mins[1]) / steps[1], &idx_2_f ); - *idxR = static_cast<int>(idx_1_f); - *idxZ = static_cast<int>(idx_2_f); + *deltaR = std::modf((R - mins[0]) / steps[0], &idx_1_f); + *deltaZ = std::modf((Z - mins[1]) / steps[1], &idx_2_f); + *idxR = static_cast<int>(idx_1_f); + *idxZ = static_cast<int>(idx_2_f); return true; } // get XYZ cell indices corresponding to point of interest -bool FieldMapB::GetIndices(float X, float Y, float Z, int *idxX, int *idxY, int *idxZ, float *deltaX, float *deltaY, float *deltaZ) -{ +bool FieldMapB::GetIndices(float X, float Y, float Z, int* idxX, int* idxY, int* idxZ, + float* deltaX, float* deltaY, float* deltaZ) { // boundary check - if( X > maxs[0] || X < mins[0] || Y > maxs[1] || Y < mins[1] || Z > maxs[2] || Z < mins[2] ) { + if (X > maxs[0] || X < mins[0] || Y > maxs[1] || Y < mins[1] || Z > maxs[2] || Z < mins[2]) { return false; } // get indices - *deltaX = std::modf( (X - mins[0]) / steps[0], &idx_1_f ); - *deltaY = std::modf( (Y - mins[1]) / steps[1], &idx_2_f ); - *deltaZ = std::modf( (Z - mins[2]) / steps[2], &idx_3_f ); - *idxX = static_cast<int>(idx_1_f); - *idxY = static_cast<int>(idx_2_f); - *idxZ = static_cast<int>(idx_3_f); + *deltaX = std::modf((X - mins[0]) / steps[0], &idx_1_f); + *deltaY = std::modf((Y - mins[1]) / steps[1], &idx_2_f); + *deltaZ = std::modf((Z - mins[2]) / steps[2], &idx_3_f); + *idxX = static_cast<int>(idx_1_f); + *idxY = static_cast<int>(idx_2_f); + *idxZ = static_cast<int>(idx_3_f); return true; } // load data -void FieldMapB::LoadMap(const std::string& map_file, float scale) -{ - std::string line; +void FieldMapB::LoadMap(const std::string& map_file, float scale) { + std::string line; std::ifstream input(map_file); - if( ! input ) { - printout(ERROR,"FieldMapB", "FieldMapB Error: file " + map_file + " cannot be read."); + if (!input) { + printout(ERROR, "FieldMapB", "FieldMapB Error: file " + map_file + " cannot be read."); } std::vector<float> coord = {}; @@ -187,51 +178,45 @@ void FieldMapB::LoadMap(const std::string& map_file, float scale) coord.clear(); Bcomp.clear(); - if( fieldCoord == FieldCoord::BrBz) { + if (fieldCoord == FieldCoord::BrBz) { coord.resize(2); Bcomp.resize(2); iss >> coord[0] >> coord[1] >> Bcomp[0] >> Bcomp[1]; - if( ! GetIndices( coord[0], coord[1], &ir, &iz, &dr, &dz) ) { + if (!GetIndices(coord[0], coord[1], &ir, &iz, &dr, &dz)) { printout(WARNING, "FieldMapB", "coordinates out of range, skipped it."); + } else { // scale field + Bvals_RZ[ir][iz] = {Bcomp[0] * scale * float(tesla), Bcomp[1] * scale * float(tesla)}; } - else { // scale field - Bvals_RZ[ ir ][ iz ] = - { Bcomp[0] * scale * float(tesla), - Bcomp[1] * scale * float(tesla) }; - } - } - else { + } else { coord.resize(3); Bcomp.resize(3); iss >> coord[0] >> coord[1] >> coord[2] >> Bcomp[0] >> Bcomp[1] >> Bcomp[2]; - if( ! GetIndices(coord[0], coord[1], coord[2], &ix, &iy, &iz, &dx, &dy, &dz) ) { - printout(WARNING, "FieldMap","coordinates out of range, skipped it."); - } - else { // scale and rotate B field vector - auto B = ROOT::Math::XYZPoint( Bcomp[0], Bcomp[1], Bcomp[2] ); + if (!GetIndices(coord[0], coord[1], coord[2], &ix, &iy, &iz, &dx, &dy, &dz)) { + printout(WARNING, "FieldMap", "coordinates out of range, skipped it."); + } else { // scale and rotate B field vector + auto B = ROOT::Math::XYZPoint(Bcomp[0], Bcomp[1], Bcomp[2]); B *= scale * float(tesla); - B = fieldRot * B; - Bvals_XYZ[ ix ][ iy ][ iz ] = { float(B.x()), float(B.y()), float(B.z()) }; + B = fieldRot * B; + Bvals_XYZ[ix][iy][iz] = {float(B.x()), float(B.y()), float(B.z())}; } } } } // get field components -void FieldMapB::fieldComponents(const double* pos, double* field) -{ +void FieldMapB::fieldComponents(const double* pos, double* field) { // coordinate conversion auto p = coordTranslate_inv * ROOT::Math::XYZPoint(pos[0], pos[1], pos[2]); - if( fieldCoord == FieldCoord::BrBz ) { + if (fieldCoord == FieldCoord::BrBz) { // coordinates conversion const float r = sqrt(p.x() * p.x() + p.y() * p.y()); const float z = p.z(); const float phi = atan2(p.y(), p.x()); - if( ! GetIndices(r, z, &ir, &iz, &dr, &dz) ) { + if (!GetIndices(r, z, &ir, &iz, &dr, &dz)) { // out of range return; } @@ -239,42 +224,40 @@ void FieldMapB::fieldComponents(const double* pos, double* field) // p1 p3 // p // p0 p2 - auto& p0 = Bvals_RZ[ ir ][ iz ]; - auto& p1 = Bvals_RZ[ ir ][ iz + 1 ]; - auto& p2 = Bvals_RZ[ ir + 1 ][ iz ]; - auto& p3 = Bvals_RZ[ ir + 1 ][ iz + 1 ]; + auto& p0 = Bvals_RZ[ir][iz]; + auto& p1 = Bvals_RZ[ir][iz + 1]; + auto& p2 = Bvals_RZ[ir + 1][iz]; + auto& p3 = Bvals_RZ[ir + 1][iz + 1]; // Bilinear interpolation - float Br = p0[0] * (1 - dr) * (1 - dz) + p1[0] * (1 - dr) * dz - + p2[0] * dr * (1 - dz) + p3[0] * dr * dz; + float Br = p0[0] * (1 - dr) * (1 - dz) + p1[0] * (1 - dr) * dz + p2[0] * dr * (1 - dz) + + p3[0] * dr * dz; - float Bz = p0[1] * (1 - dr) * (1 - dz) + p1[1] * (1 - dr) * dz - + p2[1] * dr * (1 - dz) + p3[1] * dr * dz; + float Bz = p0[1] * (1 - dr) * (1 - dz) + p1[1] * (1 - dr) * dz + p2[1] * dr * (1 - dz) + + p3[1] * dr * dz; // convert Br Bz to Bx By Bz and rotate field auto B = fieldRot * ROOT::Math::XYZPoint(Br * cos(phi), Br * sin(phi), Bz); field[0] += B.x(); field[1] += B.y(); field[2] += B.z(); - } - else { // BxByBz + } else { // BxByBz - if( ! GetIndices(p.x(), p.y(), p.z(), &ix, &iy, &iz, &dx, &dy, &dz) ) { + if (!GetIndices(p.x(), p.y(), p.z(), &ix, &iy, &iz, &dx, &dy, &dz)) { return; // out of range } float b[3] = {0}; - for(int comp = 0; comp < 3; comp++) { // field component loop + for (int comp = 0; comp < 3; comp++) { // field component loop // Trilinear interpolation // First along X, along 4 lines - float b00 = Bvals_XYZ[ ix ][ iy ][ iz ][comp] * (1 - dx) - + Bvals_XYZ[ ix + 1 ][ iy ][ iz ][comp] * dx; - float b01 = Bvals_XYZ[ ix ][ iy ][ iz + 1 ][comp] * (1 - dx) - + Bvals_XYZ[ ix + 1 ][ iy ][ iz + 1 ][comp] * dx; - float b10 = Bvals_XYZ[ ix ][ iy + 1 ][ iz ][comp] * (1 - dx) - + Bvals_XYZ[ ix + 1 ][ iy + 1 ][ iz ][comp] * dx; - float b11 = Bvals_XYZ[ ix ][ iy + 1 ][ iz + 1 ][comp] * (1 - dx) - + Bvals_XYZ[ ix + 1 ][ iy + 1 ][ iz + 1 ][comp] * dx; + float b00 = Bvals_XYZ[ix][iy][iz][comp] * (1 - dx) + Bvals_XYZ[ix + 1][iy][iz][comp] * dx; + float b01 = + Bvals_XYZ[ix][iy][iz + 1][comp] * (1 - dx) + Bvals_XYZ[ix + 1][iy][iz + 1][comp] * dx; + float b10 = + Bvals_XYZ[ix][iy + 1][iz][comp] * (1 - dx) + Bvals_XYZ[ix + 1][iy + 1][iz][comp] * dx; + float b11 = Bvals_XYZ[ix][iy + 1][iz + 1][comp] * (1 - dx) + + Bvals_XYZ[ix + 1][iy + 1][iz + 1][comp] * dx; // Next along Y, along 2 lines float b0 = b00 * (1 - dy) + b10 * dy; float b1 = b01 * (1 - dy) + b11 * dy; @@ -292,18 +275,18 @@ void FieldMapB::fieldComponents(const double* pos, double* field) } // assign the field map to CartesianField -static Ref_t create_field_map_b(Detector& /*lcdd*/, xml::Handle_t handle) -{ +static Ref_t create_field_map_b(Detector& /*lcdd*/, xml::Handle_t handle) { xml_comp_t x_par(handle); if (!x_par.hasAttr(_Unicode(field_map))) { - throw std::runtime_error("FieldMapB Error: must have an xml attribute \"field_map\" for the field map."); + throw std::runtime_error( + "FieldMapB Error: must have an xml attribute \"field_map\" for the field map."); } CartesianField field; - std::string field_type = x_par.attr<std::string>(_Unicode(field_type)); + std::string field_type = x_par.attr<std::string>(_Unicode(field_type)); - std::string coord_type = x_par.attr<std::string>(_Unicode(coord_type)); + std::string coord_type = x_par.attr<std::string>(_Unicode(coord_type)); // dimensions xml_comp_t x_dim = x_par.dimensions(); @@ -311,16 +294,14 @@ static Ref_t create_field_map_b(Detector& /*lcdd*/, xml::Handle_t handle) // vector of dimension parameters: step, min, max std::vector<xml_comp_t> dimensions; - if( coord_type.compare("BrBz") == 0 ) { - dimensions.push_back( x_dim.child(_Unicode(R)) ); - dimensions.push_back( x_dim.child(_Unicode(Z)) ); - } - else if( coord_type.compare("BxByBz") == 0 ) { - dimensions.push_back( x_dim.child(_Unicode(X)) ); - dimensions.push_back( x_dim.child(_Unicode(Y)) ); - dimensions.push_back( x_dim.child(_Unicode(Z)) ); - } - else { + if (coord_type.compare("BrBz") == 0) { + dimensions.push_back(x_dim.child(_Unicode(R))); + dimensions.push_back(x_dim.child(_Unicode(Z))); + } else if (coord_type.compare("BxByBz") == 0) { + dimensions.push_back(x_dim.child(_Unicode(X))); + dimensions.push_back(x_dim.child(_Unicode(Y))); + dimensions.push_back(x_dim.child(_Unicode(Z))); + } else { printout(ERROR, "FieldMapB", "Coordinate type: " + coord_type + ", is not BrBz nor BxByBz"); std::_Exit(EXIT_FAILURE); } @@ -340,11 +321,11 @@ static Ref_t create_field_map_b(Detector& /*lcdd*/, xml::Handle_t handle) } auto map = new FieldMapB(field_type, coord_type); - map->Configure( dimensions ); + map->Configure(dimensions); // translation, rotation static float deg2r = ROOT::Math::Pi() / 180.; - RotationZYX rot(0., 0., 0.); + RotationZYX rot(0., 0., 0.); if (x_dim.hasChild(_Unicode(rotationField))) { xml_comp_t rot_dim = x_dim.child(_Unicode(rotationField)); rot = RotationZYX(rot_dim.z() * deg2r, rot_dim.y() * deg2r, rot_dim.x() * deg2r); @@ -355,8 +336,8 @@ static Ref_t create_field_map_b(Detector& /*lcdd*/, xml::Handle_t handle) xml_comp_t trans_dim = x_dim.child(_Unicode(translationCoord)); trans = Translation3D(trans_dim.x(), trans_dim.y(), trans_dim.z()); } - map->SetCoordTranslation( Transform3D(trans) ); - map->SetFieldRotation( Transform3D(rot) ); + map->SetCoordTranslation(Transform3D(trans)); + map->SetFieldRotation(Transform3D(rot)); map->LoadMap(field_map_file, field_map_scale); field.assign(map, x_par.nameStr(), "FieldMapB"); diff --git a/src/FileLoader.cpp b/src/FileLoader.cpp index 13e1c3d82..39081b9a0 100644 --- a/src/FileLoader.cpp +++ b/src/FileLoader.cpp @@ -18,21 +18,20 @@ using namespace dd4hep; -void usage(int argc, char** argv) -{ - std::cerr << "Usage: -plugin <name> -arg [-arg] \n" - " cache:<string> cache location (may be read-only) \n" - " file:<string> file location \n" - " url:<string> url location \n" - " cmd:<string> download command with {0} for url, {1} for output \n" - "\tArguments given: " - << arguments(argc, argv) << std::endl; +void usage(int argc, char** argv) { + std::cerr + << "Usage: -plugin <name> -arg [-arg] \n" + " cache:<string> cache location (may be read-only) \n" + " file:<string> file location \n" + " url:<string> url location \n" + " cmd:<string> download command with {0} for url, {1} for output \n" + "\tArguments given: " + << arguments(argc, argv) << std::endl; std::exit(EINVAL); } // Plugin to download files -long load_file(Detector& /* desc */, int argc, char** argv) -{ +long load_file(Detector& /* desc */, int argc, char** argv) { // argument parsing std::string cache, file, url; for (int i = 0; i < argc && argv[i]; ++i) { diff --git a/src/FileLoaderHelper.h b/src/FileLoaderHelper.h index 001473f46..5680febc0 100644 --- a/src/FileLoaderHelper.h +++ b/src/FileLoaderHelper.h @@ -18,16 +18,15 @@ namespace fs = std::filesystem; -using dd4hep::printout; using dd4hep::ERROR, dd4hep::WARNING, dd4hep::INFO; +using dd4hep::printout; namespace FileLoaderHelper { - static constexpr const char* const kCommand = "curl --retry 5 --location --fail {0} --output {1}"; +static constexpr const char* const kCommand = "curl --retry 5 --location --fail {0} --output {1}"; } // Function to download files -inline void EnsureFileFromURLExists(std::string url, std::string file, std::string cache_str = "") -{ +inline void EnsureFileFromURLExists(std::string url, std::string file, std::string cache_str = "") { // parse cache for environment variables auto pos = std::string::npos; while ((pos = cache_str.find('$')) != std::string::npos) { @@ -39,7 +38,7 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri if (after == std::string::npos) after = cache_str.size(); // cache ends on env var const std::string env_name(cache_str.substr(pos + 1, after - pos - 1)); - auto env_ptr = std::getenv(env_name.c_str()); + auto env_ptr = std::getenv(env_name.c_str()); const std::string env_value(env_ptr != nullptr ? env_ptr : ""); cache_str.erase(pos, after - pos); cache_str.insert(pos, env_value); @@ -47,16 +46,17 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri } // tokenize cache on regex - std::regex cache_sep(":"); + std::regex cache_sep(":"); std::sregex_token_iterator cache_iter(cache_str.begin(), cache_str.end(), cache_sep, -1); std::sregex_token_iterator cache_end; - std::vector<std::string> cache_vec(cache_iter, cache_end); + std::vector<std::string> cache_vec(cache_iter, cache_end); // create file path fs::path file_path(file); // create hash from url, hex of unsigned long long - std::string hash = fmt::format("{:016x}", dd4hep::detail::hash64(url)); // TODO: Use c++20 std::fmt + std::string hash = + fmt::format("{:016x}", dd4hep::detail::hash64(url)); // TODO: Use c++20 std::fmt // create file parent path, if not exists fs::path parent_path = file_path.parent_path(); @@ -88,13 +88,14 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri fs::path cache_path(cache); printout(INFO, "FileLoader", "cache " + cache_path.string()); if (fs::exists(cache_path)) { - auto check_path = [&](const fs::path &cache_dir_path) { + auto check_path = [&](const fs::path& cache_dir_path) { printout(INFO, "FileLoader", "checking " + cache_dir_path.string()); fs::path cache_hash_path = cache_dir_path / hash; if (fs::exists(cache_hash_path)) { // symlink hash to cache/.../hash printout(INFO, "FileLoader", - "file " + file + " with hash " + hash + " found in " + cache_hash_path.string()); + "file " + file + " with hash " + hash + " found in " + + cache_hash_path.string()); fs::path link_target; if (cache_hash_path.is_absolute()) { link_target = cache_hash_path; @@ -130,7 +131,8 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri // if hash does not exist, we try to retrieve file from url if (!fs::exists(hash_path)) { - std::string cmd = fmt::format(FileLoaderHelper::kCommand, url, hash_path.c_str()); // TODO: Use c++20 std::fmt + std::string cmd = + fmt::format(FileLoaderHelper::kCommand, url, hash_path.c_str()); // TODO: Use c++20 std::fmt printout(INFO, "FileLoader", "downloading " + file + " as hash " + hash + " with " + cmd); // run cmd auto ret = std::system(cmd.c_str()); @@ -138,7 +140,8 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri printout(ERROR, "FileLoader", "unable to run the download command " + cmd); printout(ERROR, "FileLoader", "the return value was ", ret); printout(ERROR, "FileLoader", "hint: check the command and try running manually"); - printout(ERROR, "FileLoader", "hint: allow insecure connections on some systems with the flag -k"); + printout(ERROR, "FileLoader", + "hint: allow insecure connections on some systems with the flag -k"); std::_Exit(EXIT_FAILURE); } } @@ -155,18 +158,24 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri // link points to incorrect path if (fs::remove(file_path) == false) { printout(ERROR, "FileLoader", "unable to remove symlink " + file_path.string()); - printout(ERROR, "FileLoader", "we tried to create a symlink " + file_path.string() + " to the actual resource, " + - "but a symlink already exists there and points to an incorrect location"); - printout(ERROR, "FileLoader", "hint: this may be resolved by removing directory " + parent_path.string()); - printout(ERROR, "FileLoader", "hint: or in that directory removing the file or link " + file_path.string()); + printout(ERROR, "FileLoader", + "we tried to create a symlink " + file_path.string() + + " to the actual resource, " + + "but a symlink already exists there and points to an incorrect location"); + printout(ERROR, "FileLoader", + "hint: this may be resolved by removing directory " + parent_path.string()); + printout(ERROR, "FileLoader", + "hint: or in that directory removing the file or link " + file_path.string()); std::_Exit(EXIT_FAILURE); } } } else { // file exists but not symlink - printout(ERROR, "FileLoader", "file " + file_path.string() + " already exists but is not a symlink"); - printout(ERROR, "FileLoader", "we tried to create a symlink " + file_path.string() + " to the actual resource, " + - "but a file already exists there and we will not remove it automatically"); + printout(ERROR, "FileLoader", + "file " + file_path.string() + " already exists but is not a symlink"); + printout(ERROR, "FileLoader", + "we tried to create a symlink " + file_path.string() + " to the actual resource, " + + "but a file already exists there and we will not remove it automatically"); printout(ERROR, "FileLoader", "hint: backup the file, remove it manually, and retry"); std::_Exit(EXIT_FAILURE); } @@ -178,15 +187,20 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri // use new path from hash so file link is local fs::create_symlink(fs::path(hash), file_path); } catch (const fs::filesystem_error&) { - printout(ERROR, "FileLoader", "unable to link from " + file_path.string() + " to " + hash_path.string()); + printout(ERROR, "FileLoader", + "unable to link from " + file_path.string() + " to " + hash_path.string()); printout(ERROR, "FileLoader", "check permissions and retry"); std::_Exit(EXIT_FAILURE); } // final check of the file size if (fs::file_size(file_path) == 0) { - printout(ERROR, "FileLoader", "zero file size of symlink from " + file_path.string() + " to (ultimately) " + fs::canonical(file_path).string()); - printout(ERROR, "FileLoader", "hint: check whether the file " + fs::canonical(file_path).string() + " has any content"); + printout(ERROR, "FileLoader", + "zero file size of symlink from " + file_path.string() + " to (ultimately) " + + fs::canonical(file_path).string()); + printout(ERROR, "FileLoader", + "hint: check whether the file " + fs::canonical(file_path).string() + + " has any content"); printout(ERROR, "FileLoader", "hint: check whether the URL " + url + " has any content"); std::_Exit(EXIT_FAILURE); } diff --git a/src/ForwardRomanPot_geo.cpp b/src/ForwardRomanPot_geo.cpp index 356f73bfb..f3e9e2b50 100644 --- a/src/ForwardRomanPot_geo.cpp +++ b/src/ForwardRomanPot_geo.cpp @@ -10,57 +10,56 @@ using namespace dd4hep::detail; using Placements = vector<PlacedVolume>; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { xml_det_t x_det = e; // Material air = description.air(); - Material vacuum = description.vacuum(); - string det_name = x_det.nameStr(); - xml::Component pos = x_det.position(); - xml::Component rot = x_det.rotation(); - DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name); + Material vacuum = description.vacuum(); + string det_name = x_det.nameStr(); + xml::Component pos = x_det.position(); + xml::Component rot = x_det.rotation(); + DetElement sdet(det_name, x_det.id()); + Assembly assembly(det_name); sens.setType("tracker"); PlacedVolume pv; - map<string, Volume> modules; + map<string, Volume> modules; map<string, Placements> sensitives; - map<string, Volume> module_assemblies; + map<string, Volume> module_assemblies; int m_id = 0; // mi ~ module iterator for (xml_coll_t mi(x_det, _U(module)); mi; ++mi, ++m_id) { - xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); - double mod_width = getAttrOrDefault<double>(x_mod, _U(width), 3.2 * cm); - double mod_height = getAttrOrDefault<double>(x_mod, _U(height), 3.2 * cm); - double mod_total_thickness = 0.; + xml_comp_t x_mod = mi; + string m_nam = x_mod.nameStr(); + double mod_width = getAttrOrDefault<double>(x_mod, _U(width), 3.2 * cm); + double mod_height = getAttrOrDefault<double>(x_mod, _U(height), 3.2 * cm); + double mod_total_thickness = 0.; xml_coll_t ci(x_mod, _U(module_component)); for (ci.reset(), mod_total_thickness = 0.0; ci; ++ci) mod_total_thickness += xml_comp_t(ci).thickness(); - Box m_solid(mod_width / 2.0, mod_height / 2.0, mod_total_thickness / 2.0); + Box m_solid(mod_width / 2.0, mod_height / 2.0, mod_total_thickness / 2.0); Volume m_volume(m_nam, m_solid, vacuum); //set to AnlGold temporarily for future RP troubleshooting //m_volume.setVisAttributes(description.visAttributes(x_mod.visStr())); m_volume.setVisAttributes(description.visAttributes("AnlGold")); double comp_z_pos = -mod_total_thickness / 2.0; - int n_sensor = 1; - int c_id; + int n_sensor = 1; + int c_id; for (ci.reset(), n_sensor = 1, c_id = 0; ci; ++ci, ++c_id) { - xml_comp_t c = ci; - double c_thick = c.thickness(); - double comp_x = getAttrOrDefault<double>(c, _Unicode(width), mod_width); - double comp_y = getAttrOrDefault<double>(c, _Unicode(height), mod_height); + xml_comp_t c = ci; + double c_thick = c.thickness(); + double comp_x = getAttrOrDefault<double>(c, _Unicode(width), mod_width); + double comp_y = getAttrOrDefault<double>(c, _Unicode(height), mod_height); - Material c_mat = description.material(c.materialStr()); - string c_name = _toString(c_id, "RP_component%d"); + Material c_mat = description.material(c.materialStr()); + string c_name = _toString(c_id, "RP_component%d"); - Box comp_s1(comp_x / 2.0, comp_y / 2.0, c_thick / 2.0); - Solid comp_shape = comp_s1; + Box comp_s1(comp_x / 2.0, comp_y / 2.0, c_thick / 2.0); + Solid comp_shape = comp_s1; Volume c_vol(c_name, comp_shape, c_mat); c_vol.setVisAttributes(description.visAttributes(c.visStr())); @@ -86,9 +85,9 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s std::map<std::string, DetElement> module_assembly_delements; // module assemblies for (xml_coll_t ma(x_det, _Unicode(module_assembly)); ma; ++ma) { - xml_comp_t x_ma = ma; - string ma_name = x_ma.nameStr(); - Assembly ma_vol(ma_name); + xml_comp_t x_ma = ma; + string ma_name = x_ma.nameStr(); + Assembly ma_vol(ma_name); DetElement ma_de(ma_name, x_det.id()); module_assemblies[ma_name] = ma_vol; module_assembly_delements[ma_name] = ma_de; @@ -96,15 +95,15 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s int i_mod = 0; // array of modules for (xml_coll_t ai(x_ma, _Unicode(array)); ai; ++ai) { - xml_comp_t x_array = ai; - double nx = getAttrOrDefault<double>(x_array, _Unicode(nx), 1); - double ny = getAttrOrDefault<double>(x_array, _Unicode(ny), 1); - double dz = getAttrOrDefault<double>(x_array, _Unicode(dz), 0 * mm); - double arr_width = getAttrOrDefault<double>(x_array, _Unicode(width), 3.2 * cm); - double arr_height = getAttrOrDefault<double>(x_array, _Unicode(height), 3.2 * cm); + xml_comp_t x_array = ai; + double nx = getAttrOrDefault<double>(x_array, _Unicode(nx), 1); + double ny = getAttrOrDefault<double>(x_array, _Unicode(ny), 1); + double dz = getAttrOrDefault<double>(x_array, _Unicode(dz), 0 * mm); + double arr_width = getAttrOrDefault<double>(x_array, _Unicode(width), 3.2 * cm); + double arr_height = getAttrOrDefault<double>(x_array, _Unicode(height), 3.2 * cm); std::string arr_module = getAttrOrDefault<std::string>(x_array, _Unicode(module), ""); // TODO: add check here - auto arr_vol = modules[arr_module]; + auto arr_vol = modules[arr_module]; Placements& sensVols = sensitives[arr_module]; double arr_x_delta = arr_width / double(nx); @@ -127,7 +126,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s mod_de.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_de(mod_de, std::string("de_") + sens_pv.volume().name(), ic + 1); + DetElement comp_de(mod_de, std::string("de_") + sens_pv.volume().name(), ic + 1); comp_de.setPlacement(sens_pv); // Acts::ActsExtension* sensorExtension = new Acts::ActsExtension(); //// sensorExtension->addType("sensor", "detector"); @@ -144,9 +143,9 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s int l_num = 0; for (xml_coll_t i(x_det, _U(layer)); i; ++i, ++l_num) { xml_comp_t x_layer = i; - string l_nam = det_name + _toString(l_num, "_layer%d"); + string l_nam = det_name + _toString(l_num, "_layer%d"); xml_comp_t l_pos = x_layer.position(false); - Assembly l_vol(l_nam); //(l_nam, l_box, air); + Assembly l_vol(l_nam); //(l_nam, l_box, air); Position layer_pos(0, 0, 0); if (l_pos) { @@ -154,7 +153,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s } DetElement layer(sdet, l_nam + "_pos", l_num); - int i_assembly = 1; + int i_assembly = 1; xml_coll_t ci(x_layer, _U(component)); for (ci.reset(); ci; ++ci) { xml_comp_t x_comp = ci; @@ -165,7 +164,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s auto comp_vol = module_assemblies[comp_assembly]; // auto de = ; - auto comp_de = module_assembly_delements[comp_assembly].clone(comp_assembly + std::to_string(l_num)); + auto comp_de = + module_assembly_delements[comp_assembly].clone(comp_assembly + std::to_string(l_num)); if (c_pos) { pv = l_vol.placeVolume(comp_vol, Position(c_pos.x(), c_pos.y(), c_pos.z())); } else { @@ -190,7 +190,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // pv = description.pickMotherVolume(sdet).placeVolume(assembly, // Position(pos.x(), pos.y(), pos.z())); - Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), + Position(pos.x(), pos.y(), pos.z())); // pv = description.pickMotherVolume(sdet).placeVolume(assembly, // Position(pos.x(), pos.y(), pos.z())); pv = description.pickMotherVolume(sdet).placeVolume(assembly, posAndRot); diff --git a/src/GeometryHelper.cpp b/src/GeometryHelper.cpp index eb3438e2f..c0208502a 100644 --- a/src/GeometryHelper.cpp +++ b/src/GeometryHelper.cpp @@ -5,168 +5,169 @@ namespace ip6::geo { - Position get_xml_xyz(xml_coll_t& comp, dd4hep::xml::Strng_t name) - { - Position pos(0., 0., 0.); - if (comp.hasChild(name)) { - auto child = comp.child(name); - pos.SetX(dd4hep::getAttrOrDefault<double>(child, _Unicode(x), 0.)); - pos.SetY(dd4hep::getAttrOrDefault<double>(child, _Unicode(y), 0.)); - pos.SetZ(dd4hep::getAttrOrDefault<double>(child, _Unicode(z), 0.)); - } - return pos; +Position get_xml_xyz(xml_coll_t& comp, dd4hep::xml::Strng_t name) { + Position pos(0., 0., 0.); + if (comp.hasChild(name)) { + auto child = comp.child(name); + pos.SetX(dd4hep::getAttrOrDefault<double>(child, _Unicode(x), 0.)); + pos.SetY(dd4hep::getAttrOrDefault<double>(child, _Unicode(y), 0.)); + pos.SetZ(dd4hep::getAttrOrDefault<double>(child, _Unicode(z), 0.)); } - - // place modules, id must be provided - tuple<int, int> - add_individuals(function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, - Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int sid) - { - auto [modVol, modSize] = build_module(desc, plm, sens); - int sector_id = dd4hep::getAttrOrDefault<int>(plm, _Unicode(sector), sid); - int nmodules = 0; - for (xml_coll_t pl(plm, _Unicode(placement)); pl; ++pl) { - Position pos(dd4hep::getAttrOrDefault<double>(pl, _Unicode(x), 0.), - dd4hep::getAttrOrDefault<double>(pl, _Unicode(y), 0.), - dd4hep::getAttrOrDefault<double>(pl, _Unicode(z), 0.)); - Position rot(dd4hep::getAttrOrDefault<double>(pl, _Unicode(rotx), 0.), - dd4hep::getAttrOrDefault<double>(pl, _Unicode(roty), 0.), - dd4hep::getAttrOrDefault<double>(pl, _Unicode(rotz), 0.)); - auto mid = pl.attr<int>(_Unicode(id)); - Transform3D tr = Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x()); - auto modPV = env.placeVolume(modVol, tr); - modPV.addPhysVolID("sector", sector_id).addPhysVolID("module", mid); - nmodules++; - } - - return {sector_id, nmodules}; + return pos; +} + +// place modules, id must be provided +tuple<int, int> add_individuals( + function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, + Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int sid) { + auto [modVol, modSize] = build_module(desc, plm, sens); + int sector_id = dd4hep::getAttrOrDefault<int>(plm, _Unicode(sector), sid); + int nmodules = 0; + for (xml_coll_t pl(plm, _Unicode(placement)); pl; ++pl) { + Position pos(dd4hep::getAttrOrDefault<double>(pl, _Unicode(x), 0.), + dd4hep::getAttrOrDefault<double>(pl, _Unicode(y), 0.), + dd4hep::getAttrOrDefault<double>(pl, _Unicode(z), 0.)); + Position rot(dd4hep::getAttrOrDefault<double>(pl, _Unicode(rotx), 0.), + dd4hep::getAttrOrDefault<double>(pl, _Unicode(roty), 0.), + dd4hep::getAttrOrDefault<double>(pl, _Unicode(rotz), 0.)); + auto mid = pl.attr<int>(_Unicode(id)); + Transform3D tr = + Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x()); + auto modPV = env.placeVolume(modVol, tr); + modPV.addPhysVolID("sector", sector_id).addPhysVolID("module", mid); + nmodules++; } - // place disk of modules - tuple<int, int> add_disk(function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, - Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int sid) - { - auto [modVol, modSize] = build_module(desc, plm, sens); - int sector_id = dd4hep::getAttrOrDefault<int>(plm, _Unicode(sector), sid); - int id_begin = dd4hep::getAttrOrDefault<int>(plm, _Unicode(id_begin), 1); - double rmin = plm.attr<double>(_Unicode(rmin)); - double rintermediate = plm.attr<double>(_Unicode(rintermediate)); - double r_envelopeclearance = dd4hep::getAttrOrDefault<int>(plm, _Unicode(r_envelopeclearance), 0); - double phi_envelopeclearance = dd4hep::getAttrOrDefault<int>(plm, _Unicode(phi_envelopeclearance), 0); - double rmax = plm.attr<double>(_Unicode(rmax)); - double phimin = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimin), 0.); - double phimax = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimax), 2. * M_PI); - - // placement inside mother - auto pos = get_xml_xyz(plm, _Unicode(position)); - auto rot = get_xml_xyz(plm, _Unicode(rotation)); - - // optional envelope volume - bool has_envelope = dd4hep::getAttrOrDefault<bool>(plm, _Unicode(envelope), false); - Material material = desc.material(dd4hep::getAttrOrDefault<string>(plm, _U(material), "Air")); - Tube inner_solid(rmin, rintermediate + r_envelopeclearance, modSize.z() / 2.0, 0, 2. * M_PI); - Tube outer_solid(rintermediate, rmax + r_envelopeclearance, modSize.z() / 2.0, phimin - phi_envelopeclearance, - phimax + phi_envelopeclearance); - UnionSolid solid(inner_solid, outer_solid); - Volume env_vol(string(env.name()) + "_envelope", solid, material); - Transform3D tr_global = RotationZYX(rot.z(), rot.y(), rot.x()) * Translation3D(pos.x(), pos.y(), pos.z()); - if (has_envelope) { - env.placeVolume(env_vol, tr_global); - } - - // local placement of modules - int mid = 0; - auto points = fillRectangles({0., 0.}, modSize.x(), modSize.y(), rmin, rintermediate, rmax, phimin, phimax); - for (auto& p : points) { - Transform3D tr_local = RotationZYX(0.0, 0.0, 0.0) * Translation3D(p.x(), p.y(), 0.0); - auto modPV = - (has_envelope ? env_vol.placeVolume(modVol, tr_local) : env.placeVolume(modVol, tr_global * tr_local)); - modPV.addPhysVolID("sector", sector_id).addPhysVolID("module", id_begin + mid++); - } - return {sector_id, mid}; + return {sector_id, nmodules}; +} + +// place disk of modules +tuple<int, int> +add_disk(function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, + Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int sid) { + auto [modVol, modSize] = build_module(desc, plm, sens); + int sector_id = dd4hep::getAttrOrDefault<int>(plm, _Unicode(sector), sid); + int id_begin = dd4hep::getAttrOrDefault<int>(plm, _Unicode(id_begin), 1); + double rmin = plm.attr<double>(_Unicode(rmin)); + double rintermediate = plm.attr<double>(_Unicode(rintermediate)); + double r_envelopeclearance = dd4hep::getAttrOrDefault<int>(plm, _Unicode(r_envelopeclearance), 0); + double phi_envelopeclearance = + dd4hep::getAttrOrDefault<int>(plm, _Unicode(phi_envelopeclearance), 0); + double rmax = plm.attr<double>(_Unicode(rmax)); + double phimin = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimin), 0.); + double phimax = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimax), 2. * M_PI); + + // placement inside mother + auto pos = get_xml_xyz(plm, _Unicode(position)); + auto rot = get_xml_xyz(plm, _Unicode(rotation)); + + // optional envelope volume + bool has_envelope = dd4hep::getAttrOrDefault<bool>(plm, _Unicode(envelope), false); + Material material = desc.material(dd4hep::getAttrOrDefault<string>(plm, _U(material), "Air")); + Tube inner_solid(rmin, rintermediate + r_envelopeclearance, modSize.z() / 2.0, 0, 2. * M_PI); + Tube outer_solid(rintermediate, rmax + r_envelopeclearance, modSize.z() / 2.0, + phimin - phi_envelopeclearance, phimax + phi_envelopeclearance); + UnionSolid solid(inner_solid, outer_solid); + Volume env_vol(string(env.name()) + "_envelope", solid, material); + Transform3D tr_global = + RotationZYX(rot.z(), rot.y(), rot.x()) * Translation3D(pos.x(), pos.y(), pos.z()); + if (has_envelope) { + env.placeVolume(env_vol, tr_global); } - // check if a 2d point is already in the container - bool already_placed(const Point& p, const vector<Point>& vec, double xs = 1.0, double ys = 1.0, double tol = 1e-6) - { - for (auto& pt : vec) { - if ((std::abs(pt.x() - p.x()) / xs < tol) && std::abs(pt.y() - p.y()) / ys < tol) { - return true; - } + // local placement of modules + int mid = 0; + auto points = + fillRectangles({0., 0.}, modSize.x(), modSize.y(), rmin, rintermediate, rmax, phimin, phimax); + for (auto& p : points) { + Transform3D tr_local = RotationZYX(0.0, 0.0, 0.0) * Translation3D(p.x(), p.y(), 0.0); + auto modPV = (has_envelope ? env_vol.placeVolume(modVol, tr_local) + : env.placeVolume(modVol, tr_global * tr_local)); + modPV.addPhysVolID("sector", sector_id).addPhysVolID("module", id_begin + mid++); + } + return {sector_id, mid}; +} + +// check if a 2d point is already in the container +bool already_placed(const Point& p, const vector<Point>& vec, double xs = 1.0, double ys = 1.0, + double tol = 1e-6) { + for (auto& pt : vec) { + if ((std::abs(pt.x() - p.x()) / xs < tol) && std::abs(pt.y() - p.y()) / ys < tol) { + return true; } - return false; + } + return false; +} + +// check if a point is in a ring +inline bool rec_in_ring(const Point& pt, double sx, double sy, double rmin, double rintermediate, + double rmax, double phmin, double phmax) { + + // check four corners + vector<Point> pts{ + Point(pt.x() - sx / 2., pt.y() - sy / 2.), + Point(pt.x() - sx / 2., pt.y() + sy / 2.), + Point(pt.x() + sx / 2., pt.y() - sy / 2.), + Point(pt.x() + sx / 2., pt.y() + sy / 2.), + }; + + bool inside = false; + int minindex = 0; + int i = 0; + + for (auto& p : pts) { + minindex = (p.r() < pts[minindex].r()) ? i : minindex; + i++; } - // check if a point is in a ring - inline bool rec_in_ring(const Point& pt, double sx, double sy, double rmin, double rintermediate, double rmax, - double phmin, double phmax) - { - - // check four corners - vector<Point> pts{ - Point(pt.x() - sx / 2., pt.y() - sy / 2.), - Point(pt.x() - sx / 2., pt.y() + sy / 2.), - Point(pt.x() + sx / 2., pt.y() - sy / 2.), - Point(pt.x() + sx / 2., pt.y() + sy / 2.), - }; - - bool inside = false; - int minindex = 0; - int i = 0; - - for (auto& p : pts) { - minindex = (p.r() < pts[minindex].r()) ? i : minindex; - i++; - } + double rmax_pacman = + (pts[minindex].phi() < phmin || pts[minindex].phi() > phmax) ? rintermediate : rmax; + inside = pts[minindex].r() <= rmax_pacman && pts[minindex].r() >= rmin; - double rmax_pacman = (pts[minindex].phi() < phmin || pts[minindex].phi() > phmax) ? rintermediate : rmax; - inside = pts[minindex].r() <= rmax_pacman && pts[minindex].r() >= rmin; + return inside; +} - return inside; +// a helper function to recursively fill square in a ring +void add_rectangle(Point p, vector<Point>& res, double sx, double sy, double rmin, + double rintermediate, double rmax, double phmin, double phmax, + int max_depth = 20, int depth = 0) { + // exceeds the maximum depth in searching or already placed + if ((depth > max_depth) || (already_placed(p, res, sx, sy))) { + return; } - // a helper function to recursively fill square in a ring - void add_rectangle(Point p, vector<Point>& res, double sx, double sy, double rmin, double rintermediate, double rmax, - double phmin, double phmax, int max_depth = 20, int depth = 0) - { - // exceeds the maximum depth in searching or already placed - if ((depth > max_depth) || (already_placed(p, res, sx, sy))) { - return; - } - - bool in_ring = rec_in_ring(p, sx, sy, rmin, rintermediate, rmax, phmin, phmax); - if (in_ring) { - res.emplace_back(p); - } - // continue search for a good placement or if no placement found yet - if (in_ring || res.empty()) { - // check adjacent squares - add_rectangle(Point(p.x() + sx, p.y()), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, max_depth, - depth + 1); - add_rectangle(Point(p.x() - sx, p.y()), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, max_depth, - depth + 1); - add_rectangle(Point(p.x(), p.y() + sy), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, max_depth, - depth + 1); - add_rectangle(Point(p.x(), p.y() - sy), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, max_depth, - depth + 1); - } + bool in_ring = rec_in_ring(p, sx, sy, rmin, rintermediate, rmax, phmin, phmax); + if (in_ring) { + res.emplace_back(p); } - - // fill squares - vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rintermediate, double rmax, - double phmin, double phmax) - { - // convert (0, 2pi) to (-pi, pi) - if (phmax > M_PI) { - phmin -= M_PI; - phmax -= M_PI; - } - // start with a seed square and find one in the ring - // move to center - ref = ref - Point(int(ref.x() / sx) * sx, int(ref.y() / sy) * sy); - vector<Point> res; - add_rectangle(ref, res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, - (int(rmax / sx) + 1) * (int(rmax / sy) + 1) * 2); - return res; + // continue search for a good placement or if no placement found yet + if (in_ring || res.empty()) { + // check adjacent squares + add_rectangle(Point(p.x() + sx, p.y()), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, + max_depth, depth + 1); + add_rectangle(Point(p.x() - sx, p.y()), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, + max_depth, depth + 1); + add_rectangle(Point(p.x(), p.y() + sy), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, + max_depth, depth + 1); + add_rectangle(Point(p.x(), p.y() - sy), res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, + max_depth, depth + 1); + } +} + +// fill squares +vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rintermediate, + double rmax, double phmin, double phmax) { + // convert (0, 2pi) to (-pi, pi) + if (phmax > M_PI) { + phmin -= M_PI; + phmax -= M_PI; } + // start with a seed square and find one in the ring + // move to center + ref = ref - Point(int(ref.x() / sx) * sx, int(ref.y() / sy) * sy); + vector<Point> res; + add_rectangle(ref, res, sx, sy, rmin, rintermediate, rmax, phmin, phmax, + (int(rmax / sx) + 1) * (int(rmax / sy) + 1) * 2); + return res; +} } // namespace ip6::geo diff --git a/src/GeometryHelper.h b/src/GeometryHelper.h index bb2f94490..33dcc95cf 100644 --- a/src/GeometryHelper.h +++ b/src/GeometryHelper.h @@ -15,26 +15,26 @@ // some utility functions that can be shared namespace ip6::geo { - using std::function; - using std::make_tuple; - using std::map; - using std::string; - using std::tuple; - using std::vector; - using Volume = dd4hep::Volume; - using Position = dd4hep::Position; - using Assembly = dd4hep::Assembly; - using Detector = dd4hep::Detector; - using SensitiveDetector = dd4hep::SensitiveDetector; - using Point = ROOT::Math::XYPoint; - using Transform3D = dd4hep::Transform3D; - using Translation3D = dd4hep::Translation3D; - using RotationZYX = dd4hep::RotationZYX; - using UnionSolid = dd4hep::UnionSolid; - using Material = dd4hep::Material; - using Tube = dd4hep::Tube; - - /* Fill rectangles in a pacman disk +using std::function; +using std::make_tuple; +using std::map; +using std::string; +using std::tuple; +using std::vector; +using Volume = dd4hep::Volume; +using Position = dd4hep::Position; +using Assembly = dd4hep::Assembly; +using Detector = dd4hep::Detector; +using SensitiveDetector = dd4hep::SensitiveDetector; +using Point = ROOT::Math::XYPoint; +using Transform3D = dd4hep::Transform3D; +using Translation3D = dd4hep::Translation3D; +using RotationZYX = dd4hep::RotationZYX; +using UnionSolid = dd4hep::UnionSolid; +using Material = dd4hep::Material; +using Tube = dd4hep::Tube; + +/* Fill rectangles in a pacman disk * * @param ref 2D reference point. * @param sx x side length @@ -48,16 +48,17 @@ namespace ip6::geo { * Outer radial bunds can be penetrated by internal modules on or near the boundary. */ - vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rintermediate, double rmax, - double phmin = -M_PI, double phmax = M_PI); +vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rintermediate, + double rmax, double phmin = -M_PI, double phmax = M_PI); - tuple<int, int> - add_individuals(function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, - Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int id); +tuple<int, int> add_individuals( + function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, + Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int id); - tuple<int, int> add_disk(function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, - Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int id); +tuple<int, int> +add_disk(function<tuple<Volume, Position>(Detector&, xml_coll_t&, SensitiveDetector&)> build_module, + Detector& desc, Assembly& env, xml_coll_t& plm, SensitiveDetector& sens, int id); - Position get_xml_xyz(xml_comp_t& comp, dd4hep::xml::Strng_t name); +Position get_xml_xyz(xml_comp_t& comp, dd4hep::xml::Strng_t name); } // namespace ip6::geo diff --git a/src/GeometryHelpers.cpp b/src/GeometryHelpers.cpp index 6fccaf331..e04680a73 100644 --- a/src/GeometryHelpers.cpp +++ b/src/GeometryHelpers.cpp @@ -6,230 +6,222 @@ // some utility functions that can be shared namespace epic::geo { - typedef ROOT::Math::XYPoint Point; - - // check if a 2d point is already in the container - bool already_placed(const Point& p, const std::vector<Point>& vec, double xs = 1.0, double ys = 1.0, - double tol = 1e-6) - { - for (auto& pt : vec) { - if ((std::abs(pt.x() - p.x()) / xs < tol) && std::abs(pt.y() - p.y()) / ys < tol) { - return true; - } +typedef ROOT::Math::XYPoint Point; + +// check if a 2d point is already in the container +bool already_placed(const Point& p, const std::vector<Point>& vec, double xs = 1.0, double ys = 1.0, + double tol = 1e-6) { + for (auto& pt : vec) { + if ((std::abs(pt.x() - p.x()) / xs < tol) && std::abs(pt.y() - p.y()) / ys < tol) { + return true; } + } + return false; +} + +// check if a square in a ring +inline bool rec_in_ring(const Point& pt, double sx, double sy, double rmin, double rmax, + double phmin, double phmax) { + if (pt.r() > rmax || pt.r() < rmin) { return false; } - // check if a square in a ring - inline bool rec_in_ring(const Point& pt, double sx, double sy, double rmin, double rmax, double phmin, double phmax) - { - if (pt.r() > rmax || pt.r() < rmin) { + // check four corners + std::vector<Point> pts{ + Point(pt.x() - sx / 2., pt.y() - sy / 2.), + Point(pt.x() - sx / 2., pt.y() + sy / 2.), + Point(pt.x() + sx / 2., pt.y() - sy / 2.), + Point(pt.x() + sx / 2., pt.y() + sy / 2.), + }; + for (auto& p : pts) { + if (p.r() > rmax || p.r() < rmin || p.phi() > phmax || p.phi() < phmin) { return false; } - - // check four corners - std::vector<Point> pts{ - Point(pt.x() - sx / 2., pt.y() - sy / 2.), - Point(pt.x() - sx / 2., pt.y() + sy / 2.), - Point(pt.x() + sx / 2., pt.y() - sy / 2.), - Point(pt.x() + sx / 2., pt.y() + sy / 2.), - }; - for (auto& p : pts) { - if (p.r() > rmax || p.r() < rmin || p.phi() > phmax || p.phi() < phmin) { - return false; - } - } - return true; } - - // a helper function to recursively fill square in a ring - void add_rectangle(Point p, std::vector<Point>& res, double sx, double sy, double rmin, double rmax, double phmin, - double phmax, int max_depth = 20, int depth = 0) - { - // std::cout << depth << "/" << max_depth << std::endl; - // exceeds the maximum depth in searching or already placed - if ((depth > max_depth) || (already_placed(p, res, sx, sy))) { - return; - } - - bool in_ring = rec_in_ring(p, sx, sy, rmin, rmax, phmin, phmax); - if (in_ring) { - res.emplace_back(p); - } - - // continue search for a good placement or if no placement found yet - if (in_ring || res.empty()) { - // check adjacent squares - add_rectangle(Point(p.x() + sx, p.y()), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, depth + 1); - add_rectangle(Point(p.x() - sx, p.y()), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, depth + 1); - add_rectangle(Point(p.x(), p.y() + sy), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, depth + 1); - add_rectangle(Point(p.x(), p.y() - sy), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, depth + 1); - } + return true; +} + +// a helper function to recursively fill square in a ring +void add_rectangle(Point p, std::vector<Point>& res, double sx, double sy, double rmin, double rmax, + double phmin, double phmax, int max_depth = 20, int depth = 0) { + // std::cout << depth << "/" << max_depth << std::endl; + // exceeds the maximum depth in searching or already placed + if ((depth > max_depth) || (already_placed(p, res, sx, sy))) { + return; } - // fill squares - std::vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rmax, double phmin, - double phmax) - { - // convert (0, 2pi) to (-pi, pi) - if (phmax > M_PI) { - phmin -= M_PI; - phmax -= M_PI; - } - // start with a seed square and find one in the ring - // move to center - ref = ref - Point(int(ref.x() / sx) * sx, int(ref.y() / sy) * sy); - - std::vector<Point> res; - add_rectangle(ref, res, sx, sy, rmin, rmax, phmin, phmax, (int(rmax / sx) + 1) * (int(rmax / sy) + 1) * 2); - return res; + bool in_ring = rec_in_ring(p, sx, sy, rmin, rmax, phmin, phmax); + if (in_ring) { + res.emplace_back(p); } - // check if a regular polygon is inside a ring - bool poly_in_ring(const Point& p, int nsides, double lside, double rmin, double rmax, double phmin, double phmax) - { - // outer radius is contained - if ((p.r() + lside <= rmax) && (p.r() - lside >= rmin)) { - return true; - } - - // inner radius is not contained - double rin = std::cos(M_PI / nsides) * lside; - if ((p.r() + rin > rmax) || (p.r() - rin < rmin)) { - return false; - } - - // in between, check every corner - for (int i = 0; i < nsides; ++i) { - double phi = (i + 0.5) * 2. * M_PI / static_cast<double>(nsides); - Point p2(p.x() + 2. * lside * std::sin(phi), p.y() + 2. * lside * std::cos(phi)); - if ((p2.r() > rmax) || (p2.r() < rmin) || p.phi() > phmax || p.phi() < phmin) { - return false; - } - } + // continue search for a good placement or if no placement found yet + if (in_ring || res.empty()) { + // check adjacent squares + add_rectangle(Point(p.x() + sx, p.y()), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, + depth + 1); + add_rectangle(Point(p.x() - sx, p.y()), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, + depth + 1); + add_rectangle(Point(p.x(), p.y() + sy), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, + depth + 1); + add_rectangle(Point(p.x(), p.y() - sy), res, sx, sy, rmin, rmax, phmin, phmax, max_depth, + depth + 1); + } +} + +// fill squares +std::vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rmax, + double phmin, double phmax) { + // convert (0, 2pi) to (-pi, pi) + if (phmax > M_PI) { + phmin -= M_PI; + phmax -= M_PI; + } + // start with a seed square and find one in the ring + // move to center + ref = ref - Point(int(ref.x() / sx) * sx, int(ref.y() / sy) * sy); + + std::vector<Point> res; + add_rectangle(ref, res, sx, sy, rmin, rmax, phmin, phmax, + (int(rmax / sx) + 1) * (int(rmax / sy) + 1) * 2); + return res; +} + +// check if a regular polygon is inside a ring +bool poly_in_ring(const Point& p, int nsides, double lside, double rmin, double rmax, double phmin, + double phmax) { + // outer radius is contained + if ((p.r() + lside <= rmax) && (p.r() - lside >= rmin)) { return true; } - // recursively fill square (nside=4) or hexagon (nside=6) in a ring, other polygons won't work - void add_poly(Point p, std::vector<Point>& res, int nsides, double lside, double rmin, double rmax, double phmin, - double phmax, int max_depth = 20, int depth = 0) - { - // std::cout << depth << "/" << max_depth << std::endl; - // exceeds the maximum depth in searching or already placed - if ((depth > max_depth) || (already_placed(p, res, lside, lside))) { - return; - } + // inner radius is not contained + double rin = std::cos(M_PI / nsides) * lside; + if ((p.r() + rin > rmax) || (p.r() - rin < rmin)) { + return false; + } - bool in_ring = poly_in_ring(p, nsides, lside, rmin, rmax, phmin, phmax); - if (in_ring) { - res.emplace_back(p); + // in between, check every corner + for (int i = 0; i < nsides; ++i) { + double phi = (i + 0.5) * 2. * M_PI / static_cast<double>(nsides); + Point p2(p.x() + 2. * lside * std::sin(phi), p.y() + 2. * lside * std::cos(phi)); + if ((p2.r() > rmax) || (p2.r() < rmin) || p.phi() > phmax || p.phi() < phmin) { + return false; } + } + return true; +} + +// recursively fill square (nside=4) or hexagon (nside=6) in a ring, other polygons won't work +void add_poly(Point p, std::vector<Point>& res, int nsides, double lside, double rmin, double rmax, + double phmin, double phmax, int max_depth = 20, int depth = 0) { + // std::cout << depth << "/" << max_depth << std::endl; + // exceeds the maximum depth in searching or already placed + if ((depth > max_depth) || (already_placed(p, res, lside, lside))) { + return; + } - // recursively add neigbors, continue if it was a good placement or no placement found yet - if (in_ring || res.empty()) { - for (int i = 0; i < nsides; ++i) { - double phi = i * 2. * M_PI / static_cast<double>(nsides); - add_poly(Point(p.x() + 2. * lside * std::sin(phi), p.y() + 2. * lside * std::cos(phi)), res, nsides, lside, - rmin, rmax, phmin, phmax, max_depth, depth + 1); - } - } + bool in_ring = poly_in_ring(p, nsides, lside, rmin, rmax, phmin, phmax); + if (in_ring) { + res.emplace_back(p); } - std::vector<Point> fillHexagons(Point ref, double lside, double rmin, double rmax, double phmin, double phmax) - { - // convert (0, 2pi) to (-pi, pi) - if (phmax > M_PI) { - phmin -= M_PI; - phmax -= M_PI; + // recursively add neigbors, continue if it was a good placement or no placement found yet + if (in_ring || res.empty()) { + for (int i = 0; i < nsides; ++i) { + double phi = i * 2. * M_PI / static_cast<double>(nsides); + add_poly(Point(p.x() + 2. * lside * std::sin(phi), p.y() + 2. * lside * std::cos(phi)), res, + nsides, lside, rmin, rmax, phmin, phmax, max_depth, depth + 1); } - // start with a seed and find one in the ring - // move to center - ref = ref - Point(int(ref.x() / lside) * lside, int(ref.y() / lside) * lside); - - std::vector<Point> res; - add_poly(ref, res, 6, lside, rmin, rmax, phmin, phmax, std::pow(int(rmax / lside) + 1, 2) * 2); - return res; } - - - bool isPointInsidePolygon(Point p, std::vector<Point> vertices) - { - int n = vertices.size(); - bool check = false; // check == false (outside the polygon), check == true (inside the polygon) - const double tolerance = 0.000001; - - // When the point overlaps with vertex in the tolerance. - // - for( int i = 0 ; i < n ; i++) - if( std::abs(p.x() - vertices[i].x()) < tolerance && std::abs(p.y() - vertices[i].y()) < tolerance ) - check = !check; - - - // When the point is on the line connected two vertices in the tolerance. - // - if( check == false ) - { - for( int i = 0, j = n-1 ; i < n ; j = i++) - if( std::abs(p.x() - vertices[i].x()) < tolerance && std::abs(p.x() - vertices[j].x()) < tolerance ) - if( (vertices[i].y() > p.y()) != (vertices[j].y() > p.y()) ) - check = !check; - } - if( check == false ) - { - for( int i = 0, j = n-1 ; i < n ; j = i++) - if( std::abs(p.y() - vertices[i].y()) < tolerance && std::abs(p.y() - vertices[j].y()) < tolerance ) - if( (vertices[i].x() > p.x()) != (vertices[j].x() > p.x()) ) - check = !check; - } - - - if( check == false ) - { - for( int i = 0, j = n-1 ; i < n ; j = i++) - { - double ver_i = vertices[i].y(); - double ver_j = vertices[j].y(); - double criteria = (vertices[j].x() - vertices[i].x()) * (p.y() - vertices[i].y()) / (vertices[j].y() - vertices[i].y()) + vertices[i].x(); - - if( ((ver_i > p.y()) != (ver_j > p.y())) && (p.x() < criteria || std::abs(p.x() - criteria) < tolerance) ) - check = !check; - } - } - - return check; +} + +std::vector<Point> fillHexagons(Point ref, double lside, double rmin, double rmax, double phmin, + double phmax) { + // convert (0, 2pi) to (-pi, pi) + if (phmax > M_PI) { + phmin -= M_PI; + phmax -= M_PI; } - - - bool isBoxTotalInsidePolygon(Point box[4], std::vector<Point> vertices) - { - bool pt_check = true; - for (int i = 0 ; i < 4 ; i++ ) - pt_check = pt_check && isPointInsidePolygon(box[i], vertices); - return pt_check; + // start with a seed and find one in the ring + // move to center + ref = ref - Point(int(ref.x() / lside) * lside, int(ref.y() / lside) * lside); + + std::vector<Point> res; + add_poly(ref, res, 6, lside, rmin, rmax, phmin, phmax, std::pow(int(rmax / lside) + 1, 2) * 2); + return res; +} + +bool isPointInsidePolygon(Point p, std::vector<Point> vertices) { + int n = vertices.size(); + bool check = false; // check == false (outside the polygon), check == true (inside the polygon) + const double tolerance = 0.000001; + + // When the point overlaps with vertex in the tolerance. + // + for (int i = 0; i < n; i++) + if (std::abs(p.x() - vertices[i].x()) < tolerance && + std::abs(p.y() - vertices[i].y()) < tolerance) + check = !check; + + // When the point is on the line connected two vertices in the tolerance. + // + if (check == false) { + for (int i = 0, j = n - 1; i < n; j = i++) + if (std::abs(p.x() - vertices[i].x()) < tolerance && + std::abs(p.x() - vertices[j].x()) < tolerance) + if ((vertices[i].y() > p.y()) != (vertices[j].y() > p.y())) + check = !check; } - - - bool isBoxPartialInsidePolygon(Point box[4], std::vector<Point> vertices) - { - bool pt_check = false; - for (int i = 0 ; i < 4 ; i++ ) - pt_check = pt_check || isPointInsidePolygon(box[i], vertices); - return pt_check; + if (check == false) { + for (int i = 0, j = n - 1; i < n; j = i++) + if (std::abs(p.y() - vertices[i].y()) < tolerance && + std::abs(p.y() - vertices[j].y()) < tolerance) + if ((vertices[i].x() > p.x()) != (vertices[j].x() > p.x())) + check = !check; } + if (check == false) { + for (int i = 0, j = n - 1; i < n; j = i++) { + double ver_i = vertices[i].y(); + double ver_j = vertices[j].y(); + double criteria = (vertices[j].x() - vertices[i].x()) * (p.y() - vertices[i].y()) / + (vertices[j].y() - vertices[i].y()) + + vertices[i].x(); - std::vector<std::pair<double, double>> getPolygonVertices(std::pair<double, double> center, double radius, double angle_0, int numSides) - { - std::vector<std::pair<double, double>> vertices; - double angle = 2 * M_PI / numSides; // calculate the angle between adjacent vertices - for (int i = 0 ; i < numSides ; i++) - { - double x = center.first + radius * cos(i * angle + angle_0); - double y = center.second + radius * sin(i * angle + angle_0); - vertices.emplace_back(x, y); // add the vertex to the vector - } - return vertices; + if (((ver_i > p.y()) != (ver_j > p.y())) && + (p.x() < criteria || std::abs(p.x() - criteria) < tolerance)) + check = !check; + } } + return check; +} + +bool isBoxTotalInsidePolygon(Point box[4], std::vector<Point> vertices) { + bool pt_check = true; + for (int i = 0; i < 4; i++) + pt_check = pt_check && isPointInsidePolygon(box[i], vertices); + return pt_check; +} + +bool isBoxPartialInsidePolygon(Point box[4], std::vector<Point> vertices) { + bool pt_check = false; + for (int i = 0; i < 4; i++) + pt_check = pt_check || isPointInsidePolygon(box[i], vertices); + return pt_check; +} + +std::vector<std::pair<double, double>> +getPolygonVertices(std::pair<double, double> center, double radius, double angle_0, int numSides) { + std::vector<std::pair<double, double>> vertices; + double angle = 2 * M_PI / numSides; // calculate the angle between adjacent vertices + for (int i = 0; i < numSides; i++) { + double x = center.first + radius * cos(i * angle + angle_0); + double y = center.second + radius * sin(i * angle + angle_0); + vertices.emplace_back(x, y); // add the vertex to the vector + } + return vertices; +} } // namespace epic::geo diff --git a/src/GeometryHelpers.h b/src/GeometryHelpers.h index 76f6b577f..5f4479437 100644 --- a/src/GeometryHelpers.h +++ b/src/GeometryHelpers.h @@ -8,9 +8,9 @@ // some utility functions that can be shared namespace epic::geo { - using Point = ROOT::Math::XYPoint; +using Point = ROOT::Math::XYPoint; - /** Fill rectangles in a ring (disk). +/** Fill rectangles in a ring (disk). * * @param ref 2D reference point. * @param sx x side length @@ -20,24 +20,24 @@ namespace epic::geo { * @param phmin phi min * @param phmax phi max */ - std::vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rmax, double phmin = -M_PI, - double phmax = M_PI); - // fill squares in a ring - inline std::vector<Point> fillSquares(Point ref, double size, double rmin, double rmax, double phmin = -M_PI, - double phmax = M_PI) - { - return fillRectangles(ref, size, size, rmin, rmax, phmin, phmax); - } +std::vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rmax, + double phmin = -M_PI, double phmax = M_PI); +// fill squares in a ring +inline std::vector<Point> fillSquares(Point ref, double size, double rmin, double rmax, + double phmin = -M_PI, double phmax = M_PI) { + return fillRectangles(ref, size, size, rmin, rmax, phmin, phmax); +} - std::vector<Point> fillHexagons(Point ref, double lside, double rmin, double rmax, double phmin = -M_PI, - double phmax = M_PI); +std::vector<Point> fillHexagons(Point ref, double lside, double rmin, double rmax, + double phmin = -M_PI, double phmax = M_PI); - bool isPointInsidePolygon(Point p, std::vector<Point> vertices); +bool isPointInsidePolygon(Point p, std::vector<Point> vertices); - bool isBoxTotalInsidePolygon(Point box[4], std::vector<Point> vertices); +bool isBoxTotalInsidePolygon(Point box[4], std::vector<Point> vertices); - bool isBoxPartialInsidePolygon(Point box[4], std::vector<Point> vertices); +bool isBoxPartialInsidePolygon(Point box[4], std::vector<Point> vertices); - std::vector<std::pair<double, double>> getPolygonVertices(std::pair<double, double> center, double radius, double angle_0, int numSides); +std::vector<std::pair<double, double>> +getPolygonVertices(std::pair<double, double> center, double radius, double angle_0, int numSides); } // namespace epic::geo diff --git a/src/HomogeneousCalorimeter_geo.cpp b/src/HomogeneousCalorimeter_geo.cpp index 80c89753a..28b915068 100644 --- a/src/HomogeneousCalorimeter_geo.cpp +++ b/src/HomogeneousCalorimeter_geo.cpp @@ -42,13 +42,12 @@ using namespace dd4hep; */ // headers -static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, Assembly& env, xml::Collection_t& plm, - SensitiveDetector& sens, int id); +static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, Assembly& env, + xml::Collection_t& plm, + SensitiveDetector& sens, int id); // helper function to get x, y, z if defined in a xml component -template <class XmlComp> -Position get_xml_xyz(XmlComp& comp, dd4hep::xml::Strng_t name) -{ +template <class XmlComp> Position get_xml_xyz(XmlComp& comp, dd4hep::xml::Strng_t name) { Position pos(0., 0., 0.); if (comp.hasChild(name)) { auto child = comp.child(name); @@ -60,142 +59,152 @@ Position get_xml_xyz(XmlComp& comp, dd4hep::xml::Strng_t name) } // main -static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) { xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + DetElement det(detName, detID); sens.setType("calorimeter"); // assembly Assembly assembly(detName); // module placement - xml::Component plm = detElem.child(_Unicode(placements)); - + xml::Component plm = detElem.child(_Unicode(placements)); std::map<int, std::pair<int, int>> sectorModuleRowsColumns; auto addRowColumnNumbers = [§orModuleRowsColumns](int sector, std::pair<int, int> rowcolumn) { - auto it = sectorModuleRowsColumns.find(sector); - if (it != sectorModuleRowsColumns.end()) { - it->second = rowcolumn; - } else { - sectorModuleRowsColumns[sector] = rowcolumn; - } - }; - + auto it = sectorModuleRowsColumns.find(sector); + if (it != sectorModuleRowsColumns.end()) { + it->second = rowcolumn; + } else { + sectorModuleRowsColumns[sector] = rowcolumn; + } + }; int sector_id = 1; - for (xml::Collection_t disk_12surface(plm, _Unicode(disk_12surface)); disk_12surface; ++disk_12surface) { - auto [sector, rowcolumn] = add_12surface_disk(desc, assembly, disk_12surface, sens, sector_id++); + for (xml::Collection_t disk_12surface(plm, _Unicode(disk_12surface)); disk_12surface; + ++disk_12surface) { + auto [sector, rowcolumn] = + add_12surface_disk(desc, assembly, disk_12surface, sens, sector_id++); addRowColumnNumbers(sector, rowcolumn); } for (auto [sector, rowcolumn] : sectorModuleRowsColumns) { - desc.add(Constant(Form((detName + "_NModules_Sector%d").c_str(), sector), std::to_string((rowcolumn.first)), std::to_string((rowcolumn.second)) )); + desc.add(Constant(Form((detName + "_NModules_Sector%d").c_str(), sector), + std::to_string((rowcolumn.first)), std::to_string((rowcolumn.second)))); } - // detector position and rotation - auto pos = get_xml_xyz(detElem, _Unicode(position)); - auto rot = get_xml_xyz(detElem, _Unicode(rotation)); - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr = Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x()); - PlacedVolume envPV = motherVol.placeVolume(assembly, tr); + auto pos = get_xml_xyz(detElem, _Unicode(position)); + auto rot = get_xml_xyz(detElem, _Unicode(rotation)); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr = + Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x()); + PlacedVolume envPV = motherVol.placeVolume(assembly, tr); envPV.addPhysVolID("system", detID); det.setPlacement(envPV); return det; } // helper function to build module with or w/o wrapper -std::tuple<Volume, Position> build_module(Detector& desc, xml::Collection_t& plm, SensitiveDetector& sens) -{ - auto mod = plm.child(_Unicode(module)); - auto mx = mod.attr<double>(_Unicode(modulex)); - auto my = mod.attr<double>(_Unicode(moduley)); - auto mz = mod.attr<double>(_Unicode(modulez)); - auto mdz = mod.attr<double>(_Unicode(moduleshift)); - Box modshape(mx / 2., my / 2., mz / 2.); - auto modMat = desc.material(mod.attr<std::string>(_Unicode(gmaterial))); +std::tuple<Volume, Position> build_module(Detector& desc, xml::Collection_t& plm, + SensitiveDetector& sens) { + auto mod = plm.child(_Unicode(module)); + auto mx = mod.attr<double>(_Unicode(modulex)); + auto my = mod.attr<double>(_Unicode(moduley)); + auto mz = mod.attr<double>(_Unicode(modulez)); + auto mdz = mod.attr<double>(_Unicode(moduleshift)); + Box modshape(mx / 2., my / 2., mz / 2.); + auto modMat = desc.material(mod.attr<std::string>(_Unicode(gmaterial))); Volume modVol("module_vol", modshape, modMat); modVol.setVisAttributes(desc.visAttributes(mod.attr<std::string>(_Unicode(vis)))); - auto cry = plm.child(_Unicode(crystal)); - auto cryx = cry.attr<double>(_Unicode(sizex)); - auto cryy = cry.attr<double>(_Unicode(sizey)); - auto cryz = cry.attr<double>(_Unicode(sizez)); - auto roc = plm.child(_Unicode(readout)); - auto PCBx = roc.attr<double>(_Unicode(PCB_sizex)); - auto PCBy = roc.attr<double>(_Unicode(PCB_sizex)); - auto PCBz = roc.attr<double>(_Unicode(PCB_thickness)); - auto sensorx = roc.attr<double>(_Unicode(Sensor_sizex)); - auto sensory = roc.attr<double>(_Unicode(Sensor_sizey)); - auto sensorz = roc.attr<double>(_Unicode(Sensor_thickness)); - auto sensorspace = roc.attr<double>(_Unicode(Sensor_space)); - auto sensorNx = roc.attr<int>(_Unicode(Nsensor_X)); - auto sensorNy = roc.attr<int>(_Unicode(Nsensor_Y)); - - Box crystalshape(cryx / 2., cryy / 2., cryz / 2.); - auto crystalMat = desc.material(cry.attr<std::string>(_Unicode(material))); + auto cry = plm.child(_Unicode(crystal)); + auto cryx = cry.attr<double>(_Unicode(sizex)); + auto cryy = cry.attr<double>(_Unicode(sizey)); + auto cryz = cry.attr<double>(_Unicode(sizez)); + auto roc = plm.child(_Unicode(readout)); + auto PCBx = roc.attr<double>(_Unicode(PCB_sizex)); + auto PCBy = roc.attr<double>(_Unicode(PCB_sizex)); + auto PCBz = roc.attr<double>(_Unicode(PCB_thickness)); + auto sensorx = roc.attr<double>(_Unicode(Sensor_sizex)); + auto sensory = roc.attr<double>(_Unicode(Sensor_sizey)); + auto sensorz = roc.attr<double>(_Unicode(Sensor_thickness)); + auto sensorspace = roc.attr<double>(_Unicode(Sensor_space)); + auto sensorNx = roc.attr<int>(_Unicode(Nsensor_X)); + auto sensorNy = roc.attr<int>(_Unicode(Nsensor_Y)); + + Box crystalshape(cryx / 2., cryy / 2., cryz / 2.); + auto crystalMat = desc.material(cry.attr<std::string>(_Unicode(material))); Volume crystalVol("crystal_vol", crystalshape, crystalMat); modVol.placeVolume(crystalVol, Position(0., 0., PCBz + sensorz + (cryz - mz) / 2.)); crystalVol.setVisAttributes(desc.visAttributes(cry.attr<std::string>(_Unicode(cryvis)))); crystalVol.setSensitiveDetector(sens); - Box PCBshape(PCBx / 2., PCBy / 2., PCBz / 2.); - auto PCBMat = desc.material(roc.attr<std::string>(_Unicode(material))); + Box PCBshape(PCBx / 2., PCBy / 2., PCBz / 2.); + auto PCBMat = desc.material(roc.attr<std::string>(_Unicode(material))); Volume PCBVol("PCB_vol", PCBshape, PCBMat); modVol.placeVolume(PCBVol, Position(0., 0., (PCBz - mz) / 2.)); - Box sensorshape(sensorx / 2., sensory / 2., sensorz / 2.); - auto sensorMat = desc.material(roc.attr<std::string>(_Unicode(material))); + Box sensorshape(sensorx / 2., sensory / 2., sensorz / 2.); + auto sensorMat = desc.material(roc.attr<std::string>(_Unicode(material))); Volume sensorVol("sensor_vol", sensorshape, sensorMat); auto marginx = (PCBx - sensorNx * sensorx - (sensorNx - 1) * sensorspace) / 2.; auto marginy = (PCBy - sensorNy * sensory - (sensorNy - 1) * sensorspace) / 2.; - auto x0 = marginx + sensorx / 2. - PCBx / 2.; - auto y0 = marginy + sensory / 2. - PCBy / 2.; - for(int i = 0 ; i < sensorNx ; i++) - for(int j = 0 ; j < sensorNy ; j++) - modVol.placeVolume(sensorVol, Position(x0 + (sensorx + sensorspace) * i, y0 + (sensory + sensorspace) * j, PCBz + (sensorz - mz) / 2.)); - - - - if (!plm.hasChild(_Unicode(wrapper))){ // no wrapper + auto x0 = marginx + sensorx / 2. - PCBx / 2.; + auto y0 = marginy + sensory / 2. - PCBy / 2.; + for (int i = 0; i < sensorNx; i++) + for (int j = 0; j < sensorNy; j++) + modVol.placeVolume(sensorVol, + Position(x0 + (sensorx + sensorspace) * i, + y0 + (sensory + sensorspace) * j, PCBz + (sensorz - mz) / 2.)); + + if (!plm.hasChild(_Unicode(wrapper))) { // no wrapper printout(DEBUG, "HomogeneousCalorimeter", "without wrapper"); return std::make_tuple(modVol, Position{mx, my, mz}); - } - else{ // build wrapper - auto wrp = plm.child(_Unicode(wrapper)); // Read all the contents in the wrapper block + } else { // build wrapper + auto wrp = plm.child(_Unicode(wrapper)); // Read all the contents in the wrapper block auto wrapcfthickness = wrp.attr<double>(_Unicode(carbonfiber_thickness)); auto wrapcflength = wrp.attr<double>(_Unicode(carbonfiber_length)); auto wrapVMthickness = wrp.attr<double>(_Unicode(VM2000_thickness)); - auto carbonMat = desc.material(wrp.attr<std::string>(_Unicode(material_carbon))); - auto wrpMat = desc.material(wrp.attr<std::string>(_Unicode(material_wrap))); - auto gapMat = desc.material(wrp.attr<std::string>(_Unicode(material_gap))); + auto carbonMat = desc.material(wrp.attr<std::string>(_Unicode(material_carbon))); + auto wrpMat = desc.material(wrp.attr<std::string>(_Unicode(material_wrap))); + auto gapMat = desc.material(wrp.attr<std::string>(_Unicode(material_gap))); if (wrapcfthickness < 1e-12 * mm) return std::make_tuple(modVol, Position{mx, my, mz}); Box carbonShape(mx / 2., my / 2., wrapcflength / 2.); - Box carbonShape_sub((mx - 2. * wrapcfthickness) / 2., (my - 2. * wrapcfthickness) / 2., wrapcflength / 2.); + Box carbonShape_sub((mx - 2. * wrapcfthickness) / 2., (my - 2. * wrapcfthickness) / 2., + wrapcflength / 2.); SubtractionSolid carbon_subtract(carbonShape, carbonShape_sub, Position(0., 0., 0.)); Box gapShape(mx / 2., my / 2., (cryz - 2. * wrapcflength) / 2.); - Box gapShape_sub((mx - 2. * wrapcfthickness) / 2., (my - 2. * wrapcfthickness) / 2., (cryz - 2. * wrapcflength) / 2.); + Box gapShape_sub((mx - 2. * wrapcfthickness) / 2., (my - 2. * wrapcfthickness) / 2., + (cryz - 2. * wrapcflength) / 2.); SubtractionSolid gap_subtract(gapShape, gapShape_sub, Position(0., 0., 0.)); - Box wrpVM2000((mx - 2. * wrapcfthickness) / 2., (my - 2. * wrapcfthickness) / 2., (cryz + mdz) / 2.); - Box wrpVM2000_sub((mx - 2. * wrapcfthickness - 2. * wrapVMthickness) / 2., (my - 2. * wrapcfthickness - 2. * wrapVMthickness) / 2., cryz / 2.); + Box wrpVM2000((mx - 2. * wrapcfthickness) / 2., (my - 2. * wrapcfthickness) / 2., + (cryz + mdz) / 2.); + Box wrpVM2000_sub((mx - 2. * wrapcfthickness - 2. * wrapVMthickness) / 2., + (my - 2. * wrapcfthickness - 2. * wrapVMthickness) / 2., cryz / 2.); SubtractionSolid wrpVM2000_subtract(wrpVM2000, wrpVM2000_sub, Position(0., 0., -mdz / 2.)); Volume carbonVol("carbon_vol", carbon_subtract, carbonMat); Volume gapVol("gap_vol", gap_subtract, gapMat); Volume wrpVol("wrapper_vol", wrpVM2000_subtract, wrpMat); - modVol.placeVolume(carbonVol, Position(0., 0., PCBz + sensorz + (wrapcflength - mz) / 2.)); // put the wrap in the both ends of crystal - modVol.placeVolume(carbonVol, Position(0., 0., PCBz + sensorz + cryz - (wrapcflength + mz) / 2.)); - modVol.placeVolume(gapVol, Position(0., 0., PCBz + sensorz + (cryz - mz) / 2. )); // put the gap between two carbon fiber + modVol.placeVolume(carbonVol, Position(0., 0., + PCBz + sensorz + + (wrapcflength - mz) / + 2.)); // put the wrap in the both ends of crystal + modVol.placeVolume(carbonVol, + Position(0., 0., PCBz + sensorz + cryz - (wrapcflength + mz) / 2.)); + modVol.placeVolume( + gapVol, + Position(0., 0., + PCBz + sensorz + (cryz - mz) / 2.)); // put the gap between two carbon fiber modVol.placeVolume(wrpVol, Position(0., 0., PCBz + sensorz + (cryz + mdz - mz) / 2.)); carbonVol.setVisAttributes(desc.visAttributes(wrp.attr<std::string>(_Unicode(vis_carbon)))); @@ -209,56 +218,56 @@ std::tuple<Volume, Position> build_module(Detector& desc, xml::Collection_t& plm } // place 12 surface disk of modules -static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, Assembly& env, xml::Collection_t& plm, - SensitiveDetector& sens, int sid) -{ - auto [modVol, modSize] = build_module(desc, plm, sens); - int sector_id = dd4hep::getAttrOrDefault<int>(plm, _Unicode(sector), sid); - double rmax = plm.attr<double>(_Unicode(rmax)); - double r12min = plm.attr<double>(_Unicode(r12min)); - double r12max = plm.attr<double>(_Unicode(r12max)); - double structure_frame_length = plm.attr<double>(_Unicode(outerringlength)); - double calo_module_length = plm.attr<double>(_Unicode(modulelength)); - double Prot = plm.attr<double>(_Unicode(protate)); - double Nrot = plm.attr<double>(_Unicode(nrotate)); - double Oring_shift = plm.attr<double>(_Unicode(outerringshift)); - double Innera = plm.attr<double>(_Unicode(inneradiusa)); - double Innerb = plm.attr<double>(_Unicode(inneradiusb)); - double phimin = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimin), 0.); - double phimax = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimax), 2. * M_PI); - - std::vector<double> pt_innerframe_x; //The points information for inner supporting frame +static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, Assembly& env, + xml::Collection_t& plm, + SensitiveDetector& sens, int sid) { + auto [modVol, modSize] = build_module(desc, plm, sens); + int sector_id = dd4hep::getAttrOrDefault<int>(plm, _Unicode(sector), sid); + double rmax = plm.attr<double>(_Unicode(rmax)); + double r12min = plm.attr<double>(_Unicode(r12min)); + double r12max = plm.attr<double>(_Unicode(r12max)); + double structure_frame_length = plm.attr<double>(_Unicode(outerringlength)); + double calo_module_length = plm.attr<double>(_Unicode(modulelength)); + double Prot = plm.attr<double>(_Unicode(protate)); + double Nrot = plm.attr<double>(_Unicode(nrotate)); + double Oring_shift = plm.attr<double>(_Unicode(outerringshift)); + double Innera = plm.attr<double>(_Unicode(inneradiusa)); + double Innerb = plm.attr<double>(_Unicode(inneradiusb)); + double phimin = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimin), 0.); + double phimax = dd4hep::getAttrOrDefault<double>(plm, _Unicode(phimax), 2. * M_PI); + + std::vector<double> pt_innerframe_x; //The points information for inner supporting frame std::vector<double> pt_innerframe_y; double half_modx = modSize.x() * 0.5, half_mody = modSize.y() * 0.5; - //========================================================= // Read the positions information from xml file //========================================================= xml_coll_t pts_extrudedpolygon(plm, _Unicode(points_extrudedpolygon)); - for (xml_coll_t position_i(pts_extrudedpolygon, _U(position)); position_i; ++position_i){ + for (xml_coll_t position_i(pts_extrudedpolygon, _U(position)); position_i; ++position_i) { xml_comp_t position_comp = position_i; pt_innerframe_x.push_back((position_comp.x())); pt_innerframe_y.push_back((position_comp.y())); } - //========================================================= // optional envelope volume and the supporting frame //========================================================= // Material for the structure and mother space // - Material outer_ring_material = desc.material(getAttrOrDefault<std::string>(plm, _U(material), "StainlessSteel")); - Material inner_ring_material = desc.material(getAttrOrDefault<std::string>(plm, _U(material), "Copper")); + Material outer_ring_material = + desc.material(getAttrOrDefault<std::string>(plm, _U(material), "StainlessSteel")); + Material inner_ring_material = + desc.material(getAttrOrDefault<std::string>(plm, _U(material), "Copper")); //============================== // Outer supporting frame //============================== PolyhedraRegular solid_ring12(12, r12min, r12max, structure_frame_length); - Volume ring12_vol("ring12", solid_ring12, outer_ring_material); - Transform3D tr_global_Oring = RotationZYX(Prot, 0., 0.) * Translation3D(0., 0., Oring_shift); + Volume ring12_vol("ring12", solid_ring12, outer_ring_material); + Transform3D tr_global_Oring = RotationZYX(Prot, 0., 0.) * Translation3D(0., 0., Oring_shift); ring12_vol.setVisAttributes(desc.visAttributes(plm.attr<std::string>(_Unicode(vis_struc)))); //============================= @@ -272,90 +281,106 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A std::vector<double> sec_y = {0., 0.}; std::vector<double> zscale = {1., 1.}; - ExtrudedPolygon inner_support_main(pt_innerframe_x, pt_innerframe_y, sec_z, sec_x, sec_y, zscale); - EllipticalTube subtract_a(Innera, Innerb, calo_module_length / 2.); + ExtrudedPolygon inner_support_main(pt_innerframe_x, pt_innerframe_y, sec_z, sec_x, sec_y, zscale); + EllipticalTube subtract_a(Innera, Innerb, calo_module_length / 2.); SubtractionSolid inner_support_substracta(inner_support_main, subtract_a, Position(0., 0., 0.)); - Volume inner_support_vol("inner_support_vol", inner_support_substracta, inner_ring_material); - inner_support_vol.setVisAttributes(desc.visAttributes(plm.attr<std::string>(_Unicode(vis_struc)))); + Volume inner_support_vol("inner_support_vol", inner_support_substracta, inner_ring_material); + inner_support_vol.setVisAttributes( + desc.visAttributes(plm.attr<std::string>(_Unicode(vis_struc)))); Transform3D tr_global_Iring_elli = RotationZYX(Nrot, 0., 0.) * Translation3D(0., 0., 0.); //============================= // The mother volume of modules //============================= - bool has_envelope = dd4hep::getAttrOrDefault<bool>(plm, _Unicode(envelope), false); + bool has_envelope = dd4hep::getAttrOrDefault<bool>(plm, _Unicode(envelope), false); PolyhedraRegular solid_world(12, 0., r12min, calo_module_length); - EllipticalTube solid_sub(Innera, Innerb, calo_module_length / 2.); - Transform3D subtract_pos = RotationZYX(Nrot, 0., 0.) * Translation3D(0., 0., 0.); + EllipticalTube solid_sub(Innera, Innerb, calo_module_length / 2.); + Transform3D subtract_pos = RotationZYX(Nrot, 0., 0.) * Translation3D(0., 0., 0.); SubtractionSolid calo_subtract(solid_world, solid_sub, subtract_pos); - Volume env_vol(std::string(env.name()) + "_envelope", calo_subtract, outer_ring_material); - Transform3D tr_global = RotationZYX(Prot, 0., 0.) * Translation3D(0., 0., 0.); + Volume env_vol(std::string(env.name()) + "_envelope", calo_subtract, outer_ring_material); + Transform3D tr_global = RotationZYX(Prot, 0., 0.) * Translation3D(0., 0., 0.); env_vol.setVisAttributes(desc.visAttributes(plm.attr<std::string>(_Unicode(vis_steel_gap)))); // Place frames and mother volume of modules into the world volume // if (has_envelope) { - env.placeVolume(env_vol, tr_global); // Place the mother volume for all modules - env.placeVolume(ring12_vol, tr_global_Oring); // Place the outer supporting frame - env_vol.placeVolume(inner_support_vol, tr_global_Iring_elli); // Place the version3 inner supporting frame + env.placeVolume(env_vol, tr_global); // Place the mother volume for all modules + env.placeVolume(ring12_vol, tr_global_Oring); // Place the outer supporting frame + env_vol.placeVolume(inner_support_vol, + tr_global_Iring_elli); // Place the version3 inner supporting frame } - - //===================================================================== // Placing The Modules //===================================================================== - auto points = epic::geo::fillRectangles({half_modx, half_mody}, modSize.x(), modSize.y(), 0., (rmax/std::cos(Prot)), phimin, phimax); + auto points = epic::geo::fillRectangles({half_modx, half_mody}, modSize.x(), modSize.y(), 0., + (rmax / std::cos(Prot)), phimin, phimax); - std::pair<double, double> c1 (0., 0.); - auto polyVertex = epic::geo::getPolygonVertices(c1, (rmax/std::cos(Prot)), M_PI/12., 12); + std::pair<double, double> c1(0., 0.); + auto polyVertex = epic::geo::getPolygonVertices(c1, (rmax / std::cos(Prot)), M_PI / 12., 12); std::vector<epic::geo::Point> out_vertices, in_vertices; - for( auto p : polyVertex ){ + for (auto p : polyVertex) { epic::geo::Point a = {p.first, p.second}; out_vertices.push_back(a); } - for (xml_coll_t position_i(pts_extrudedpolygon, _U(position)); position_i; ++position_i){ + for (xml_coll_t position_i(pts_extrudedpolygon, _U(position)); position_i; ++position_i) { xml_comp_t position_comp = position_i; - epic::geo::Point inpt = {position_comp.x(), position_comp.y()}; + epic::geo::Point inpt = {position_comp.x(), position_comp.y()}; in_vertices.push_back(inpt); } double minX = 0., maxX = 0., minY = 0., maxY = 0.; - for (auto &square : points) { - epic::geo::Point box[4] = {{square.x() + half_modx, square.y() + half_mody}, {square.x() - half_modx, square.y() + half_mody}, {square.x() - half_modx, square.y() - half_mody}, {square.x() + half_modx, square.y() - half_mody}}; + for (auto& square : points) { + epic::geo::Point box[4] = {{square.x() + half_modx, square.y() + half_mody}, + {square.x() - half_modx, square.y() + half_mody}, + {square.x() - half_modx, square.y() - half_mody}, + {square.x() + half_modx, square.y() - half_mody}}; if (epic::geo::isBoxTotalInsidePolygon(box, out_vertices)) { - if( square.x() < minX ) minX = square.x(); - if( square.y() < minY ) minY = square.x(); - if( square.x() > maxX ) maxX = square.x(); - if( square.y() > maxY ) maxY = square.x(); + if (square.x() < minX) + minX = square.x(); + if (square.y() < minY) + minY = square.x(); + if (square.x() > maxX) + maxX = square.x(); + if (square.y() > maxY) + maxY = square.x(); } } int total_count = 0; int row = 0, column = 0; - int N_row = std::round((maxY - minY) / modSize.y()); - int N_column = std::round((maxX - minX) / modSize.x()); + int N_row = std::round((maxY - minY) / modSize.y()); + int N_column = std::round((maxX - minX) / modSize.x()); auto rowcolumn = std::make_pair(N_row, N_column); - for (auto &square : points) { - epic::geo::Point box[4] = {{square.x() + half_modx, square.y() + half_mody}, {square.x() - half_modx, square.y() + half_mody}, {square.x() - half_modx, square.y() - half_mody}, {square.x() + half_modx, square.y() - half_mody}}; + for (auto& square : points) { + epic::geo::Point box[4] = {{square.x() + half_modx, square.y() + half_mody}, + {square.x() - half_modx, square.y() + half_mody}, + {square.x() - half_modx, square.y() - half_mody}, + {square.x() + half_modx, square.y() - half_mody}}; if (epic::geo::isBoxTotalInsidePolygon(box, out_vertices)) { - if(!epic::geo::isBoxTotalInsidePolygon(box, in_vertices)) { + if (!epic::geo::isBoxTotalInsidePolygon(box, in_vertices)) { column = std::round((square.x() - minX) / modSize.x()); - row = std::round((maxY - square.y()) / modSize.y()); - Transform3D tr_local = RotationZYX(Nrot, 0.0, 0.0) * Translation3D(square.x(), square.y(), 0.0); - auto modPV = (has_envelope ? env_vol.placeVolume(modVol, tr_local) : env.placeVolume(modVol, tr_global * tr_local)); - modPV.addPhysVolID("sector", sector_id).addPhysVolID("row", row).addPhysVolID("column", column); + row = std::round((maxY - square.y()) / modSize.y()); + Transform3D tr_local = + RotationZYX(Nrot, 0.0, 0.0) * Translation3D(square.x(), square.y(), 0.0); + auto modPV = (has_envelope ? env_vol.placeVolume(modVol, tr_local) + : env.placeVolume(modVol, tr_global * tr_local)); + modPV.addPhysVolID("sector", sector_id) + .addPhysVolID("row", row) + .addPhysVolID("column", column); total_count++; } } } printout(DEBUG, "HomogeneousCalorimeter_geo", "Number of modules: %d", total_count); - printout(DEBUG, "HomogeneousCalorimeter_geo", "Min X, Y position of module: %.2f, %.2f", minX, minY); - printout(DEBUG, "HomogeneousCalorimeter_geo", "Max X, Y position of module: %.2f, %.2f", maxX, maxY); - + printout(DEBUG, "HomogeneousCalorimeter_geo", "Min X, Y position of module: %.2f, %.2f", minX, + minY); + printout(DEBUG, "HomogeneousCalorimeter_geo", "Max X, Y position of module: %.2f, %.2f", maxX, + maxY); return {sector_id, rowcolumn}; } diff --git a/src/IP6BeamPipe.cpp b/src/IP6BeamPipe.cpp index ae29929c9..d304da7eb 100644 --- a/src/IP6BeamPipe.cpp +++ b/src/IP6BeamPipe.cpp @@ -33,21 +33,20 @@ using namespace dd4hep; * \endcode * */ -static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) { using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); - xml_comp_t x_dettype = x_det.child(dd4hep::xml::Strng_t("type_flags")); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); + xml_comp_t x_dettype = x_det.child(dd4hep::xml::Strng_t("type_flags")); unsigned int typeFlag = x_dettype.type(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Al = det.material("Aluminum"); - Material m_Be = det.material("Beryllium"); - Material m_Au = det.material("Gold"); - Material m_Vacuum = det.material("Vacuum"); - string vis_name = x_det.visStr(); + Assembly assembly(det_name + "_assembly"); + Material m_Al = det.material("Aluminum"); + Material m_Be = det.material("Beryllium"); + Material m_Au = det.material("Gold"); + Material m_Vacuum = det.material("Vacuum"); + string vis_name = x_det.visStr(); xml::Component IP_pipe_c = x_det.child(_Unicode(IP_pipe)); @@ -55,7 +54,8 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * double IP_beampipe_OD = IP_pipe_c.attr<double>(_Unicode(OD)); double IP_beampipe_wall_thickness = IP_pipe_c.attr<double>(_Unicode(wall_thickness)); double IP_beampipe_gold_thickness = IP_pipe_c.attr<double>(_Unicode(gold_thickness)); - double IP_beampipe_ID = IP_beampipe_OD - 2.0 * IP_beampipe_gold_thickness - 2.0 * IP_beampipe_wall_thickness; + double IP_beampipe_ID = + IP_beampipe_OD - 2.0 * IP_beampipe_gold_thickness - 2.0 * IP_beampipe_wall_thickness; double IP_acts_beampipe_OD = IP_beampipe_ID - 5.0 * mm; double IP_acts_beampipe_ID = IP_acts_beampipe_OD - 1.0 * mm; @@ -63,17 +63,17 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * double downstream_straight_length = IP_pipe_c.attr<double>(_Unicode(downstream_straight_length)); // central beampipe volume - Tube central_tube(0.5 * IP_acts_beampipe_ID, 0.5 * IP_acts_beampipe_OD, - 0.5 * (upstream_straight_length + downstream_straight_length)); - Volume central_volume("acts_central_beampipe_vol", central_tube, m_Vacuum); + Tube central_tube(0.5 * IP_acts_beampipe_ID, 0.5 * IP_acts_beampipe_OD, + 0.5 * (upstream_straight_length + downstream_straight_length)); + Volume central_volume("acts_central_beampipe_vol", central_tube, m_Vacuum); const double central_offset = -.5 * (upstream_straight_length - downstream_straight_length); - DetElement central_det(sdet, "acts_beampipe_central", 1); + DetElement central_det(sdet, "acts_beampipe_central", 1); // Set dd4hep variant parameters for conversion to ACTS tracking geometry central_det.setTypeFlag(typeFlag); - auto ¶ms = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(central_det); - int nBinPhi = 144; // fix later. Should take this from a xml tag - int nBinZ = 10; // fix later. Should take this from a xml tag + auto& params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(central_det); + int nBinPhi = 144; // fix later. Should take this from a xml tag + int nBinZ = 10; // fix later. Should take this from a xml tag params.set<bool>("layer_material", true); params.set<bool>("layer_material_representing", true); params.set<int>("layer_material_representing_binPhi", nBinPhi); @@ -93,28 +93,36 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * Tube downstream_IP_vacuum_fill(0.0, IP_acts_beampipe_ID / 2.0, downstream_straight_length / 2.0); Tube downstream_IP_acts_beampipe(IP_acts_beampipe_ID / 2.0, IP_acts_beampipe_OD / 2.0, downstream_straight_length / 2.0); - Tube downstream_IP_vacuum_padding(IP_acts_beampipe_OD / 2.0, IP_beampipe_ID / 2.0, downstream_straight_length / 2.0); + Tube downstream_IP_vacuum_padding(IP_acts_beampipe_OD / 2.0, IP_beampipe_ID / 2.0, + downstream_straight_length / 2.0); Tube downstream_IP_gold(IP_beampipe_ID / 2.0, IP_beampipe_ID / 2.0 + IP_beampipe_gold_thickness, downstream_straight_length / 2.0); Tube downstream_IP_tube(IP_beampipe_ID / 2.0 + IP_beampipe_gold_thickness, IP_beampipe_OD / 2.0, downstream_straight_length / 2.0); Tube upstream_IP_vacuum_fill(0.0, IP_acts_beampipe_ID / 2.0, upstream_straight_length / 2.0); - Tube upstream_IP_acts_beampipe(IP_acts_beampipe_ID / 2.0, IP_acts_beampipe_OD / 2.0, upstream_straight_length / 2.0); - Tube upstream_IP_vacuum_padding(IP_acts_beampipe_OD / 2.0, IP_beampipe_ID / 2.0, upstream_straight_length / 2.0); + Tube upstream_IP_acts_beampipe(IP_acts_beampipe_ID / 2.0, IP_acts_beampipe_OD / 2.0, + upstream_straight_length / 2.0); + Tube upstream_IP_vacuum_padding(IP_acts_beampipe_OD / 2.0, IP_beampipe_ID / 2.0, + upstream_straight_length / 2.0); Tube upstream_IP_gold(IP_beampipe_ID / 2.0, IP_beampipe_ID / 2.0 + IP_beampipe_gold_thickness, upstream_straight_length / 2.0); Tube upstream_IP_tube(IP_beampipe_ID / 2.0 + IP_beampipe_gold_thickness, IP_beampipe_OD / 2.0, upstream_straight_length / 2.0); - Volume v_downstream_IP_vacuum_fill("v_downstream_IP_vacuum_fill", downstream_IP_vacuum_fill, m_Vacuum); - Volume v_downstream_IP_acts_beampipe("v_downstream_IP_acts_beampipe", downstream_IP_acts_beampipe, m_Vacuum); - Volume v_downstream_IP_vacuum_padding("v_downstream_IP_vacuum_padding", downstream_IP_vacuum_padding, m_Vacuum); + Volume v_downstream_IP_vacuum_fill("v_downstream_IP_vacuum_fill", downstream_IP_vacuum_fill, + m_Vacuum); + Volume v_downstream_IP_acts_beampipe("v_downstream_IP_acts_beampipe", downstream_IP_acts_beampipe, + m_Vacuum); + Volume v_downstream_IP_vacuum_padding("v_downstream_IP_vacuum_padding", + downstream_IP_vacuum_padding, m_Vacuum); Volume v_downstream_IP_gold("v_downstream_IP_gold", downstream_IP_gold, m_Au); Volume v_downstream_IP_tube("v_downstream_IP_tube", downstream_IP_tube, m_Be); Volume v_upstream_IP_vacuum_fill("v_upstream_IP_vacuum_fill", upstream_IP_vacuum_fill, m_Vacuum); - Volume v_upstream_IP_acts_beampipe("v_upstream_IP_acts_beampipe", upstream_IP_acts_beampipe, m_Vacuum); - Volume v_upstream_IP_vacuum_padding("v_upstream_IP_vacuum_padding", upstream_IP_vacuum_padding, m_Vacuum); + Volume v_upstream_IP_acts_beampipe("v_upstream_IP_acts_beampipe", upstream_IP_acts_beampipe, + m_Vacuum); + Volume v_upstream_IP_vacuum_padding("v_upstream_IP_vacuum_padding", upstream_IP_vacuum_padding, + m_Vacuum); Volume v_upstream_IP_gold("v_upstream_IP_gold", upstream_IP_gold, m_Au); Volume v_upstream_IP_tube("v_upstream_IP_tube", upstream_IP_tube, m_Be); @@ -126,14 +134,17 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * assembly.placeVolume(v_upstream_IP_vacuum_fill, Position(0, 0, -upstream_straight_length / 2.0)); central_volume.placeVolume(v_upstream_IP_acts_beampipe, Position(0, 0, -upstream_straight_length / 2.0 - central_offset)); - assembly.placeVolume(v_upstream_IP_vacuum_padding, Position(0, 0, -upstream_straight_length / 2.0)); + assembly.placeVolume(v_upstream_IP_vacuum_padding, + Position(0, 0, -upstream_straight_length / 2.0)); assembly.placeVolume(v_upstream_IP_gold, Position(0, 0, -upstream_straight_length / 2.0)); assembly.placeVolume(v_upstream_IP_tube, Position(0, 0, -upstream_straight_length / 2.0)); - assembly.placeVolume(v_downstream_IP_vacuum_fill, Position(0, 0, downstream_straight_length / 2.0)); + assembly.placeVolume(v_downstream_IP_vacuum_fill, + Position(0, 0, downstream_straight_length / 2.0)); central_volume.placeVolume(v_downstream_IP_acts_beampipe, Position(0, 0, downstream_straight_length / 2.0 - central_offset)); - assembly.placeVolume(v_downstream_IP_vacuum_padding, Position(0, 0, downstream_straight_length / 2.0)); + assembly.placeVolume(v_downstream_IP_vacuum_padding, + Position(0, 0, downstream_straight_length / 2.0)); assembly.placeVolume(v_downstream_IP_gold, Position(0, 0, downstream_straight_length / 2.0)); assembly.placeVolume(v_downstream_IP_tube, Position(0, 0, downstream_straight_length / 2.0)); @@ -144,19 +155,21 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * auto zplane_to_polycones = [](xml::Component& x_pipe) { std::vector<double> zero, rmax, rmin, z; for (xml_coll_t x_zplane_i(x_pipe, _Unicode(zplane)); x_zplane_i; ++x_zplane_i) { - xml_comp_t x_zplane = x_zplane_i; - auto thickness = getAttrOrDefault(x_zplane, _Unicode(thickness), x_pipe.thickness()); + xml_comp_t x_zplane = x_zplane_i; + auto thickness = getAttrOrDefault(x_zplane, _Unicode(thickness), x_pipe.thickness()); thickness += getAttrOrDefault(x_zplane, _Unicode(extra_thickness), 0.0); zero.push_back(0); rmax.push_back(x_zplane.attr<double>(_Unicode(OD)) / 2.0); rmin.push_back(x_zplane.attr<double>(_Unicode(OD)) / 2.0 - thickness); z.push_back(x_zplane.attr<double>(_Unicode(z))); } - return std::make_pair<Polycone, Polycone>({0, 2.0 * M_PI, rmin, rmax, z}, {0, 2.0 * M_PI, zero, rmin, z}); + return std::make_pair<Polycone, Polycone>({0, 2.0 * M_PI, rmin, rmax, z}, + {0, 2.0 * M_PI, zero, rmin, z}); }; - auto create_volumes = [&](const std::string& name, xml::Component& x_pipe1, xml::Component& x_pipe2, - xml_coll_t& x_additional_subtraction_i, bool subtract_vacuum_from_matter = true, + auto create_volumes = [&](const std::string& name, xml::Component& x_pipe1, + xml::Component& x_pipe2, xml_coll_t& x_additional_subtraction_i, + bool subtract_vacuum_from_matter = true, bool subtract_matter_from_vacuum = false) { auto pipe1_polycones = zplane_to_polycones(x_pipe1); auto pipe2_polycones = zplane_to_polycones(x_pipe2); @@ -164,7 +177,8 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * auto crossing_angle = getAttrOrDefault(x_pipe2, _Unicode(crossing_angle), 0.0); auto axis_intersection = getAttrOrDefault(x_pipe2, _Unicode(axis_intersection), 0.0); - auto tf = Transform3D(Position(0, 0, axis_intersection)) * Transform3D(RotationY(crossing_angle)) * + auto tf = Transform3D(Position(0, 0, axis_intersection)) * + Transform3D(RotationY(crossing_angle)) * Transform3D(Position(0, 0, -axis_intersection)); // union of all matter and vacuum @@ -188,11 +202,13 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * // subtract additional vacuum from matter for (; x_additional_subtraction_i; ++x_additional_subtraction_i) { - xml_comp_t x_additional_subtraction = x_additional_subtraction_i; - auto additional_polycones = zplane_to_polycones(x_additional_subtraction); - auto additional_crossing_angle = getAttrOrDefault(x_additional_subtraction, _Unicode(crossing_angle), 0.0); - auto additional_axis_intersection = getAttrOrDefault(x_additional_subtraction, _Unicode(axis_intersection), 0.0); - auto additional_tf = Transform3D(Position(0, 0, additional_axis_intersection)) * + xml_comp_t x_additional_subtraction = x_additional_subtraction_i; + auto additional_polycones = zplane_to_polycones(x_additional_subtraction); + auto additional_crossing_angle = + getAttrOrDefault(x_additional_subtraction, _Unicode(crossing_angle), 0.0); + auto additional_axis_intersection = + getAttrOrDefault(x_additional_subtraction, _Unicode(axis_intersection), 0.0); + auto additional_tf = Transform3D(Position(0, 0, additional_axis_intersection)) * Transform3D(RotationY(additional_crossing_angle)) * Transform3D(Position(0, 0, -additional_axis_intersection)); matter = SubtractionSolid(matter, additional_polycones.second, additional_tf); @@ -210,12 +226,14 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * xml::Component upstream_c = x_det.child(_Unicode(upstream)); xml::Component incoming_hadron_c = upstream_c.child(_Unicode(incoming_hadron)); xml::Component outgoing_lepton_c = upstream_c.child(_Unicode(outgoing_lepton)); - xml_coll_t additional_subtractions_upstream(upstream_c, _Unicode(additional_subtraction)); - bool subtract_vacuum_upstream = getAttrOrDefault<bool>(upstream_c, _Unicode(subtract_vacuum), true); - bool subtract_matter_upstream = getAttrOrDefault<bool>(upstream_c, _Unicode(subtract_matter), true); - auto volumes_upstream = - create_volumes("upstream", outgoing_lepton_c, incoming_hadron_c, additional_subtractions_upstream, - subtract_vacuum_upstream, subtract_matter_upstream); + xml_coll_t additional_subtractions_upstream(upstream_c, _Unicode(additional_subtraction)); + bool subtract_vacuum_upstream = + getAttrOrDefault<bool>(upstream_c, _Unicode(subtract_vacuum), true); + bool subtract_matter_upstream = + getAttrOrDefault<bool>(upstream_c, _Unicode(subtract_matter), true); + auto volumes_upstream = create_volumes("upstream", outgoing_lepton_c, incoming_hadron_c, + additional_subtractions_upstream, subtract_vacuum_upstream, + subtract_matter_upstream); auto tf_upstream = Transform3D(RotationZYX(0, 0, 0)); if (getAttrOrDefault<bool>(upstream_c, _Unicode(reflect), true)) { @@ -235,12 +253,14 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * xml::Component downstream_c = x_det.child(_Unicode(downstream)); xml::Component incoming_lepton_c = downstream_c.child(_Unicode(incoming_lepton)); xml::Component outgoing_hadron_c = downstream_c.child(_Unicode(outgoing_hadron)); - xml_coll_t additional_subtractions_downstream(downstream_c, _Unicode(additional_subtraction)); - bool subtract_vacuum_downstream = getAttrOrDefault<bool>(downstream_c, _Unicode(subtract_vacuum), true); - bool subtract_matter_downstream = getAttrOrDefault<bool>(downstream_c, _Unicode(subtract_matter), true); - auto volumes_downstream = - create_volumes("downstream", incoming_lepton_c, outgoing_hadron_c, additional_subtractions_downstream, - subtract_vacuum_downstream, subtract_matter_downstream); + xml_coll_t additional_subtractions_downstream(downstream_c, _Unicode(additional_subtraction)); + bool subtract_vacuum_downstream = + getAttrOrDefault<bool>(downstream_c, _Unicode(subtract_vacuum), true); + bool subtract_matter_downstream = + getAttrOrDefault<bool>(downstream_c, _Unicode(subtract_matter), true); + auto volumes_downstream = create_volumes("downstream", incoming_lepton_c, outgoing_hadron_c, + additional_subtractions_downstream, + subtract_vacuum_downstream, subtract_matter_downstream); auto tf_downstream = Transform3D(RotationZYX(0, 0, 0)); if (getAttrOrDefault<bool>(downstream_c, _Unicode(reflect), true)) { diff --git a/src/InsertCalorimeter_geo.cpp b/src/InsertCalorimeter_geo.cpp index eb6df9549..5a7e8bfd0 100644 --- a/src/InsertCalorimeter_geo.cpp +++ b/src/InsertCalorimeter_geo.cpp @@ -15,16 +15,15 @@ using namespace dd4hep; -static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ - xml_det_t detElem = handle; +static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) { + xml_det_t detElem = handle; std::string detName = detElem.nameStr(); - int detID = detElem.id(); + int detID = detElem.id(); - xml_dim_t dim = detElem.dimensions(); - double width = dim.x(); // Size along x-axis - double height = dim.y(); // Size along y-axis - double length = dim.z(); // Size along z-axis + xml_dim_t dim = detElem.dimensions(); + double width = dim.x(); // Size along x-axis + double height = dim.y(); // Size along y-axis + double length = dim.z(); // Size along z-axis xml_dim_t pos = detElem.position(); // Position in global coordinates @@ -32,23 +31,27 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens // Getting beampipe hole dimensions const xml::Component& beampipe_hole_xml = detElem.child(_Unicode(beampipe_hole)); - const double hole_radius_initial = - dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(initial_hole_radius), 14.61 * cm); + const double hole_radius_initial = dd4hep::getAttrOrDefault<double>( + beampipe_hole_xml, _Unicode(initial_hole_radius), 14.61 * cm); const double hole_radius_final = dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(final_hole_radius), 17.17 * cm); const std::pair<double, double> hole_radii_parameters(hole_radius_initial, hole_radius_final); // Subtract by pos.x() and pos.y() to convert from global to local coordinates const double hole_x_initial = - dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(initial_hole_x), -7.20 * cm) - pos.x(); + dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(initial_hole_x), -7.20 * cm) - + pos.x(); const double hole_x_final = - dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(final_hole_x), -10.44 * cm) - pos.x(); + dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(final_hole_x), -10.44 * cm) - + pos.x(); const std::pair<double, double> hole_x_parameters(hole_x_initial, hole_x_final); const double hole_y_initial = - dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(initial_hole_y), 0. * cm) - pos.y(); + dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(initial_hole_y), 0. * cm) - + pos.y(); const double hole_y_final = - dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(final_hole_y), 0. * cm) - pos.y(); + dd4hep::getAttrOrDefault<double>(beampipe_hole_xml, _Unicode(final_hole_y), 0. * cm) - + pos.y(); const std::pair<double, double> hole_y_parameters(hole_y_initial, hole_y_final); // Getting thickness of backplate @@ -61,7 +64,9 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens Also has only one layer so don't have a backplate_thickness there (so set to 0) */ auto backplate_thickness = - detElem.hasChild(_Unicode(backplate)) ? detElem.child(_Unicode(backplate)).attr<double>(_Unicode(thickness)) : 0.; + detElem.hasChild(_Unicode(backplate)) + ? detElem.child(_Unicode(backplate)).attr<double>(_Unicode(thickness)) + : 0.; // Function that returns a linearly interpolated hole radius, x-position, and y-position at a given z auto get_hole_rxy = [hole_radii_parameters, hole_x_parameters, hole_y_parameters, length, @@ -73,17 +78,20 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens The radius is hole_radius_final at the beginning of the backplate, i.e. z = length - backplate_thickness */ - double hole_radius_slope = - (hole_radii_parameters.second - hole_radii_parameters.first) / (length - backplate_thickness); + double hole_radius_slope = (hole_radii_parameters.second - hole_radii_parameters.first) / + (length - backplate_thickness); double hole_radius_at_z = hole_radius_slope * z_pos + hole_radii_parameters.first; - double hole_xpos_slope = (hole_x_parameters.second - hole_x_parameters.first) / (length - backplate_thickness); - double hole_xpos_at_z = hole_xpos_slope * z_pos + hole_x_parameters.first; + double hole_xpos_slope = + (hole_x_parameters.second - hole_x_parameters.first) / (length - backplate_thickness); + double hole_xpos_at_z = hole_xpos_slope * z_pos + hole_x_parameters.first; - double hole_ypos_slope = (hole_y_parameters.second - hole_y_parameters.first) / (length - backplate_thickness); - double hole_ypos_at_z = hole_ypos_slope * z_pos + hole_y_parameters.first; + double hole_ypos_slope = + (hole_y_parameters.second - hole_y_parameters.first) / (length - backplate_thickness); + double hole_ypos_at_z = hole_ypos_slope * z_pos + hole_y_parameters.first; - std::tuple<double, double, double> hole_rxy = std::make_tuple(hole_radius_at_z, hole_xpos_at_z, hole_ypos_at_z); + std::tuple<double, double, double> hole_rxy = + std::make_tuple(hole_radius_at_z, hole_xpos_at_z, hole_ypos_at_z); return hole_rxy; }; @@ -101,42 +109,42 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens // Looping through all the different layer sections (W/Sc, Steel/Sc, backplate) for (xml_coll_t c(detElem, _U(layer)); c; c++) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - double layer_thickness = x_layer.thickness(); + xml_comp_t x_layer = c; + int repeat = x_layer.repeat(); + double layer_thickness = x_layer.thickness(); // Looping through the number of repeated layers in each section for (int i = 0; i < repeat; i++) { std::string layer_name = detName + _toString(layer_num, "_layer%d"); - Box layer(width / 2., height / 2., layer_thickness / 2.); + Box layer(width / 2., height / 2., layer_thickness / 2.); // Hole radius and position for each layer is determined from z position at the front of the layer const auto hole_rxy = get_hole_rxy(z_distance_traversed); - double hole_r = std::get<0>(hole_rxy); - double hole_x = std::get<1>(hole_rxy); - double hole_y = std::get<2>(hole_rxy); + double hole_r = std::get<0>(hole_rxy); + double hole_x = std::get<1>(hole_rxy); + double hole_y = std::get<2>(hole_rxy); // Removing beampipe shape from each layer - Tube layer_hole(0., hole_r, layer_thickness / 2.); + Tube layer_hole(0., hole_r, layer_thickness / 2.); SubtractionSolid layer_with_hole(layer, layer_hole, Position(hole_x, hole_y, 0.)); - Volume layer_vol(layer_name, layer_with_hole, air); + Volume layer_vol(layer_name, layer_with_hole, air); - int slice_num = 1; - double slice_z = -layer_thickness / 2.; // Keeps track of slices' z locations in each layer + int slice_num = 1; + double slice_z = -layer_thickness / 2.; // Keeps track of slices' z locations in each layer // Looping over each layer's slices for (xml_coll_t l(x_layer, _U(slice)); l; l++) { - xml_comp_t x_slice = l; - double slice_thickness = x_slice.thickness(); - std::string slice_name = layer_name + _toString(slice_num, "slice%d"); - Material slice_mat = desc.material(x_slice.materialStr()); + xml_comp_t x_slice = l; + double slice_thickness = x_slice.thickness(); + std::string slice_name = layer_name + _toString(slice_num, "slice%d"); + Material slice_mat = desc.material(x_slice.materialStr()); slice_z += slice_thickness / 2.; // Going to slice halfway point // Each slice within a layer has the same hole radius and x-y position - Box slice(width / 2., height / 2., slice_thickness / 2.); - Tube slice_hole(0., hole_r, slice_thickness / 2.); + Box slice(width / 2., height / 2., slice_thickness / 2.); + Tube slice_hole(0., hole_r, slice_thickness / 2.); SubtractionSolid slice_with_hole(slice, slice_hole, Position(hole_x, hole_y, 0.)); - Volume slice_vol(slice_name, slice_with_hole, slice_mat); + Volume slice_vol(slice_name, slice_with_hole, slice_mat); // Setting appropriate slices as sensitive if (x_slice.isSensitive()) { @@ -148,7 +156,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens slice_vol.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); // Placing slice within layer - pv = layer_vol.placeVolume(slice_vol, Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); + pv = layer_vol.placeVolume(slice_vol, + Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); pv.addPhysVolID("slice", slice_num); slice_z += slice_thickness / 2.; z_distance_traversed += slice_thickness; @@ -168,10 +177,10 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens Each loop over repeat will increases z_distance_traversed by layer_thickness */ pv = assembly.placeVolume( - layer_vol, - Transform3D( - RotationZYX(0, 0, 0), - Position(0., 0., -length / 2. + (z_distance_traversed - layer_thickness) + layer_thickness / 2.))); + layer_vol, Transform3D(RotationZYX(0, 0, 0), + Position(0., 0., + -length / 2. + (z_distance_traversed - layer_thickness) + + layer_thickness / 2.))); pv.addPhysVolID("layer", layer_num); layer_num++; @@ -179,10 +188,10 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens } DetElement det(detName, detID); - Volume motherVol = desc.pickMotherVolume(det); + Volume motherVol = desc.pickMotherVolume(det); // Placing insert in world volume - auto tr = Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.)); + auto tr = Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.)); PlacedVolume phv = motherVol.placeVolume(assembly, tr); phv.addPhysVolID("system", detID); det.setPlacement(phv); diff --git a/src/LFHCAL_geo.cpp b/src/LFHCAL_geo.cpp index fef21b5d2..d705263da 100644 --- a/src/LFHCAL_geo.cpp +++ b/src/LFHCAL_geo.cpp @@ -17,165 +17,163 @@ #include "XML/Utilities.h" using namespace dd4hep; -struct moduleParamsStrct{ - moduleParamsStrct(): mod_BIwidth(0.), mod_BIheight(0.), mod_SWThick(0.), mod_TWThick(0.), mod_FWThick (0.), - mod_BWThick(0.), mod_width(0.), mod_height(0.), - mod_notchDepth(0.), mod_notchHeight(0.), mod_foilThick(0.), mod_pcbLength(0.), mod_pcbThick(0.), mod_pcbWidth(0.), mod_visStr(""), mod_regStr(""), mod_limStr("") - {} - moduleParamsStrct( double BIwidth, double BIheight, double SWThick, double TWThick, double FWThick, double BWThick, double width, double height, - double notchDepth, double notchHeight, double foilThick, - double pcbLegth, double pcbThick, double pcbWidth, - std::string visStr, std::string regStr, std::string limStr){ - mod_BIwidth = BIwidth; - mod_BIheight = BIheight; - mod_SWThick = SWThick; - mod_TWThick = TWThick; - mod_FWThick = FWThick; - mod_BWThick = BWThick; - mod_width = width; - mod_height = height; - mod_notchDepth = notchDepth; - mod_notchHeight = notchHeight; - mod_foilThick = foilThick; - mod_pcbLength = pcbLegth; - mod_pcbThick = pcbThick; - mod_pcbWidth = pcbWidth; - mod_visStr = visStr; - mod_regStr = regStr; - mod_limStr = limStr; +struct moduleParamsStrct { + moduleParamsStrct() + : mod_BIwidth(0.) + , mod_BIheight(0.) + , mod_SWThick(0.) + , mod_TWThick(0.) + , mod_FWThick(0.) + , mod_BWThick(0.) + , mod_width(0.) + , mod_height(0.) + , mod_notchDepth(0.) + , mod_notchHeight(0.) + , mod_foilThick(0.) + , mod_pcbLength(0.) + , mod_pcbThick(0.) + , mod_pcbWidth(0.) + , mod_visStr("") + , mod_regStr("") + , mod_limStr("") {} + moduleParamsStrct(double BIwidth, double BIheight, double SWThick, double TWThick, double FWThick, + double BWThick, double width, double height, double notchDepth, + double notchHeight, double foilThick, double pcbLegth, double pcbThick, + double pcbWidth, std::string visStr, std::string regStr, std::string limStr) { + mod_BIwidth = BIwidth; + mod_BIheight = BIheight; + mod_SWThick = SWThick; + mod_TWThick = TWThick; + mod_FWThick = FWThick; + mod_BWThick = BWThick; + mod_width = width; + mod_height = height; + mod_notchDepth = notchDepth; + mod_notchHeight = notchHeight; + mod_foilThick = foilThick; + mod_pcbLength = pcbLegth; + mod_pcbThick = pcbThick; + mod_pcbWidth = pcbWidth; + mod_visStr = visStr; + mod_regStr = regStr; + mod_limStr = limStr; } - double mod_BIwidth = 0.; - double mod_BIheight = 0.; - double mod_SWThick = 0.; - double mod_TWThick = 0.; - double mod_FWThick = 0.; - double mod_BWThick = 0.; - double mod_width = 0.; - double mod_height = 0.; - double mod_notchDepth = 0.; - double mod_notchHeight = 0.; - double mod_foilThick = 0.; - double mod_pcbLength = 0.; - double mod_pcbThick = 0.; - double mod_pcbWidth = 0.; - std::string mod_visStr = ""; - std::string mod_regStr = ""; - std::string mod_limStr = ""; -} ; - -struct sliceParamsStrct{ - sliceParamsStrct(): layer_ID(0), slice_ID(0), slice_partID(0), slice_thick(0.), slice_offset(0.), slice_readoutLayer(0), slice_matStr(""), slice_visStr(""), slice_regStr(""), slice_limStr("") - {} - sliceParamsStrct( - int l_ID, int sl_ID, int sl_partID, double sl_thick, double sl_off, int l_rl, std::string sl_matStr, std::string sl_visStr, std::string sl_regStr, std::string sl_limStr ){ - layer_ID = l_ID; - slice_ID = sl_ID; - slice_partID = sl_partID; - slice_thick = sl_thick; - slice_offset = sl_off; - slice_readoutLayer = l_rl; - slice_matStr = sl_matStr; - slice_visStr = sl_visStr; - slice_regStr = sl_regStr; - slice_limStr = sl_limStr; + double mod_BIwidth = 0.; + double mod_BIheight = 0.; + double mod_SWThick = 0.; + double mod_TWThick = 0.; + double mod_FWThick = 0.; + double mod_BWThick = 0.; + double mod_width = 0.; + double mod_height = 0.; + double mod_notchDepth = 0.; + double mod_notchHeight = 0.; + double mod_foilThick = 0.; + double mod_pcbLength = 0.; + double mod_pcbThick = 0.; + double mod_pcbWidth = 0.; + std::string mod_visStr = ""; + std::string mod_regStr = ""; + std::string mod_limStr = ""; +}; +struct sliceParamsStrct { + sliceParamsStrct() + : layer_ID(0) + , slice_ID(0) + , slice_partID(0) + , slice_thick(0.) + , slice_offset(0.) + , slice_readoutLayer(0) + , slice_matStr("") + , slice_visStr("") + , slice_regStr("") + , slice_limStr("") {} + sliceParamsStrct(int l_ID, int sl_ID, int sl_partID, double sl_thick, double sl_off, int l_rl, + std::string sl_matStr, std::string sl_visStr, std::string sl_regStr, + std::string sl_limStr) { + layer_ID = l_ID; + slice_ID = sl_ID; + slice_partID = sl_partID; + slice_thick = sl_thick; + slice_offset = sl_off; + slice_readoutLayer = l_rl; + slice_matStr = sl_matStr; + slice_visStr = sl_visStr; + slice_regStr = sl_regStr; + slice_limStr = sl_limStr; } - int layer_ID = 0; - int slice_ID = 0; - int slice_partID = 0; - double slice_thick = 0.; - double slice_offset = 0.; - int slice_readoutLayer = 0; - std::string slice_matStr = ""; - std::string slice_visStr = ""; - std::string slice_regStr = ""; - std::string slice_limStr = ""; + int layer_ID = 0; + int slice_ID = 0; + int slice_partID = 0; + double slice_thick = 0.; + double slice_offset = 0.; + int slice_readoutLayer = 0; + std::string slice_matStr = ""; + std::string slice_visStr = ""; + std::string slice_regStr = ""; + std::string slice_limStr = ""; }; //************************************************************************************************************ //************************** Assembly for absorber plates *************************************************** //************************************************************************************************************ -Volume createAbsorberPlate(Detector& desc, - std::string basename, - double h_mod, - double w_mod, - double t_mod_tp, - double t_mod_sp, - double t_slice, - double w_notch, - double h_notch, - Material slice_mat, - std::string region, - std::string limit, - std::string vis, - bool renderComp -){ - - double w_plate = (w_mod/2-t_mod_sp)*2; - double l_A = -w_plate/2; - double l_B = -(w_plate/2-w_notch); - double r_A = w_plate/2; - // 0 1 2 3 4 - const std::vector<double> xCoord = { l_A, r_A, r_A, l_A, l_A, - // 5 6 7 - l_B, l_B, l_A - }; - // 0 1 2 3 4 - - double topA = h_mod/2-t_mod_tp; - double topB = h_notch/2; - double botA = -(h_mod/2-t_mod_tp); - double botB = -(h_notch/2); - // 0 1 2 3 4 - const std::vector<double> yCoord = { topA, topA, botA, botA, botB, - // 5 6 7 8 9 - botB, topB, topB - }; - - const std::vector<double> zStep = {-t_slice/2, t_slice/2}; - const std::vector<double> zStepX = {0., 0.}; - const std::vector<double> zStepY = {0., 0.}; - const std::vector<double> zStepScale = {1., 1.}; - - ExtrudedPolygon absplate = ExtrudedPolygon( xCoord, yCoord, zStep, zStepX, zStepY, zStepScale); - - Volume absplate_vol(basename, absplate, slice_mat); +Volume createAbsorberPlate(Detector& desc, std::string basename, double h_mod, double w_mod, + double t_mod_tp, double t_mod_sp, double t_slice, double w_notch, + double h_notch, Material slice_mat, std::string region, + std::string limit, std::string vis, bool renderComp) { + + double w_plate = (w_mod / 2 - t_mod_sp) * 2; + double l_A = -w_plate / 2; + double l_B = -(w_plate / 2 - w_notch); + double r_A = w_plate / 2; + // 0 1 2 3 4 + const std::vector<double> xCoord = {l_A, r_A, r_A, l_A, l_A, + // 5 6 7 + l_B, l_B, l_A}; + // 0 1 2 3 4 + + double topA = h_mod / 2 - t_mod_tp; + double topB = h_notch / 2; + double botA = -(h_mod / 2 - t_mod_tp); + double botB = -(h_notch / 2); + // 0 1 2 3 4 + const std::vector<double> yCoord = {topA, topA, botA, botA, botB, + // 5 6 7 8 9 + botB, topB, topB}; + + const std::vector<double> zStep = {-t_slice / 2, t_slice / 2}; + const std::vector<double> zStepX = {0., 0.}; + const std::vector<double> zStepY = {0., 0.}; + const std::vector<double> zStepScale = {1., 1.}; + + ExtrudedPolygon absplate = ExtrudedPolygon(xCoord, yCoord, zStep, zStepX, zStepY, zStepScale); + + Volume absplate_vol(basename, absplate, slice_mat); // Setting slice attributes - if (renderComp){ + if (renderComp) { absplate_vol.setAttributes(desc, region, limit, vis); } else { absplate_vol.setAttributes(desc, region, limit, "InvisibleNoDaughters"); } - return absplate_vol; - } //************************************************************************************************************ //************************** Filler plate i.e. air & kapton & PCB & ESR //************************************************************************************************************ -Volume createFillerPlate( Detector& desc, - std::string basename, - double h_mod, - double w_mod, - double t_mod_tp, - double t_mod_sp, - double t_slice, - double w_notch, - Material slice_mat, - std::string region, - std::string limit, - std::string vis, - bool renderComp -){ - double w_plate = w_mod-2*t_mod_sp-w_notch; - double h_plate = h_mod-2*t_mod_tp; - - Box filler( w_plate / 2., h_plate / 2., t_slice / 2.); - Volume filler_vol(basename, filler, slice_mat); +Volume createFillerPlate(Detector& desc, std::string basename, double h_mod, double w_mod, + double t_mod_tp, double t_mod_sp, double t_slice, double w_notch, + Material slice_mat, std::string region, std::string limit, std::string vis, + bool renderComp) { + double w_plate = w_mod - 2 * t_mod_sp - w_notch; + double h_plate = h_mod - 2 * t_mod_tp; + + Box filler(w_plate / 2., h_plate / 2., t_slice / 2.); + Volume filler_vol(basename, filler, slice_mat); // Setting slice attributes - if (renderComp){ + if (renderComp) { filler_vol.setAttributes(desc, region, limit, vis); } else { filler_vol.setAttributes(desc, region, limit, "InvisibleNoDaughters"); @@ -187,56 +185,35 @@ Volume createFillerPlate( Detector& desc, //************************************************************************************************************ //************************** single scintillator plate for tower ********************************************* //************************************************************************************************************ -Volume createScintillatorTower( Detector& desc, - std::string basename, - double w_tow, - double h_tow, - double t_slice, - Material slice_mat, - std::string region, - std::string limit, - std::string vis, - SensitiveDetector sens, - bool renderComp -){ - - Box scintplate( w_tow / 2., h_tow / 2., t_slice / 2.); - Volume slice_vol(basename, scintplate, slice_mat); - // Setting appropriate slices as sensitive +Volume createScintillatorTower(Detector& desc, std::string basename, double w_tow, double h_tow, + double t_slice, Material slice_mat, std::string region, + std::string limit, std::string vis, SensitiveDetector sens, + bool renderComp) { + + Box scintplate(w_tow / 2., h_tow / 2., t_slice / 2.); + Volume slice_vol(basename, scintplate, slice_mat); + // Setting appropriate slices as sensitive sens.setType("calorimeter"); slice_vol.setSensitiveDetector(sens); // Setting slice attributes - if (renderComp){ + if (renderComp) { slice_vol.setAttributes(desc, region, limit, vis); } else { slice_vol.setAttributes(desc, region, limit, "InvisibleNoDaughters"); } return slice_vol; - } //************************************************************************************************************ //************************** create scintillator plate with separations for 8M ******************************* //************************************************************************************************************ -Assembly createScintillatorPlateEightM( Detector& desc, - std::string basename, -// int modID, - int layerID, - double h_mod, - double w_mod, - double t_mod_tp, - double t_mod_sp, - double t_slice, - double w_notch, - double t_foil, - Material slice_mat, - int roLayer, - std::string region, - std::string limit, - std::string vis, - SensitiveDetector sens, - bool renderComp -){ +Assembly createScintillatorPlateEightM(Detector& desc, std::string basename, + // int modID, + int layerID, double h_mod, double w_mod, double t_mod_tp, + double t_mod_sp, double t_slice, double w_notch, + double t_foil, Material slice_mat, int roLayer, + std::string region, std::string limit, std::string vis, + SensitiveDetector sens, bool renderComp) { // Tower placement in 8M module //====================================================================== //|| || || || || @@ -248,56 +225,59 @@ Assembly createScintillatorPlateEightM( Detector& desc, //|| || || || || //====================================================================== Assembly modScintAssembly(basename); - double w_plate = w_mod-w_notch-2*t_mod_sp-2*t_foil; - double h_plate = h_mod-2*t_mod_tp-2*t_foil; - double w_tow = (w_plate-6*t_foil)/4; - double h_tow = (h_plate-2*t_foil)/2; + double w_plate = w_mod - w_notch - 2 * t_mod_sp - 2 * t_foil; + double h_plate = h_mod - 2 * t_mod_tp - 2 * t_foil; + double w_tow = (w_plate - 6 * t_foil) / 4; + double h_tow = (h_plate - 2 * t_foil) / 2; // placement volumes PlacedVolume pvm; // foil separations // 0 1 2 3 4 - const std::vector<double> xCoordTi = { -(w_plate/2.), -(w_tow+3*t_foil), -(w_tow+3*t_foil), -(w_tow+1*t_foil), -(w_tow+1*t_foil), - // 5 6 7 8 9 - -t_foil, -t_foil, t_foil, t_foil, w_tow+1*t_foil, - // 10 11 12 13 14 - w_tow+1*t_foil, w_tow+3*t_foil, w_tow+3*t_foil, w_plate/2., w_plate/2., - // 15 16 17 18 19 - w_tow+3*t_foil, w_tow+3*t_foil, w_tow+1*t_foil, w_tow+1*t_foil, t_foil, - // 20 21 22 23 24 - t_foil, -t_foil, -t_foil, -(w_tow+1*t_foil), -(w_tow+1*t_foil), - // 25 26 27 - -(w_tow+3*t_foil),-(w_tow+3*t_foil), -(w_plate/2.) - }; - // 0 1 2 3 4 - const std::vector<double> yCoordTi = { t_foil, t_foil, (h_plate/2.), (h_plate/2.), t_foil, - // 5 6 7 8 9 - t_foil, (h_plate/2.), (h_plate/2.), t_foil, t_foil, - // 10 11 12 13 14 - (h_plate/2.), (h_plate/2.), t_foil, t_foil, -t_foil, - // 15 16 17 18 19 - -t_foil, -(h_plate/2.), -(h_plate/2.), -t_foil, -t_foil, - // 20 21 22 23 24 - -(h_plate/2.), -(h_plate/2.), -t_foil, -t_foil, -(h_plate/2.), - // 25 26 27 - -(h_plate/2.), -t_foil, -t_foil - }; - - const std::vector<double> zStepTi = {-t_slice/2, t_slice/2}; - const std::vector<double> zStepXTi = {0., 0.}; - const std::vector<double> zStepYTi = {0., 0.}; - const std::vector<double> zStepScaleTi = {1., 1.}; - - ExtrudedPolygon foilgrid = ExtrudedPolygon( xCoordTi, yCoordTi, zStepTi, zStepXTi, zStepYTi, zStepScaleTi); - Box foil_t( (w_plate+2*t_foil) / 2., t_foil / 2., t_slice / 2.); - Box foil_s( t_foil / 2., h_plate / 2., t_slice / 2.); - Volume foilgrid_vol(basename+"_ESRFoil_"+_toString(layerID, "_layer_%d"), foilgrid, slice_mat); - Volume foil_t_vol(basename+"_ESRFoilT_"+_toString(layerID, "_layer_%d"), foil_t, slice_mat); - Volume foil_b_vol(basename+"_ESRFoilB_"+_toString(layerID, "_layer_%d"), foil_t, slice_mat); - Volume foil_l_vol(basename+"_ESRFoilL_"+_toString(layerID, "_layer_%d"), foil_s, slice_mat); - Volume foil_r_vol(basename+"_ESRFoilR_"+_toString(layerID, "_layer_%d"), foil_s, slice_mat); + const std::vector<double> xCoordTi = { + -(w_plate / 2.), -(w_tow + 3 * t_foil), -(w_tow + 3 * t_foil), -(w_tow + 1 * t_foil), + -(w_tow + 1 * t_foil), + // 5 6 7 8 9 + -t_foil, -t_foil, t_foil, t_foil, w_tow + 1 * t_foil, + // 10 11 12 13 14 + w_tow + 1 * t_foil, w_tow + 3 * t_foil, w_tow + 3 * t_foil, w_plate / 2., w_plate / 2., + // 15 16 17 18 19 + w_tow + 3 * t_foil, w_tow + 3 * t_foil, w_tow + 1 * t_foil, w_tow + 1 * t_foil, t_foil, + // 20 21 22 23 24 + t_foil, -t_foil, -t_foil, -(w_tow + 1 * t_foil), -(w_tow + 1 * t_foil), + // 25 26 27 + -(w_tow + 3 * t_foil), -(w_tow + 3 * t_foil), -(w_plate / 2.)}; + // 0 1 2 3 4 + const std::vector<double> yCoordTi = { + t_foil, t_foil, (h_plate / 2.), (h_plate / 2.), t_foil, + // 5 6 7 8 9 + t_foil, (h_plate / 2.), (h_plate / 2.), t_foil, t_foil, + // 10 11 12 13 14 + (h_plate / 2.), (h_plate / 2.), t_foil, t_foil, -t_foil, + // 15 16 17 18 19 + -t_foil, -(h_plate / 2.), -(h_plate / 2.), -t_foil, -t_foil, + // 20 21 22 23 24 + -(h_plate / 2.), -(h_plate / 2.), -t_foil, -t_foil, -(h_plate / 2.), + // 25 26 27 + -(h_plate / 2.), -t_foil, -t_foil}; + + const std::vector<double> zStepTi = {-t_slice / 2, t_slice / 2}; + const std::vector<double> zStepXTi = {0., 0.}; + const std::vector<double> zStepYTi = {0., 0.}; + const std::vector<double> zStepScaleTi = {1., 1.}; + + ExtrudedPolygon foilgrid = + ExtrudedPolygon(xCoordTi, yCoordTi, zStepTi, zStepXTi, zStepYTi, zStepScaleTi); + Box foil_t((w_plate + 2 * t_foil) / 2., t_foil / 2., t_slice / 2.); + Box foil_s(t_foil / 2., h_plate / 2., t_slice / 2.); + Volume foilgrid_vol(basename + "_ESRFoil_" + _toString(layerID, "_layer_%d"), foilgrid, + slice_mat); + Volume foil_t_vol(basename + "_ESRFoilT_" + _toString(layerID, "_layer_%d"), foil_t, slice_mat); + Volume foil_b_vol(basename + "_ESRFoilB_" + _toString(layerID, "_layer_%d"), foil_t, slice_mat); + Volume foil_l_vol(basename + "_ESRFoilL_" + _toString(layerID, "_layer_%d"), foil_s, slice_mat); + Volume foil_r_vol(basename + "_ESRFoilR_" + _toString(layerID, "_layer_%d"), foil_s, slice_mat); // Setting slice attributes - if (renderComp){ + if (renderComp) { foilgrid_vol.setAttributes(desc, region, limit, "LFHCALLayerSepVis"); foil_t_vol.setAttributes(desc, region, limit, "LFHCALLayerSepVis"); foil_b_vol.setAttributes(desc, region, limit, "LFHCALLayerSepVis"); @@ -310,36 +290,45 @@ Assembly createScintillatorPlateEightM( Detector& desc, foil_l_vol.setAttributes(desc, region, limit, "InvisibleNoDaughters"); foil_r_vol.setAttributes(desc, region, limit, "InvisibleNoDaughters"); } - pvm = modScintAssembly.placeVolume(foilgrid_vol, Position(0, 0, 0 )); - pvm = modScintAssembly.placeVolume(foil_t_vol, Position(0, 1.5*t_foil+h_tow, 0 )); - pvm = modScintAssembly.placeVolume(foil_b_vol, Position(0, -(1.5*t_foil+h_tow), 0 )); - pvm = modScintAssembly.placeVolume(foil_l_vol, Position(-(3.5*t_foil+2*w_tow), 0, 0 )); - pvm = modScintAssembly.placeVolume(foil_r_vol, Position((3.5*t_foil+2*w_tow), 0, 0 )); + pvm = modScintAssembly.placeVolume(foilgrid_vol, Position(0, 0, 0)); + pvm = modScintAssembly.placeVolume(foil_t_vol, Position(0, 1.5 * t_foil + h_tow, 0)); + pvm = modScintAssembly.placeVolume(foil_b_vol, Position(0, -(1.5 * t_foil + h_tow), 0)); + pvm = modScintAssembly.placeVolume(foil_l_vol, Position(-(3.5 * t_foil + 2 * w_tow), 0, 0)); + pvm = modScintAssembly.placeVolume(foil_r_vol, Position((3.5 * t_foil + 2 * w_tow), 0, 0)); // 8M module placement of scintillator for tower - double rotZ[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - double rotY[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - double rotX[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - double posX[8] = {(w_tow*1.5+3*t_foil), (w_tow*0.5+t_foil), -(w_tow*0.5+t_foil), -(w_tow*1.5+3*t_foil), - (w_tow*1.5+3*t_foil), (w_tow*0.5+t_foil), -(w_tow*0.5+t_foil), -(w_tow*1.5+3*t_foil)}; - double posY[8] = {0.5*(h_tow)+t_foil, 0.5*(h_tow)+t_foil, 0.5*(h_tow)+t_foil, 0.5*(h_tow)+t_foil, - -(0.5*(h_tow)+t_foil), -(0.5*(h_tow)+t_foil), -(0.5*(h_tow)+t_foil), -(0.5*(h_tow)+t_foil)}; - double posZ[8] = {0, 0, 0, 0, - 0, 0, 0, 0}; - int towerx = 0; - int towery = 0; + double rotZ[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + double rotY[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + double rotX[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + double posX[8] = {(w_tow * 1.5 + 3 * t_foil), (w_tow * 0.5 + t_foil), + -(w_tow * 0.5 + t_foil), -(w_tow * 1.5 + 3 * t_foil), + (w_tow * 1.5 + 3 * t_foil), (w_tow * 0.5 + t_foil), + -(w_tow * 0.5 + t_foil), -(w_tow * 1.5 + 3 * t_foil)}; + double posY[8] = {0.5 * (h_tow) + t_foil, 0.5 * (h_tow) + t_foil, 0.5 * (h_tow) + t_foil, + 0.5 * (h_tow) + t_foil, -(0.5 * (h_tow) + t_foil), -(0.5 * (h_tow) + t_foil), + -(0.5 * (h_tow) + t_foil), -(0.5 * (h_tow) + t_foil)}; + double posZ[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + int towerx = 0; + int towery = 0; // loop over all towers within same module - for (int i = 0; i < 8; i++){ + for (int i = 0; i < 8; i++) { // printout(DEBUG, "LFHCAL_geo", basename + _toString(i, "_tower_%d") + "\t" + _toString(modID) + "\t" + _toString(i) + "\t" + _toString(layerID)); - Volume modScintTowerAss = createScintillatorTower( desc, basename+ _toString(i, "_tower_%d"), - w_tow, h_tow, t_slice, - slice_mat, region, limit, vis, sens, renderComp); - pvm = modScintAssembly.placeVolume(modScintTowerAss, Transform3D(RotationZYX(rotZ[i], rotY[i], rotX[i]), Position(posX[i], posY[i], posZ[i] ))); - towerx = i%4; + Volume modScintTowerAss = + createScintillatorTower(desc, basename + _toString(i, "_tower_%d"), w_tow, h_tow, t_slice, + slice_mat, region, limit, vis, sens, renderComp); + pvm = modScintAssembly.placeVolume( + modScintTowerAss, + Transform3D(RotationZYX(rotZ[i], rotY[i], rotX[i]), Position(posX[i], posY[i], posZ[i]))); + towerx = i % 4; towery = 0; - if (i > 3) towery = 1; - pvm.addPhysVolID("towerx", towerx).addPhysVolID("towery", towery).addPhysVolID("layerz", layerID).addPhysVolID("passive", 0).addPhysVolID("rlayerz", roLayer); + if (i > 3) + towery = 1; + pvm.addPhysVolID("towerx", towerx) + .addPhysVolID("towery", towery) + .addPhysVolID("layerz", layerID) + .addPhysVolID("passive", 0) + .addPhysVolID("rlayerz", roLayer); } return modScintAssembly; } @@ -347,25 +336,13 @@ Assembly createScintillatorPlateEightM( Detector& desc, //************************************************************************************************************ //************************** create scintillator plate with separations for 4M ******************************* //************************************************************************************************************ -Assembly createScintillatorPlateFourM( Detector& desc, - std::string basename, -// int modID, - int layerID, - double h_mod, - double w_mod, - double t_mod_tp, - double t_mod_sp, - double t_slice, - double w_notch, - double t_foil, - Material slice_mat, - int roLayer, - std::string region, - std::string limit, - std::string vis, - SensitiveDetector sens, - bool renderComp -){ +Assembly createScintillatorPlateFourM(Detector& desc, std::string basename, + // int modID, + int layerID, double h_mod, double w_mod, double t_mod_tp, + double t_mod_sp, double t_slice, double w_notch, + double t_foil, Material slice_mat, int roLayer, + std::string region, std::string limit, std::string vis, + SensitiveDetector sens, bool renderComp) { // Tower placement in 4M module //-------------------------------- //| || | @@ -378,45 +355,57 @@ Assembly createScintillatorPlateFourM( Detector& desc, //-------------------------------- Assembly modScintAssembly(basename); - double w_plate = w_mod-w_notch-2*t_mod_sp-2*t_foil; - double h_plate = h_mod-2*t_mod_tp-2*t_foil; - double w_tow = (w_plate-2*t_foil)/2; - double h_tow = (h_plate-2*t_foil)/2; + double w_plate = w_mod - w_notch - 2 * t_mod_sp - 2 * t_foil; + double h_plate = h_mod - 2 * t_mod_tp - 2 * t_foil; + double w_tow = (w_plate - 2 * t_foil) / 2; + double h_tow = (h_plate - 2 * t_foil) / 2; // placement volumes PlacedVolume pvm; // foil separations - // 0 1 2 3 4 - const std::vector<double> xCoordTi = { -(w_plate/2.), -t_foil, -t_foil, t_foil, t_foil, - // 5 6 7 8 9 - w_plate/2., w_plate/2., t_foil, t_foil, -t_foil, - // 10 11 - -t_foil, -(w_plate/2.) - }; - // 0 1 2 3 4 - const std::vector<double> yCoordTi = { t_foil, t_foil, (h_plate/2.), (h_plate/2.), t_foil, - // 5 6 7 8 9 - t_foil, -t_foil, -t_foil, -(h_plate/2.), -(h_plate/2.), - // 10 11 - -t_foil, -t_foil, - }; - - const std::vector<double> zStepTi = {-t_slice/2, t_slice/2}; - const std::vector<double> zStepXTi = {0., 0.}; - const std::vector<double> zStepYTi = {0., 0.}; - const std::vector<double> zStepScaleTi = {1., 1.}; - - ExtrudedPolygon foilgrid = ExtrudedPolygon( xCoordTi, yCoordTi, zStepTi, zStepXTi, zStepYTi, zStepScaleTi); - Box foil_t( (w_plate+2*t_foil) / 2., t_foil / 2., t_slice / 2.); - Box foil_s( t_foil / 2., h_plate / 2., t_slice / 2.); - Volume foilgrid_vol(basename+"_ESRFoil_"+_toString(layerID, "_layer_%d"), foilgrid, slice_mat); - Volume foil_t_vol(basename+"_ESRFoilT_"+_toString(layerID, "_layer_%d"), foil_t, slice_mat); - Volume foil_b_vol(basename+"_ESRFoilB_"+_toString(layerID, "_layer_%d"), foil_t, slice_mat); - Volume foil_l_vol(basename+"_ESRFoilL_"+_toString(layerID, "_layer_%d"), foil_s, slice_mat); - Volume foil_r_vol(basename+"_ESRFoilR_"+_toString(layerID, "_layer_%d"), foil_s, slice_mat); + // 0 1 2 3 4 + const std::vector<double> xCoordTi = { + -(w_plate / 2.), -t_foil, -t_foil, t_foil, t_foil, + // 5 6 7 8 9 + w_plate / 2., w_plate / 2., t_foil, t_foil, -t_foil, + // 10 11 + -t_foil, -(w_plate / 2.)}; + // 0 1 2 3 4 + const std::vector<double> yCoordTi = { + t_foil, + t_foil, + (h_plate / 2.), + (h_plate / 2.), + t_foil, + // 5 6 7 8 9 + t_foil, + -t_foil, + -t_foil, + -(h_plate / 2.), + -(h_plate / 2.), + // 10 11 + -t_foil, + -t_foil, + }; + + const std::vector<double> zStepTi = {-t_slice / 2, t_slice / 2}; + const std::vector<double> zStepXTi = {0., 0.}; + const std::vector<double> zStepYTi = {0., 0.}; + const std::vector<double> zStepScaleTi = {1., 1.}; + + ExtrudedPolygon foilgrid = + ExtrudedPolygon(xCoordTi, yCoordTi, zStepTi, zStepXTi, zStepYTi, zStepScaleTi); + Box foil_t((w_plate + 2 * t_foil) / 2., t_foil / 2., t_slice / 2.); + Box foil_s(t_foil / 2., h_plate / 2., t_slice / 2.); + Volume foilgrid_vol(basename + "_ESRFoil_" + _toString(layerID, "_layer_%d"), foilgrid, + slice_mat); + Volume foil_t_vol(basename + "_ESRFoilT_" + _toString(layerID, "_layer_%d"), foil_t, slice_mat); + Volume foil_b_vol(basename + "_ESRFoilB_" + _toString(layerID, "_layer_%d"), foil_t, slice_mat); + Volume foil_l_vol(basename + "_ESRFoilL_" + _toString(layerID, "_layer_%d"), foil_s, slice_mat); + Volume foil_r_vol(basename + "_ESRFoilR_" + _toString(layerID, "_layer_%d"), foil_s, slice_mat); // Setting slice attributes - if (renderComp){ + if (renderComp) { foilgrid_vol.setAttributes(desc, region, limit, "LFHCALLayerSepVis"); foil_t_vol.setAttributes(desc, region, limit, "LFHCALLayerSepVis"); foil_b_vol.setAttributes(desc, region, limit, "LFHCALLayerSepVis"); @@ -429,37 +418,42 @@ Assembly createScintillatorPlateFourM( Detector& desc, foil_l_vol.setAttributes(desc, region, limit, "InvisibleNoDaughters"); foil_r_vol.setAttributes(desc, region, limit, "InvisibleNoDaughters"); } - pvm = modScintAssembly.placeVolume(foilgrid_vol, Position(0, 0, 0 )); - pvm = modScintAssembly.placeVolume(foil_t_vol, Position(0, 1.5*t_foil+h_tow, 0 )); - pvm = modScintAssembly.placeVolume(foil_b_vol, Position(0, -(1.5*t_foil+h_tow), 0 )); - pvm = modScintAssembly.placeVolume(foil_l_vol, Position(-(1.5*t_foil+w_tow), 0, 0 )); - pvm = modScintAssembly.placeVolume(foil_r_vol, Position((1.5*t_foil+w_tow), 0, 0 )); - + pvm = modScintAssembly.placeVolume(foilgrid_vol, Position(0, 0, 0)); + pvm = modScintAssembly.placeVolume(foil_t_vol, Position(0, 1.5 * t_foil + h_tow, 0)); + pvm = modScintAssembly.placeVolume(foil_b_vol, Position(0, -(1.5 * t_foil + h_tow), 0)); + pvm = modScintAssembly.placeVolume(foil_l_vol, Position(-(1.5 * t_foil + w_tow), 0, 0)); + pvm = modScintAssembly.placeVolume(foil_r_vol, Position((1.5 * t_foil + w_tow), 0, 0)); // 4M module placement of scintillator for tower - double rotZ[4] = {0, 0, 0, 0 }; - double rotY[4] = {0, 0, 0, 0 }; - double rotX[4] = {0, 0, 0, 0 }; - double posX[4] = {(w_tow*0.5+t_foil), -(w_tow*0.5+t_foil), - (w_tow*0.5+t_foil), -(w_tow*0.5+t_foil)}; - double posY[4] = {0.5*(h_tow)+t_foil, 0.5*(h_tow)+t_foil, - -(0.5*(h_tow)+t_foil), -(0.5*(h_tow)+t_foil)}; - double posZ[4] = {0, 0, - 0, 0}; - int towerx = 0; - int towery = 0; + double rotZ[4] = {0, 0, 0, 0}; + double rotY[4] = {0, 0, 0, 0}; + double rotX[4] = {0, 0, 0, 0}; + double posX[4] = {(w_tow * 0.5 + t_foil), -(w_tow * 0.5 + t_foil), (w_tow * 0.5 + t_foil), + -(w_tow * 0.5 + t_foil)}; + double posY[4] = {0.5 * (h_tow) + t_foil, 0.5 * (h_tow) + t_foil, -(0.5 * (h_tow) + t_foil), + -(0.5 * (h_tow) + t_foil)}; + double posZ[4] = {0, 0, 0, 0}; + int towerx = 0; + int towery = 0; // loop over all towers within same module - for (int i = 0; i < 4; i++){ + for (int i = 0; i < 4; i++) { // printout(DEBUG, "LFHCAL_geo", basename + _toString(i, "_tower_%d") + "\t" + _toString(modID) + "\t" + _toString(i) + "\t" + _toString(layerID)); - Volume modScintTowerAss = createScintillatorTower( desc, basename+ _toString(i, "_tower_%d"), - w_tow, h_tow, t_slice, - slice_mat, region, limit, vis, sens, renderComp); - pvm = modScintAssembly.placeVolume(modScintTowerAss, Transform3D(RotationZYX(rotZ[i], rotY[i], rotX[i]), Position(posX[i], posY[i], posZ[i] ))); - towerx = i%2; + Volume modScintTowerAss = + createScintillatorTower(desc, basename + _toString(i, "_tower_%d"), w_tow, h_tow, t_slice, + slice_mat, region, limit, vis, sens, renderComp); + pvm = modScintAssembly.placeVolume( + modScintTowerAss, + Transform3D(RotationZYX(rotZ[i], rotY[i], rotX[i]), Position(posX[i], posY[i], posZ[i]))); + towerx = i % 2; towery = 0; - if (i > 1) towery = 1; - pvm.addPhysVolID("towerx", towerx).addPhysVolID("towery", towery).addPhysVolID("layerz", layerID).addPhysVolID("passive", 0).addPhysVolID("rlayerz", roLayer); + if (i > 1) + towery = 1; + pvm.addPhysVolID("towerx", towerx) + .addPhysVolID("towery", towery) + .addPhysVolID("layerz", layerID) + .addPhysVolID("passive", 0) + .addPhysVolID("rlayerz", roLayer); } return modScintAssembly; } @@ -467,20 +461,15 @@ Assembly createScintillatorPlateFourM( Detector& desc, //************************************************************************************************************ //************************** create 8M module assembly ****************************************************** //************************************************************************************************************ -Volume createEightMModule ( Detector& desc, - moduleParamsStrct mod_params, - std::vector<sliceParamsStrct> sl_params, -// int modID, - double length, - SensitiveDetector sens, - bool renderComp, - bool allSen -){ +Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params, + std::vector<sliceParamsStrct> sl_params, + // int modID, + double length, SensitiveDetector sens, bool renderComp, bool allSen) { std::string baseName = "LFHCAL_8M"; // assembly definition - Box modBox( mod_params.mod_width / 2., mod_params.mod_height / 2., length / 2.); - Volume vol_mod(baseName,modBox,desc.material("Air")); + Box modBox(mod_params.mod_width / 2., mod_params.mod_height / 2., length / 2.); + Volume vol_mod(baseName, modBox, desc.material("Air")); vol_mod.setVisAttributes(desc.visAttributes(mod_params.mod_visStr.data())); // placement operator @@ -489,151 +478,229 @@ Volume createEightMModule ( Detector& desc, // Casing definition // ******************************************************************************** // geom definition 8M module casing - Box modFrontPlate( mod_params.mod_width / 2., mod_params.mod_height / 2., mod_params.mod_FWThick / 2.); - Box modSidePlateL( mod_params.mod_SWThick / 2., mod_params.mod_height / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modSidePlateR( mod_params.mod_SWThick / 2., mod_params.mod_height / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modTopPlate( (mod_params.mod_width-2*mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modBottomPlate( (mod_params.mod_width-2*mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modBackCutOut( mod_params.mod_BIwidth / 2., mod_params.mod_BIheight / 2., mod_params.mod_BWThick / 2.); - Box modBackPlateFull( mod_params.mod_width / 2., mod_params.mod_height / 2., mod_params.mod_BWThick / 2.); + Box modFrontPlate(mod_params.mod_width / 2., mod_params.mod_height / 2., + mod_params.mod_FWThick / 2.); + Box modSidePlateL(mod_params.mod_SWThick / 2., mod_params.mod_height / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modSidePlateR(mod_params.mod_SWThick / 2., mod_params.mod_height / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modTopPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., + mod_params.mod_TWThick / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modBottomPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., + mod_params.mod_TWThick / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modBackCutOut(mod_params.mod_BIwidth / 2., mod_params.mod_BIheight / 2., + mod_params.mod_BWThick / 2.); + Box modBackPlateFull(mod_params.mod_width / 2., mod_params.mod_height / 2., + mod_params.mod_BWThick / 2.); SubtractionSolid modBackPlate(modBackPlateFull, modBackCutOut); // volume definition 8M module casing - Volume vol_modFrontPlate(baseName+"_FrontPlate",modFrontPlate,desc.material("Steel235")); - Volume vol_modBackPlate(baseName+"_BackPlate",modBackPlate,desc.material("Steel235")); - Volume vol_modSidePlateL(baseName+"_LeftSidePlate",modSidePlateL,desc.material("Steel235")); - Volume vol_modSidePlateR(baseName+"_RightSidePlate",modSidePlateR,desc.material("Steel235")); - Volume vol_modTopPlate(baseName+"_TopPlate",modTopPlate,desc.material("Steel235")); - Volume vol_modBottomPlate(baseName+"_BottomPlate",modBottomPlate,desc.material("Steel235")); - - if (allSen){ - sens.setType("calorimeter"); - vol_modFrontPlate.setSensitiveDetector(sens); - vol_modBackPlate.setSensitiveDetector(sens); - vol_modSidePlateL.setSensitiveDetector(sens); - vol_modSidePlateR.setSensitiveDetector(sens); - vol_modTopPlate.setSensitiveDetector(sens); - vol_modBottomPlate.setSensitiveDetector(sens); + Volume vol_modFrontPlate(baseName + "_FrontPlate", modFrontPlate, desc.material("Steel235")); + Volume vol_modBackPlate(baseName + "_BackPlate", modBackPlate, desc.material("Steel235")); + Volume vol_modSidePlateL(baseName + "_LeftSidePlate", modSidePlateL, desc.material("Steel235")); + Volume vol_modSidePlateR(baseName + "_RightSidePlate", modSidePlateR, desc.material("Steel235")); + Volume vol_modTopPlate(baseName + "_TopPlate", modTopPlate, desc.material("Steel235")); + Volume vol_modBottomPlate(baseName + "_BottomPlate", modBottomPlate, desc.material("Steel235")); + + if (allSen) { + sens.setType("calorimeter"); + vol_modFrontPlate.setSensitiveDetector(sens); + vol_modBackPlate.setSensitiveDetector(sens); + vol_modSidePlateL.setSensitiveDetector(sens); + vol_modSidePlateR.setSensitiveDetector(sens); + vol_modTopPlate.setSensitiveDetector(sens); + vol_modBottomPlate.setSensitiveDetector(sens); } - if (renderComp){ - vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); + if (renderComp) { + vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); } else { - vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); + vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); } // ******************************************************************************** // long PCB // ******************************************************************************** - Box modPCB( mod_params.mod_pcbThick / 2., mod_params.mod_pcbWidth / 2., (mod_params.mod_pcbLength) / 2.); - Volume vol_modPCB(baseName+"_PCB",modPCB,desc.material("Fr4")); - if (renderComp){ + Box modPCB(mod_params.mod_pcbThick / 2., mod_params.mod_pcbWidth / 2., + (mod_params.mod_pcbLength) / 2.); + Volume vol_modPCB(baseName + "_PCB", modPCB, desc.material("Fr4")); + if (renderComp) { vol_modPCB.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "LFHCALModPCB"); } else { - vol_modPCB.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); + vol_modPCB.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); } - int layer_num = 0; - double slice_z = -length/2+mod_params.mod_FWThick; // Keeps track of layers' local z locations + int layer_num = 0; + double slice_z = -length / 2 + mod_params.mod_FWThick; // Keeps track of layers' local z locations // Looping through the number of repeated layers & slices in each section - for (int i = 0; i < (int)sl_params.size(); i++){ - slice_z += sl_params[i].slice_offset + sl_params[i].slice_thick / 2.; // Going to halfway point in layer + for (int i = 0; i < (int)sl_params.size(); i++) { + slice_z += sl_params[i].slice_offset + + sl_params[i].slice_thick / 2.; // Going to halfway point in layer layer_num = sl_params[i].layer_ID; //************************************************* // absorber plates //************************************************* Material slice_mat = desc.material(sl_params[i].slice_matStr); - if (sl_params[i].slice_partID == 1 ){ - Volume modAbsAssembly = createAbsorberPlate( desc, - baseName+"_Abs"+_toString(sl_params[i].layer_ID, "_layer_%d"), - mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, mod_params.mod_SWThick, - sl_params[i].slice_thick, mod_params.mod_notchDepth, - mod_params.mod_notchHeight, - slice_mat, sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); + if (sl_params[i].slice_partID == 1) { + Volume modAbsAssembly = createAbsorberPlate( + desc, baseName + "_Abs" + _toString(sl_params[i].layer_ID, "_layer_%d"), + mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, + mod_params.mod_SWThick, sl_params[i].slice_thick, mod_params.mod_notchDepth, + mod_params.mod_notchHeight, slice_mat, sl_params[i].slice_regStr, + sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); // Placing slice within layer - if (allSen) modAbsAssembly.setSensitiveDetector(sens); - pvm = vol_mod.placeVolume(modAbsAssembly, Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); - if (allSen) pvm.addPhysVolID("towerx", 0).addPhysVolID("towery", 0).addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer).addPhysVolID("layerz", layer_num).addPhysVolID("passive", 1); - //************************************************* - // air & kapton & PCB & ESR - //************************************************* - } else if (sl_params[i].slice_partID == 2 ){ - Volume modFillAssembly = createFillerPlate( desc, - baseName+"_Fill"+_toString(sl_params[i].layer_ID, "_layer_%d")+_toString(sl_params[i].slice_ID, "slice_%d"), - mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, mod_params.mod_SWThick, - sl_params[i].slice_thick, mod_params.mod_notchDepth, - slice_mat, sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); + if (allSen) + modAbsAssembly.setSensitiveDetector(sens); + pvm = vol_mod.placeVolume(modAbsAssembly, + Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); + if (allSen) + pvm.addPhysVolID("towerx", 0) + .addPhysVolID("towery", 0) + .addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer) + .addPhysVolID("layerz", layer_num) + .addPhysVolID("passive", 1); + //************************************************* + // air & kapton & PCB & ESR + //************************************************* + } else if (sl_params[i].slice_partID == 2) { + Volume modFillAssembly = + createFillerPlate(desc, + baseName + "_Fill" + _toString(sl_params[i].layer_ID, "_layer_%d") + + _toString(sl_params[i].slice_ID, "slice_%d"), + mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, + mod_params.mod_SWThick, sl_params[i].slice_thick, + mod_params.mod_notchDepth, slice_mat, sl_params[i].slice_regStr, + sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); // Placing slice within layer - if (allSen) modFillAssembly.setSensitiveDetector(sens); - pvm = vol_mod.placeVolume(modFillAssembly, Transform3D(RotationZYX(0, 0, 0), Position((mod_params.mod_notchDepth)/2., 0., slice_z))); - if (allSen) pvm.addPhysVolID("towerx", 1).addPhysVolID("towery", 0).addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer).addPhysVolID("layerz", layer_num).addPhysVolID("passive", 1); - //************************************************* - // scintillator - //************************************************* + if (allSen) + modFillAssembly.setSensitiveDetector(sens); + pvm = vol_mod.placeVolume( + modFillAssembly, Transform3D(RotationZYX(0, 0, 0), + Position((mod_params.mod_notchDepth) / 2., 0., slice_z))); + if (allSen) + pvm.addPhysVolID("towerx", 1) + .addPhysVolID("towery", 0) + .addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer) + .addPhysVolID("layerz", layer_num) + .addPhysVolID("passive", 1); + //************************************************* + // scintillator + //************************************************* } else { - Assembly modScintAssembly = createScintillatorPlateEightM( desc, - baseName+"_ScintAssembly"+_toString(sl_params[i].layer_ID, "_layer_%d"), - layer_num, - mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, mod_params.mod_SWThick, - sl_params[i].slice_thick, mod_params.mod_notchDepth, mod_params.mod_foilThick, - slice_mat, sl_params[i].slice_readoutLayer ,sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, sens, renderComp); + Assembly modScintAssembly = createScintillatorPlateEightM( + desc, baseName + "_ScintAssembly" + _toString(sl_params[i].layer_ID, "_layer_%d"), + layer_num, mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, + mod_params.mod_SWThick, sl_params[i].slice_thick, mod_params.mod_notchDepth, + mod_params.mod_foilThick, slice_mat, sl_params[i].slice_readoutLayer, + sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, sens, + renderComp); // Placing slice within layer - pvm = vol_mod.placeVolume(modScintAssembly, Transform3D(RotationZYX(0, 0, 0), Position((mod_params.mod_notchDepth)/2., 0, slice_z))); + pvm = vol_mod.placeVolume( + modScintAssembly, Transform3D(RotationZYX(0, 0, 0), + Position((mod_params.mod_notchDepth) / 2., 0, slice_z))); } slice_z += sl_params[i].slice_thick / 2.; } // placement 8M module casing - pvm = vol_mod.placeVolume(vol_modFrontPlate, Position(0, 0, -( length-mod_params.mod_FWThick) / 2. )); - if (allSen) pvm.addPhysVolID("towerx", 2).addPhysVolID("towery", 0).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modBackPlate, Position(0, 0, ( length-mod_params.mod_BWThick) / 2. )); - if (allSen) pvm.addPhysVolID("towerx", 2).addPhysVolID("towery", 0).addPhysVolID("layerz", layer_num).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modSidePlateL, Position(-(mod_params.mod_width-mod_params.mod_SWThick)/2., 0, (mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 3).addPhysVolID("towery", 0).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modSidePlateR, Position((mod_params.mod_width-mod_params.mod_SWThick)/2., 0,(mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 0).addPhysVolID("towery", 1).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modTopPlate, Position(0, (mod_params.mod_height-mod_params.mod_TWThick)/2., (mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 1).addPhysVolID("towery", 1).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modBottomPlate, Position(0, -(mod_params.mod_height-mod_params.mod_TWThick)/2., (mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 2).addPhysVolID("towery", 1).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - - double lengthA = length-mod_params.mod_FWThick-mod_params.mod_BWThick; - double z_offSetPCB = (mod_params.mod_FWThick-mod_params.mod_BWThick)/2-(lengthA-mod_params.mod_pcbLength)/2.; - - pvm = vol_mod.placeVolume(vol_modPCB, Position(-(mod_params.mod_width-2*mod_params.mod_SWThick-mod_params.mod_notchDepth)/2., 0, z_offSetPCB)); + pvm = vol_mod.placeVolume(vol_modFrontPlate, + Position(0, 0, -(length - mod_params.mod_FWThick) / 2.)); + if (allSen) + pvm.addPhysVolID("towerx", 2) + .addPhysVolID("towery", 0) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = + vol_mod.placeVolume(vol_modBackPlate, Position(0, 0, (length - mod_params.mod_BWThick) / 2.)); + if (allSen) + pvm.addPhysVolID("towerx", 2) + .addPhysVolID("towery", 0) + .addPhysVolID("layerz", layer_num) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modSidePlateL, + Position(-(mod_params.mod_width - mod_params.mod_SWThick) / 2., 0, + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 3) + .addPhysVolID("towery", 0) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modSidePlateR, + Position((mod_params.mod_width - mod_params.mod_SWThick) / 2., 0, + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 0) + .addPhysVolID("towery", 1) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modTopPlate, + Position(0, (mod_params.mod_height - mod_params.mod_TWThick) / 2., + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 1) + .addPhysVolID("towery", 1) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modBottomPlate, + Position(0, -(mod_params.mod_height - mod_params.mod_TWThick) / 2., + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 2) + .addPhysVolID("towery", 1) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + + double lengthA = length - mod_params.mod_FWThick - mod_params.mod_BWThick; + double z_offSetPCB = (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2 - + (lengthA - mod_params.mod_pcbLength) / 2.; + + pvm = vol_mod.placeVolume( + vol_modPCB, + Position(-(mod_params.mod_width - 2 * mod_params.mod_SWThick - mod_params.mod_notchDepth) / + 2., + 0, z_offSetPCB)); return vol_mod; } - //************************************************************************************************************ //************************** create 8M module assembly ****************************************************** //************************************************************************************************************ -Volume createFourMModule ( Detector& desc, - moduleParamsStrct mod_params, - std::vector<sliceParamsStrct> sl_params, -// int modID, - double length, - SensitiveDetector sens, - bool renderComp, - bool allSen -){ +Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params, + std::vector<sliceParamsStrct> sl_params, + // int modID, + double length, SensitiveDetector sens, bool renderComp, bool allSen) { std::string baseName = "LFHCAL_4M"; // assembly definition - Box modBox( mod_params.mod_width / 2., mod_params.mod_height / 2., length / 2.); - Volume vol_mod(baseName,modBox,desc.material("Air")); + Box modBox(mod_params.mod_width / 2., mod_params.mod_height / 2., length / 2.); + Volume vol_mod(baseName, modBox, desc.material("Air")); printout(DEBUG, "LFHCAL_geo", "visualization string module: " + mod_params.mod_visStr); vol_mod.setVisAttributes(desc.visAttributes(mod_params.mod_visStr.data())); @@ -643,126 +710,213 @@ Volume createFourMModule ( Detector& desc, // Casing definition // ******************************************************************************** // geom definition 8M module casing - Box modFrontPlate( mod_params.mod_width / 2., mod_params.mod_height / 2., mod_params.mod_FWThick / 2.); - Box modSidePlateL( mod_params.mod_SWThick / 2., mod_params.mod_height / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modSidePlateR( mod_params.mod_SWThick / 2., mod_params.mod_height / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modTopPlate( (mod_params.mod_width-2*mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modBottomPlate( (mod_params.mod_width-2*mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2., (length-mod_params.mod_FWThick-mod_params.mod_BWThick) / 2.); - Box modBackCutOut( mod_params.mod_BIwidth / 2., mod_params.mod_BIheight / 2., mod_params.mod_BWThick / 2.); - Box modBackPlateFull( mod_params.mod_width / 2., mod_params.mod_height / 2., mod_params.mod_BWThick / 2.); + Box modFrontPlate(mod_params.mod_width / 2., mod_params.mod_height / 2., + mod_params.mod_FWThick / 2.); + Box modSidePlateL(mod_params.mod_SWThick / 2., mod_params.mod_height / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modSidePlateR(mod_params.mod_SWThick / 2., mod_params.mod_height / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modTopPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., + mod_params.mod_TWThick / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modBottomPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., + mod_params.mod_TWThick / 2., + (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.); + Box modBackCutOut(mod_params.mod_BIwidth / 2., mod_params.mod_BIheight / 2., + mod_params.mod_BWThick / 2.); + Box modBackPlateFull(mod_params.mod_width / 2., mod_params.mod_height / 2., + mod_params.mod_BWThick / 2.); SubtractionSolid modBackPlate(modBackPlateFull, modBackCutOut); // volume definition 8M module casing - Volume vol_modFrontPlate(baseName+"_FrontPlate",modFrontPlate,desc.material("Steel235")); - Volume vol_modBackPlate(baseName+"_BackPlate",modBackPlate,desc.material("Steel235")); - Volume vol_modSidePlateL(baseName+"_LeftSidePlate",modSidePlateL,desc.material("Steel235")); - Volume vol_modSidePlateR(baseName+"_RightSidePlate",modSidePlateR,desc.material("Steel235")); - Volume vol_modTopPlate(baseName+"_TopPlate",modTopPlate,desc.material("Steel235")); - Volume vol_modBottomPlate(baseName+"_BottomPlate",modBottomPlate,desc.material("Steel235")); - - if (allSen){ - sens.setType("calorimeter"); - vol_modFrontPlate.setSensitiveDetector(sens); - vol_modBackPlate.setSensitiveDetector(sens); - vol_modSidePlateL.setSensitiveDetector(sens); - vol_modSidePlateR.setSensitiveDetector(sens); - vol_modTopPlate.setSensitiveDetector(sens); - vol_modBottomPlate.setSensitiveDetector(sens); + Volume vol_modFrontPlate(baseName + "_FrontPlate", modFrontPlate, desc.material("Steel235")); + Volume vol_modBackPlate(baseName + "_BackPlate", modBackPlate, desc.material("Steel235")); + Volume vol_modSidePlateL(baseName + "_LeftSidePlate", modSidePlateL, desc.material("Steel235")); + Volume vol_modSidePlateR(baseName + "_RightSidePlate", modSidePlateR, desc.material("Steel235")); + Volume vol_modTopPlate(baseName + "_TopPlate", modTopPlate, desc.material("Steel235")); + Volume vol_modBottomPlate(baseName + "_BottomPlate", modBottomPlate, desc.material("Steel235")); + + if (allSen) { + sens.setType("calorimeter"); + vol_modFrontPlate.setSensitiveDetector(sens); + vol_modBackPlate.setSensitiveDetector(sens); + vol_modSidePlateL.setSensitiveDetector(sens); + vol_modSidePlateR.setSensitiveDetector(sens); + vol_modTopPlate.setSensitiveDetector(sens); + vol_modBottomPlate.setSensitiveDetector(sens); } - - if (renderComp){ - vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); - vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, mod_params.mod_visStr); + if (renderComp) { + vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); + vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + mod_params.mod_visStr); } else { - vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); - vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); + vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); + vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); } // ******************************************************************************** // long PCB // ******************************************************************************** - Box modPCB( mod_params.mod_pcbThick / 2., mod_params.mod_pcbWidth / 2., (mod_params.mod_pcbLength) / 2.); - Volume vol_modPCB(baseName+"_PCB",modPCB,desc.material("Fr4")); - if (renderComp){ + Box modPCB(mod_params.mod_pcbThick / 2., mod_params.mod_pcbWidth / 2., + (mod_params.mod_pcbLength) / 2.); + Volume vol_modPCB(baseName + "_PCB", modPCB, desc.material("Fr4")); + if (renderComp) { vol_modPCB.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "LFHCALModPCB"); } else { - vol_modPCB.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, "InvisibleNoDaughters"); + vol_modPCB.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr, + "InvisibleNoDaughters"); } - int layer_num = 0; - double slice_z = -length/2+mod_params.mod_FWThick; // Keeps track of layers' local z locations + int layer_num = 0; + double slice_z = -length / 2 + mod_params.mod_FWThick; // Keeps track of layers' local z locations // Looping through the number of repeated layers & slices in each section - for (int i = 0; i < (int)sl_params.size(); i++){ - slice_z += sl_params[i].slice_offset + sl_params[i].slice_thick/2. ; // Going to halfway point in layer + for (int i = 0; i < (int)sl_params.size(); i++) { + slice_z += sl_params[i].slice_offset + + sl_params[i].slice_thick / 2.; // Going to halfway point in layer layer_num = sl_params[i].layer_ID; //************************************************* // absorber plates //************************************************* Material slice_mat = desc.material(sl_params[i].slice_matStr); - if (sl_params[i].slice_partID == 1 ){ - Volume modAbsAssembly = createAbsorberPlate( desc, baseName+"_Abs"+_toString(sl_params[i].layer_ID, "_layer_%d"), - mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, mod_params.mod_SWThick, - sl_params[i].slice_thick, mod_params.mod_notchDepth, mod_params.mod_notchHeight, - slice_mat, sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); + if (sl_params[i].slice_partID == 1) { + Volume modAbsAssembly = createAbsorberPlate( + desc, baseName + "_Abs" + _toString(sl_params[i].layer_ID, "_layer_%d"), + mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, + mod_params.mod_SWThick, sl_params[i].slice_thick, mod_params.mod_notchDepth, + mod_params.mod_notchHeight, slice_mat, sl_params[i].slice_regStr, + sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); // Placing slice within layer - if (allSen) modAbsAssembly.setSensitiveDetector(sens); - pvm = vol_mod.placeVolume(modAbsAssembly, Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); - if (allSen) pvm.addPhysVolID("towerx", 0).addPhysVolID("towery", 0).addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer).addPhysVolID("layerz", layer_num).addPhysVolID("passive", 1); - //************************************************* - // air & kapton & PCB & ESR - //************************************************* - } else if (sl_params[i].slice_partID == 2 ){ - Volume modFillAssembly = createFillerPlate( desc, - baseName+"_Fill"+_toString(sl_params[i].layer_ID, "_layer_%d")+_toString(sl_params[i].slice_ID, "slice_%d"), - mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, mod_params.mod_SWThick, - sl_params[i].slice_thick, mod_params.mod_notchDepth, - slice_mat, sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); + if (allSen) + modAbsAssembly.setSensitiveDetector(sens); + pvm = vol_mod.placeVolume(modAbsAssembly, + Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); + if (allSen) + pvm.addPhysVolID("towerx", 0) + .addPhysVolID("towery", 0) + .addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer) + .addPhysVolID("layerz", layer_num) + .addPhysVolID("passive", 1); + //************************************************* + // air & kapton & PCB & ESR + //************************************************* + } else if (sl_params[i].slice_partID == 2) { + Volume modFillAssembly = + createFillerPlate(desc, + baseName + "_Fill" + _toString(sl_params[i].layer_ID, "_layer_%d") + + _toString(sl_params[i].slice_ID, "slice_%d"), + mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, + mod_params.mod_SWThick, sl_params[i].slice_thick, + mod_params.mod_notchDepth, slice_mat, sl_params[i].slice_regStr, + sl_params[i].slice_limStr, sl_params[i].slice_visStr, renderComp); // Placing slice within layer - if (allSen) modFillAssembly.setSensitiveDetector(sens); - pvm = vol_mod.placeVolume(modFillAssembly, Transform3D(RotationZYX(0, 0, 0), Position((mod_params.mod_notchDepth)/2.,0. , slice_z))); - if (allSen) pvm.addPhysVolID("towerx", 1).addPhysVolID("towery", 0).addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer).addPhysVolID("layerz", layer_num).addPhysVolID("passive", 1); - //************************************************* - // scintillator - //************************************************* + if (allSen) + modFillAssembly.setSensitiveDetector(sens); + pvm = vol_mod.placeVolume( + modFillAssembly, Transform3D(RotationZYX(0, 0, 0), + Position((mod_params.mod_notchDepth) / 2., 0., slice_z))); + if (allSen) + pvm.addPhysVolID("towerx", 1) + .addPhysVolID("towery", 0) + .addPhysVolID("rlayerz", sl_params[i].slice_readoutLayer) + .addPhysVolID("layerz", layer_num) + .addPhysVolID("passive", 1); + //************************************************* + // scintillator + //************************************************* } else { - Assembly modScintAssembly = createScintillatorPlateFourM( desc,baseName+"_ScintAssembly"+_toString(sl_params[i].layer_ID, "_layer_%d"), - layer_num, mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, mod_params.mod_SWThick, - sl_params[i].slice_thick, mod_params.mod_notchDepth, mod_params.mod_foilThick, - slice_mat, sl_params[i].slice_readoutLayer, sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, sens, renderComp); + Assembly modScintAssembly = createScintillatorPlateFourM( + desc, baseName + "_ScintAssembly" + _toString(sl_params[i].layer_ID, "_layer_%d"), + layer_num, mod_params.mod_height, mod_params.mod_width, mod_params.mod_TWThick, + mod_params.mod_SWThick, sl_params[i].slice_thick, mod_params.mod_notchDepth, + mod_params.mod_foilThick, slice_mat, sl_params[i].slice_readoutLayer, + sl_params[i].slice_regStr, sl_params[i].slice_limStr, sl_params[i].slice_visStr, sens, + renderComp); // Placing slice within layer - pvm = vol_mod.placeVolume(modScintAssembly, Transform3D(RotationZYX(0, 0, 0), Position((mod_params.mod_notchDepth)/2., 0, slice_z))); + pvm = vol_mod.placeVolume( + modScintAssembly, Transform3D(RotationZYX(0, 0, 0), + Position((mod_params.mod_notchDepth) / 2., 0, slice_z))); } - slice_z += sl_params[i].slice_thick/2.; + slice_z += sl_params[i].slice_thick / 2.; } // placement 4M module casing - pvm = vol_mod.placeVolume(vol_modFrontPlate, Position(0, 0, -( length-mod_params.mod_FWThick) / 2. )); - if (allSen) pvm.addPhysVolID("towerx", 2).addPhysVolID("towery", 0).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modBackPlate, Position(0, 0, ( length-mod_params.mod_BWThick) / 2. )); - if (allSen) pvm.addPhysVolID("towerx", 2).addPhysVolID("towery", 0).addPhysVolID("layerz", layer_num).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modSidePlateL, Position(-(mod_params.mod_width-mod_params.mod_SWThick)/2., 0, (mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 3).addPhysVolID("towery", 0).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modSidePlateR, Position((mod_params.mod_width-mod_params.mod_SWThick)/2., 0,(mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 0).addPhysVolID("towery", 1).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modTopPlate, Position(0, (mod_params.mod_height-mod_params.mod_TWThick)/2., (mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 1).addPhysVolID("towery", 1).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - pvm = vol_mod.placeVolume(vol_modBottomPlate, Position(0, -(mod_params.mod_height-mod_params.mod_TWThick)/2., (mod_params.mod_FWThick-mod_params.mod_BWThick)/2)); - if (allSen) pvm.addPhysVolID("towerx", 2).addPhysVolID("towery", 1).addPhysVolID("layerz", 0).addPhysVolID("passive", 1); - - double lengthA = length-mod_params.mod_FWThick-mod_params.mod_BWThick; - double z_offSetPCB = (mod_params.mod_FWThick-mod_params.mod_BWThick)/2-(lengthA-mod_params.mod_pcbLength)/2.; - - pvm = vol_mod.placeVolume(vol_modPCB, Position(-(mod_params.mod_width-2*mod_params.mod_SWThick-mod_params.mod_notchDepth)/2., 0, z_offSetPCB)); + pvm = vol_mod.placeVolume(vol_modFrontPlate, + Position(0, 0, -(length - mod_params.mod_FWThick) / 2.)); + if (allSen) + pvm.addPhysVolID("towerx", 2) + .addPhysVolID("towery", 0) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = + vol_mod.placeVolume(vol_modBackPlate, Position(0, 0, (length - mod_params.mod_BWThick) / 2.)); + if (allSen) + pvm.addPhysVolID("towerx", 2) + .addPhysVolID("towery", 0) + .addPhysVolID("layerz", layer_num) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modSidePlateL, + Position(-(mod_params.mod_width - mod_params.mod_SWThick) / 2., 0, + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 3) + .addPhysVolID("towery", 0) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modSidePlateR, + Position((mod_params.mod_width - mod_params.mod_SWThick) / 2., 0, + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 0) + .addPhysVolID("towery", 1) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modTopPlate, + Position(0, (mod_params.mod_height - mod_params.mod_TWThick) / 2., + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 1) + .addPhysVolID("towery", 1) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + pvm = vol_mod.placeVolume(vol_modBottomPlate, + Position(0, -(mod_params.mod_height - mod_params.mod_TWThick) / 2., + (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2)); + if (allSen) + pvm.addPhysVolID("towerx", 2) + .addPhysVolID("towery", 1) + .addPhysVolID("layerz", 0) + .addPhysVolID("passive", 1); + + double lengthA = length - mod_params.mod_FWThick - mod_params.mod_BWThick; + double z_offSetPCB = (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2 - + (lengthA - mod_params.mod_pcbLength) / 2.; + + pvm = vol_mod.placeVolume( + vol_modPCB, + Position(-(mod_params.mod_width - 2 * mod_params.mod_SWThick - mod_params.mod_notchDepth) / + 2., + 0, z_offSetPCB)); return vol_mod; } @@ -772,26 +926,27 @@ Volume createFourMModule ( Detector& desc, //============================== MAIN FUNCTION ============================================= //* * //******************************************************************************************** -static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ +static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) { // global detector variables - xml_det_t detElem = handle; + xml_det_t detElem = handle; std::string detName = detElem.nameStr(); - int detID = detElem.id(); + int detID = detElem.id(); // general detector dimensions - xml_dim_t dim = detElem.dimensions(); - double length = dim.z(); // Size along z-axis + xml_dim_t dim = detElem.dimensions(); + double length = dim.z(); // Size along z-axis // general detector position xml_dim_t pos = detElem.position(); - printout(DEBUG, "LFHCAL_geo", "global LFHCal position " + _toString(pos.x()) + "\t" + _toString(pos.y()) + "\t" + _toString(pos.z())); + printout(DEBUG, "LFHCAL_geo", + "global LFHCal position " + _toString(pos.x()) + "\t" + _toString(pos.y()) + "\t" + + _toString(pos.z())); // envelope volume xml_comp_t x_env = detElem.child(_Unicode(envelope)); Tube rmaxtube(0, dim.rmax(), dim.z() / 2); Box beampipe(dim.x() / 2, dim.y() / 2, dim.z() / 2); - Solid env = SubtractionSolid(rmaxtube, beampipe, Position(dim.x0(),0,0)); + Solid env = SubtractionSolid(rmaxtube, beampipe, Position(dim.x0(), 0, 0)); Volume env_vol(detName + "_env", env, desc.material(x_env.materialStr())); bool renderComponents = getAttrOrDefault(detElem, _Unicode(renderComponents), 0.); @@ -803,8 +958,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens } // 8M module specific loading - xml_comp_t eightM_xml = detElem.child(_Unicode(eightmodule)); - xml_dim_t eightMmod_dim = eightM_xml.dimensions(); + xml_comp_t eightM_xml = detElem.child(_Unicode(eightmodule)); + xml_dim_t eightMmod_dim = eightM_xml.dimensions(); moduleParamsStrct eightM_params(getAttrOrDefault(eightMmod_dim, _Unicode(widthBackInner), 0.), getAttrOrDefault(eightMmod_dim, _Unicode(heightBackInner), 0.), getAttrOrDefault(eightMmod_dim, _Unicode(widthSideWall), 0.), @@ -819,52 +974,50 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens getAttrOrDefault(eightMmod_dim, _Unicode(pcbLength), 0.), getAttrOrDefault(eightMmod_dim, _Unicode(pcbThick), 0.), getAttrOrDefault(eightMmod_dim, _Unicode(pcbWidth), 0.), - eightM_xml.visStr(), - eightM_xml.regionStr(), - eightM_xml.limitsStr() - ); + eightM_xml.visStr(), eightM_xml.regionStr(), + eightM_xml.limitsStr()); // 4M module specific loading - xml_comp_t fourM_xml = detElem.child(_Unicode(fourmodule)); - xml_dim_t fourMmod_dim = fourM_xml.dimensions(); - moduleParamsStrct fourM_params( getAttrOrDefault(fourMmod_dim, _Unicode(widthBackInner), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(heightBackInner), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(widthSideWall), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(widthTopWall), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(thicknessFrontWall), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(thicknessBackWall), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(width), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(height), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(notchDepth), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(notchHeight), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(foilThick), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(pcbLength), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(pcbThick), 0.), - getAttrOrDefault(fourMmod_dim, _Unicode(pcbWidth), 0.), - fourM_xml.visStr(), - fourM_xml.regionStr(), - fourM_xml.limitsStr()); + xml_comp_t fourM_xml = detElem.child(_Unicode(fourmodule)); + xml_dim_t fourMmod_dim = fourM_xml.dimensions(); + moduleParamsStrct fourM_params(getAttrOrDefault(fourMmod_dim, _Unicode(widthBackInner), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(heightBackInner), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(widthSideWall), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(widthTopWall), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(thicknessFrontWall), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(thicknessBackWall), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(width), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(height), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(notchDepth), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(notchHeight), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(foilThick), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(pcbLength), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(pcbThick), 0.), + getAttrOrDefault(fourMmod_dim, _Unicode(pcbWidth), 0.), + fourM_xml.visStr(), fourM_xml.regionStr(), fourM_xml.limitsStr()); std::vector<sliceParamsStrct> slice_Params; - int layer_num = 0; - int readLayerC = 0; + int layer_num = 0; + int readLayerC = 0; for (xml_coll_t c(detElem, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - int readlayer = getAttrOrDefault(x_layer, _Unicode(readoutlayer), 0.); - if (readLayerC != readlayer){ - readLayerC = readlayer; - layer_num = 0; + xml_comp_t x_layer = c; + int repeat = x_layer.repeat(); + int readlayer = getAttrOrDefault(x_layer, _Unicode(readoutlayer), 0.); + if (readLayerC != readlayer) { + readLayerC = readlayer; + layer_num = 0; } // Looping through the number of repeated layers in each section for (int i = 0; i < repeat; i++) { - int slice_num = 1; + int slice_num = 1; // Looping over each layer's slices for (xml_coll_t l(x_layer, _U(slice)); l; ++l) { - xml_comp_t x_slice = l; - sliceParamsStrct slice_param( layer_num, slice_num, getAttrOrDefault(l, _Unicode(type), 0.), x_slice.thickness(), getAttrOrDefault(l, _Unicode(offset), 0.), readlayer, - x_slice.materialStr(), x_slice.visStr(), x_slice.regionStr(), x_slice.limitsStr()); + xml_comp_t x_slice = l; + sliceParamsStrct slice_param(layer_num, slice_num, getAttrOrDefault(l, _Unicode(type), 0.), + x_slice.thickness(), getAttrOrDefault(l, _Unicode(offset), 0.), + readlayer, x_slice.materialStr(), x_slice.visStr(), + x_slice.regionStr(), x_slice.limitsStr()); slice_Params.push_back(slice_param); ++slice_num; } @@ -880,71 +1033,93 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens int moduleIDx = -1; int moduleIDy = -1; - struct position { - double x,y,z; + double x, y, z; }; std::vector<position> pos8M; xml_coll_t eightMPos(detElem, _Unicode(eightmodulepositions)); - for (xml_coll_t position_i(eightMPos, _U(position)); position_i; ++position_i){ + for (xml_coll_t position_i(eightMPos, _U(position)); position_i; ++position_i) { xml_comp_t position_comp = position_i; - if (! getAttrOrDefault(position_comp, _Unicode(if), true)) { - printout(DEBUG, "LFHCAL_geo", "skipping x = %.1f cm, y = %.1f cm", position_comp.x(), position_comp.y()); + if (!getAttrOrDefault(position_comp, _Unicode(if), true)) { + printout(DEBUG, "LFHCAL_geo", "skipping x = %.1f cm, y = %.1f cm", position_comp.x(), + position_comp.y()); continue; } pos8M.push_back({position_comp.x(), position_comp.y(), position_comp.z()}); } // create 8M modules - Volume eightMassembly = createEightMModule ( desc, eightM_params, slice_Params, length, sens, renderComponents, allSensitive); - for (int e = 0; e < (int)pos8M.size(); e++){ - if(e%20 == 0 ) printout(DEBUG, "LFHCAL_geo", "LFHCAL placing 8M module: " + _toString(e) + "/" + _toString((int)pos8M.size()) + "\t" + _toString(pos8M[e].x) + "\t" + _toString(pos8M[e].y) + "\t" + _toString(pos8M[e].z)); - if(moduleIDx<0 || moduleIDy<0){ - printout(DEBUG, "LFHCAL_geo", "LFHCAL WRONG ID FOR 8M module: " + _toString(e) + "/" + _toString((int)pos8M.size()) + "\t" + _toString(moduleIDx) + "\t" - + _toString(moduleIDy)); + Volume eightMassembly = createEightMModule(desc, eightM_params, slice_Params, length, sens, + renderComponents, allSensitive); + for (int e = 0; e < (int)pos8M.size(); e++) { + if (e % 20 == 0) + printout(DEBUG, "LFHCAL_geo", + "LFHCAL placing 8M module: " + _toString(e) + "/" + _toString((int)pos8M.size()) + + "\t" + _toString(pos8M[e].x) + "\t" + _toString(pos8M[e].y) + "\t" + + _toString(pos8M[e].z)); + if (moduleIDx < 0 || moduleIDy < 0) { + printout(DEBUG, "LFHCAL_geo", + "LFHCAL WRONG ID FOR 8M module: " + _toString(e) + "/" + + _toString((int)pos8M.size()) + "\t" + _toString(moduleIDx) + "\t" + + _toString(moduleIDy)); } - moduleIDx = ((pos8M[e].x + 270) / 10); - moduleIDy = ((pos8M[e].y + 265) / 10); + moduleIDx = ((pos8M[e].x + 270) / 10); + moduleIDy = ((pos8M[e].y + 265) / 10); // Placing modules in world volume - auto tr8M = Transform3D(Position(-pos8M[e].x-0.5*eightM_params.mod_width, -pos8M[e].y, pos8M[e].z)); + auto tr8M = + Transform3D(Position(-pos8M[e].x - 0.5 * eightM_params.mod_width, -pos8M[e].y, pos8M[e].z)); phv = assembly.placeVolume(eightMassembly, tr8M); - phv.addPhysVolID("moduleIDx", moduleIDx).addPhysVolID("moduleIDy", moduleIDy).addPhysVolID("moduletype", 0); + phv.addPhysVolID("moduleIDx", moduleIDx) + .addPhysVolID("moduleIDy", moduleIDy) + .addPhysVolID("moduletype", 0); } std::vector<position> pos4M; xml_coll_t fourMPos(detElem, _Unicode(fourmodulepositions)); - for (xml_coll_t position_i(fourMPos, _U(position)); position_i; ++position_i){ + for (xml_coll_t position_i(fourMPos, _U(position)); position_i; ++position_i) { xml_comp_t position_comp = position_i; - if (! getAttrOrDefault(position_comp, _Unicode(if), true)) { - printout(DEBUG, "LFHCAL_geo", "skipping x = %.1f cm, y = %.1f cm", position_comp.x(), position_comp.y()); + if (!getAttrOrDefault(position_comp, _Unicode(if), true)) { + printout(DEBUG, "LFHCAL_geo", "skipping x = %.1f cm, y = %.1f cm", position_comp.x(), + position_comp.y()); continue; } pos4M.push_back({position_comp.x(), position_comp.y(), position_comp.z()}); } // create 4M modules - Volume fourMassembly = createFourMModule ( desc, fourM_params, slice_Params, length, sens, renderComponents, allSensitive); - for (int f = 0; f < (int)pos4M.size(); f++){ - if(f%20 == 0 ) printout(DEBUG, "LFHCAL_geo", "LFHCAL placing 4M module: " + _toString(f) + "/" + _toString((int)pos4M.size()) + "\t" + _toString(pos4M[f].x) + "\t" + _toString(pos4M[f].y) + "\t" + _toString(pos4M[f].z)); - - moduleIDx = ((pos4M[f].x + 265) / 10); - moduleIDy = ((pos4M[f].y + 265) / 10); - if(moduleIDx<0 || moduleIDy<0){ - printout(DEBUG, "LFHCAL_geo", "LFHCAL WRONG ID FOR 4M module: " + _toString(f) + "/" + _toString((int)pos4M.size()) + "\t" + _toString(moduleIDx) + "\t" - + _toString(moduleIDy)); + Volume fourMassembly = createFourMModule(desc, fourM_params, slice_Params, length, sens, + renderComponents, allSensitive); + for (int f = 0; f < (int)pos4M.size(); f++) { + if (f % 20 == 0) + printout(DEBUG, "LFHCAL_geo", + "LFHCAL placing 4M module: " + _toString(f) + "/" + _toString((int)pos4M.size()) + + "\t" + _toString(pos4M[f].x) + "\t" + _toString(pos4M[f].y) + "\t" + + _toString(pos4M[f].z)); + + moduleIDx = ((pos4M[f].x + 265) / 10); + moduleIDy = ((pos4M[f].y + 265) / 10); + if (moduleIDx < 0 || moduleIDy < 0) { + printout(DEBUG, "LFHCAL_geo", + "LFHCAL WRONG ID FOR 4M module: " + _toString(f) + "/" + + _toString((int)pos4M.size()) + "\t" + _toString(moduleIDx) + "\t" + + _toString(moduleIDy)); } - auto tr4M = Transform3D(Position(-pos4M[f].x-0.5*fourM_params.mod_width, -pos4M[f].y, pos4M[f].z)); + auto tr4M = + Transform3D(Position(-pos4M[f].x - 0.5 * fourM_params.mod_width, -pos4M[f].y, pos4M[f].z)); phv = assembly.placeVolume(fourMassembly, tr4M); - phv.addPhysVolID("moduleIDx", moduleIDx).addPhysVolID("moduleIDy", moduleIDy).addPhysVolID("moduletype", 1); + phv.addPhysVolID("moduleIDx", moduleIDx) + .addPhysVolID("moduleIDy", moduleIDy) + .addPhysVolID("moduletype", 1); } Volume motherVol = desc.pickMotherVolume(det); - phv = env_vol.placeVolume(assembly); - phv = motherVol.placeVolume(env_vol, Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.))); + phv = env_vol.placeVolume(assembly); + phv = motherVol.placeVolume(env_vol, + Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.))); phv.addPhysVolID("system", detID); det.setPlacement(phv); diff --git a/src/LumiCollimator_geo.cpp b/src/LumiCollimator_geo.cpp index 2f48b98d1..4d3da4d02 100644 --- a/src/LumiCollimator_geo.cpp +++ b/src/LumiCollimator_geo.cpp @@ -13,44 +13,43 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /* sens */) { using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Steel = description.material("StainlessSteel"); - string vis_name = x_det.visStr(); + Assembly assembly(det_name + "_assembly"); + Material m_Steel = description.material("StainlessSteel"); + string vis_name = x_det.visStr(); // Create outer box xml::Component box_dim = x_det.child(_Unicode(dimensions_outer)); - double height = box_dim.attr<double>(_Unicode(y)); - double width = box_dim.attr<double>(_Unicode(x)); - double depth = box_dim.attr<double>(_Unicode(z)); + double height = box_dim.attr<double>(_Unicode(y)); + double width = box_dim.attr<double>(_Unicode(x)); + double depth = box_dim.attr<double>(_Unicode(z)); Box box_outer(width, height, depth); // Create inner box xml::Component box_dim_2 = x_det.child(_Unicode(dimensions_inner)); - double height_2 = box_dim_2.attr<double>(_Unicode(y)); - double width_2 = box_dim_2.attr<double>(_Unicode(x)); - double depth_2 = box_dim_2.attr<double>(_Unicode(z)); + double height_2 = box_dim_2.attr<double>(_Unicode(y)); + double width_2 = box_dim_2.attr<double>(_Unicode(x)); + double depth_2 = box_dim_2.attr<double>(_Unicode(z)); Box box_inner(width_2, height_2, depth_2); // Sets box positions xml::Component box_pos = x_det.child(_Unicode(position)); - double x = box_pos.attr<double>(_Unicode(x)); - double y = box_pos.attr<double>(_Unicode(y)); - double z = box_pos.attr<double>(_Unicode(z)); + double x = box_pos.attr<double>(_Unicode(x)); + double y = box_pos.attr<double>(_Unicode(y)); + double z = box_pos.attr<double>(_Unicode(z)); // Subtractes the volume of the inner box from the outer box - BooleanSolid collimator = SubtractionSolid(box_outer, box_inner); + BooleanSolid collimator = SubtractionSolid(box_outer, box_inner); // Assembles the collimator and sets its material - Volume v_collimator( det_name + "_vol_collimator", collimator , m_Steel); + Volume v_collimator(det_name + "_vol_collimator", collimator, m_Steel); sdet.setAttributes(description, v_collimator, x_det.regionStr(), x_det.limitsStr(), vis_name); diff --git a/src/LumiDirectPC_geo.cpp b/src/LumiDirectPC_geo.cpp index ebf738561..6438fcd40 100644 --- a/src/LumiDirectPC_geo.cpp +++ b/src/LumiDirectPC_geo.cpp @@ -12,39 +12,38 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { sens.setType("calorimeter"); - xml_det_t x_det = e; - xml_comp_t x_dim = x_det.dimensions(); - xml_comp_t x_pos = x_det.position(); - xml_comp_t x_rot = x_det.rotation(); + xml_det_t x_det = e; + xml_comp_t x_dim = x_det.dimensions(); + xml_comp_t x_pos = x_det.position(); + xml_comp_t x_rot = x_det.rotation(); // - string det_name = x_det.nameStr(); - string mat_name = dd4hep::getAttrOrDefault<string>( x_det, _U(material), "PbWO4" ); - int det_ID =x_det.id(); + string det_name = x_det.nameStr(); + string mat_name = dd4hep::getAttrOrDefault<string>(x_det, _U(material), "PbWO4"); + int det_ID = x_det.id(); DetElement det(det_name, det_ID); // - double sizeX = x_dim.x(); - double sizeY = x_dim.y(); - double sizeZ = x_dim.z(); - double posX = x_pos.x(); - double posY = x_pos.y(); - double posZ = x_pos.z(); - double rotX = x_rot.x(); - double rotY = x_rot.y(); - double rotZ = x_rot.z(); - - Box box( sizeX, sizeY, sizeZ ); - Volume vol( det_name + "_vol", box, desc.material( mat_name ) ); + double sizeX = x_dim.x(); + double sizeY = x_dim.y(); + double sizeZ = x_dim.z(); + double posX = x_pos.x(); + double posY = x_pos.y(); + double posZ = x_pos.z(); + double rotX = x_rot.x(); + double rotY = x_rot.y(); + double rotZ = x_rot.z(); + + Box box(sizeX, sizeY, sizeZ); + Volume vol(det_name + "_vol", box, desc.material(mat_name)); vol.setVisAttributes(desc.visAttributes(x_det.visStr())); vol.setSensitiveDetector(sens); - Transform3D pos( RotationZYX(rotX, rotY, rotZ), Position(posX, posY, posZ) ); + Transform3D pos(RotationZYX(rotX, rotY, rotZ), Position(posX, posY, posZ)); - Volume motherVol = desc.pickMotherVolume( det ); - PlacedVolume phv = motherVol.placeVolume( vol, pos ); + Volume motherVol = desc.pickMotherVolume(det); + PlacedVolume phv = motherVol.placeVolume(vol, pos); phv.addPhysVolID("system", det_ID); det.setPlacement(phv); return det; diff --git a/src/LumiMagnets_geo.cpp b/src/LumiMagnets_geo.cpp index 2b9d80f95..9ca0a33d2 100644 --- a/src/LumiMagnets_geo.cpp +++ b/src/LumiMagnets_geo.cpp @@ -9,125 +9,121 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) { using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Iron = det.material("Iron"); - Material m_Copper = det.material("Copper"); + Assembly assembly(det_name + "_assembly"); + Material m_Iron = det.material("Iron"); + Material m_Copper = det.material("Copper"); const string vis1 = getAttrOrDefault<string>(x_det, _Unicode(vis_name1), "AnlGreen"); const string vis2 = getAttrOrDefault<string>(x_det, _Unicode(vis_name2), "AnlRed"); const string vis3 = getAttrOrDefault<string>(x_det, _Unicode(vis_name3), "AnlGray"); // Creates the outer box for the main body xml::Component box_dim = x_det.child(_Unicode(dimensions_mainbody_outer)); - double height = box_dim.attr<double>(_Unicode(y)); - double width = box_dim.attr<double>(_Unicode(x)); - double depth = box_dim.attr<double>(_Unicode(z)); + double height = box_dim.attr<double>(_Unicode(y)); + double width = box_dim.attr<double>(_Unicode(x)); + double depth = box_dim.attr<double>(_Unicode(z)); - Box box_outer(width/2., height/2., depth/2.); + Box box_outer(width / 2., height / 2., depth / 2.); // Creates the innner box for the main body xml::Component box_dim_2 = x_det.child(_Unicode(dimensions_mainbody_inner)); - double height_2 = box_dim_2.attr<double>(_Unicode(y)); - double width_2 = box_dim_2.attr<double>(_Unicode(x)); - double depth_2 = box_dim_2.attr<double>(_Unicode(z)); + double height_2 = box_dim_2.attr<double>(_Unicode(y)); + double width_2 = box_dim_2.attr<double>(_Unicode(x)); + double depth_2 = box_dim_2.attr<double>(_Unicode(z)); - Box box_inner(width_2/2., height_2/2., depth_2/2.); + Box box_inner(width_2 / 2., height_2 / 2., depth_2 / 2.); // Creates the outer box for the shape of the coils xml::Component box_dim_3 = x_det.child(_Unicode(dimensions_coils_outer)); - double height_3 = box_dim_3.attr<double>(_Unicode(y)); - double width_3 = box_dim_3.attr<double>(_Unicode(x)); - double depth_3 = box_dim_3.attr<double>(_Unicode(z)); + double height_3 = box_dim_3.attr<double>(_Unicode(y)); + double width_3 = box_dim_3.attr<double>(_Unicode(x)); + double depth_3 = box_dim_3.attr<double>(_Unicode(z)); - Box coils_outer(width_3/2., height_3/2., depth_3/2.); + Box coils_outer(width_3 / 2., height_3 / 2., depth_3 / 2.); // Creates the first inner box for the shape of the coils xml::Component box_dim_4 = x_det.child(_Unicode(dimensions_coils_inner_1)); - double height_4 = box_dim_4.attr<double>(_Unicode(y)); - double width_4 = box_dim_4.attr<double>(_Unicode(x)); - double depth_4 = box_dim_4.attr<double>(_Unicode(z)); + double height_4 = box_dim_4.attr<double>(_Unicode(y)); + double width_4 = box_dim_4.attr<double>(_Unicode(x)); + double depth_4 = box_dim_4.attr<double>(_Unicode(z)); - Box coils_inner_1(width_4/2., height_4/2., depth_4/2.); + Box coils_inner_1(width_4 / 2., height_4 / 2., depth_4 / 2.); // Creates the second inner box for the shape of the coils xml::Component box_dim_5 = x_det.child(_Unicode(dimensions_coils_inner_2)); - double height_5 = box_dim_5.attr<double>(_Unicode(y)); - double width_5 = box_dim_5.attr<double>(_Unicode(x)); - double depth_5 = box_dim_5.attr<double>(_Unicode(z)); + double height_5 = box_dim_5.attr<double>(_Unicode(y)); + double width_5 = box_dim_5.attr<double>(_Unicode(x)); + double depth_5 = box_dim_5.attr<double>(_Unicode(z)); - Box coils_inner_2(width_5/2., height_5/2., depth_5/2.); + Box coils_inner_2(width_5 / 2., height_5 / 2., depth_5 / 2.); // Creates the outer box for the shape of the yoke xml::Component box_dim_6 = x_det.child(_Unicode(dimensions_yoke_outer)); - double height_6 = box_dim_6.attr<double>(_Unicode(y)); - double width_6 = box_dim_6.attr<double>(_Unicode(x)); - double depth_6 = box_dim_6.attr<double>(_Unicode(z)); + double height_6 = box_dim_6.attr<double>(_Unicode(y)); + double width_6 = box_dim_6.attr<double>(_Unicode(x)); + double depth_6 = box_dim_6.attr<double>(_Unicode(z)); - Box yoke_outer(width_6/2., height_6/2., depth_6/2.); + Box yoke_outer(width_6 / 2., height_6 / 2., depth_6 / 2.); // Creates the first inner box for the shape of the coils xml::Component box_dim_7 = x_det.child(_Unicode(dimensions_yoke_inner)); - double height_7 = box_dim_7.attr<double>(_Unicode(y)); - double width_7 = box_dim_7.attr<double>(_Unicode(x)); - double depth_7 = box_dim_7.attr<double>(_Unicode(z)); + double height_7 = box_dim_7.attr<double>(_Unicode(y)); + double width_7 = box_dim_7.attr<double>(_Unicode(x)); + double depth_7 = box_dim_7.attr<double>(_Unicode(z)); - Box yoke_inner(width_7/2., height_7/2., depth_7/2.); + Box yoke_inner(width_7 / 2., height_7 / 2., depth_7 / 2.); // Creates the outer box for the shape of the legs xml::Component box_dim_8 = x_det.child(_Unicode(dimensions_leg_outer)); - double height_8 = box_dim_8.attr<double>(_Unicode(y)); - double width_8 = box_dim_8.attr<double>(_Unicode(x)); - double depth_8 = box_dim_8.attr<double>(_Unicode(z)); + double height_8 = box_dim_8.attr<double>(_Unicode(y)); + double width_8 = box_dim_8.attr<double>(_Unicode(x)); + double depth_8 = box_dim_8.attr<double>(_Unicode(z)); - Box leg_outer(width_8/2., height_8/2., depth_8/2.); + Box leg_outer(width_8 / 2., height_8 / 2., depth_8 / 2.); // Creates the inner box for the shape of the legs xml::Component box_dim_9 = x_det.child(_Unicode(dimensions_leg_inner)); - double height_9 = box_dim_9.attr<double>(_Unicode(y)); - double width_9 = box_dim_9.attr<double>(_Unicode(x)); - double depth_9 = box_dim_9.attr<double>(_Unicode(z)); + double height_9 = box_dim_9.attr<double>(_Unicode(y)); + double width_9 = box_dim_9.attr<double>(_Unicode(x)); + double depth_9 = box_dim_9.attr<double>(_Unicode(z)); - Box leg_inner(width_9/2., height_9/2., depth_9/2.); + Box leg_inner(width_9 / 2., height_9 / 2., depth_9 / 2.); // Sets box position xml::Component box_pos = x_det.child(_Unicode(position)); - double x = box_pos.attr<double>(_Unicode(x)); - double y = box_pos.attr<double>(_Unicode(y)); - double z = box_pos.attr<double>(_Unicode(z)); - - + double x = box_pos.attr<double>(_Unicode(x)); + double y = box_pos.attr<double>(_Unicode(y)); + double z = box_pos.attr<double>(_Unicode(z)); // Subtractes the volume of the inner box from the outer box for the main body - BooleanSolid main_body = SubtractionSolid(box_outer, box_inner); - Volume v_main_body( det_name + "_vol_main_body", main_body, m_Iron); + BooleanSolid main_body = SubtractionSolid(box_outer, box_inner); + Volume v_main_body(det_name + "_vol_main_body", main_body, m_Iron); sdet.setAttributes(det, v_main_body, x_det.regionStr(), x_det.limitsStr(), vis1); assembly.placeVolume(v_main_body, Position(x, y, z)); // Creates panels by subtracting the inner boxes of the coils from the outer box of the coilss - BooleanSolid coils_1 = SubtractionSolid(coils_outer, coils_inner_1); - BooleanSolid coils = SubtractionSolid(coils_1, coils_inner_2); - Volume v_coils( det_name + "_vol_coils", coils, m_Copper); + BooleanSolid coils_1 = SubtractionSolid(coils_outer, coils_inner_1); + BooleanSolid coils = SubtractionSolid(coils_1, coils_inner_2); + Volume v_coils(det_name + "_vol_coils", coils, m_Copper); sdet.setAttributes(det, v_coils, x_det.regionStr(), x_det.limitsStr(), vis2); assembly.placeVolume(v_coils, Position(x, y, z)); // Creates coils by subtracting the inner box of the yoke from the outer box of the yoke - BooleanSolid yoke = SubtractionSolid(yoke_outer, yoke_inner); - Volume v_yoke( det_name + "_vol_yoke", yoke, m_Iron); + BooleanSolid yoke = SubtractionSolid(yoke_outer, yoke_inner); + Volume v_yoke(det_name + "_vol_yoke", yoke, m_Iron); sdet.setAttributes(det, v_yoke, x_det.regionStr(), x_det.limitsStr(), vis1); assembly.placeVolume(v_yoke, Position(x, y, z)); // Creates the legs by subtracting the inner box of the legs from the outer box of the legs - BooleanSolid legs = SubtractionSolid(leg_outer, leg_inner); - Volume v_legs( det_name + "_vol_legs", legs, m_Iron); + BooleanSolid legs = SubtractionSolid(leg_outer, leg_inner); + Volume v_legs(det_name + "_vol_legs", legs, m_Iron); sdet.setAttributes(det, v_legs, x_det.regionStr(), x_det.limitsStr(), vis3); - assembly.placeVolume(v_legs, Position(x, y - height_9/2. - height/2., z)); - + assembly.placeVolume(v_legs, Position(x, y - height_9 / 2. - height / 2., z)); // Final placement auto pv_assembly = det.pickMotherVolume(sdet).placeVolume( diff --git a/src/LumiPhotonChamber_geo.cpp b/src/LumiPhotonChamber_geo.cpp index f4ffc50e1..5a698f52e 100644 --- a/src/LumiPhotonChamber_geo.cpp +++ b/src/LumiPhotonChamber_geo.cpp @@ -12,89 +12,89 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /*sens*/) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /*sens*/) { - xml_det_t x_det = e; - xml_comp_t x_dim = x_det.child( _Unicode(dimensions) ); - xml_comp_t x_pos = x_det.child( _Unicode(position) ); + xml_det_t x_det = e; + xml_comp_t x_dim = x_det.child(_Unicode(dimensions)); + xml_comp_t x_pos = x_det.child(_Unicode(position)); // - string det_name = x_det.nameStr(); - string mat_pipe = getAttrOrDefault<string>( x_det, _Unicode(pipeMaterial), "Aluminum" ); - string mat_entrCap = getAttrOrDefault<string>( x_det, _Unicode(entrCapMaterial), "Aluminum" ); - string mat_exitCap = getAttrOrDefault<string>( x_det, _Unicode(exitCapMaterial), "Beryllium" ); - string mat_conv = getAttrOrDefault<string>( x_det, _Unicode(convMaterial), "Aluminum" ); - string mat_fill = getAttrOrDefault<string>( x_det, _Unicode(fillMaterial), "Vacuum" ); + string det_name = x_det.nameStr(); + string mat_pipe = getAttrOrDefault<string>(x_det, _Unicode(pipeMaterial), "Aluminum"); + string mat_entrCap = getAttrOrDefault<string>(x_det, _Unicode(entrCapMaterial), "Aluminum"); + string mat_exitCap = getAttrOrDefault<string>(x_det, _Unicode(exitCapMaterial), "Beryllium"); + string mat_conv = getAttrOrDefault<string>(x_det, _Unicode(convMaterial), "Aluminum"); + string mat_fill = getAttrOrDefault<string>(x_det, _Unicode(fillMaterial), "Vacuum"); // - double posZ1 = x_pos.attr<double>(_Unicode(z1)); - double posZ2 = x_pos.attr<double>(_Unicode(z2)); - double posZconv = x_pos.attr<double>(_Unicode(z_conv)); - double rmin = x_dim.attr<double>(_Unicode(rmin)); - double pipe_DR = x_dim.attr<double>(_Unicode(pipe_dr)); - double entrCap_DZ = x_dim.attr<double>(_Unicode(entrCap_dz)); - double exitCap_DZ = x_dim.attr<double>(_Unicode(exitCap_dz)); - double conv_DZ = x_dim.attr<double>(_Unicode(conv_dz)); + double posZ1 = x_pos.attr<double>(_Unicode(z1)); + double posZ2 = x_pos.attr<double>(_Unicode(z2)); + double posZconv = x_pos.attr<double>(_Unicode(z_conv)); + double rmin = x_dim.attr<double>(_Unicode(rmin)); + double pipe_DR = x_dim.attr<double>(_Unicode(pipe_dr)); + double entrCap_DZ = x_dim.attr<double>(_Unicode(entrCap_dz)); + double exitCap_DZ = x_dim.attr<double>(_Unicode(exitCap_dz)); + double conv_DZ = x_dim.attr<double>(_Unicode(conv_dz)); // Create main detector element to be returned at the end - DetElement det(det_name, x_det.id()); + DetElement det(det_name, x_det.id()); // Mother volume - Volume motherVol = description.pickMotherVolume( det ); + Volume motherVol = description.pickMotherVolume(det); // chamber assembly - Assembly assembly( det_name ); - assembly.setVisAttributes( description.invisible() ); + Assembly assembly(det_name); + assembly.setVisAttributes(description.invisible()); //////////// // G4 solids // main tube - Tube tube( rmin, rmin + pipe_DR, fabs(posZ1 - posZ2)/2.0, 0, 2*TMath::Pi() ); + Tube tube(rmin, rmin + pipe_DR, fabs(posZ1 - posZ2) / 2.0, 0, 2 * TMath::Pi()); // vacuum regions inside tube - Tube vac1( 0, rmin, fabs(posZ1 - posZconv - conv_DZ/2.0)/2.0, 0, 2*TMath::Pi() ); - Tube vac2( 0, rmin, fabs(posZconv - posZ2 - conv_DZ/2.0)/2.0, 0, 2*TMath::Pi() ); + Tube vac1(0, rmin, fabs(posZ1 - posZconv - conv_DZ / 2.0) / 2.0, 0, 2 * TMath::Pi()); + Tube vac2(0, rmin, fabs(posZconv - posZ2 - conv_DZ / 2.0) / 2.0, 0, 2 * TMath::Pi()); // end cap closest to IP - Tube entrCap( 0, rmin + pipe_DR, entrCap_DZ/2.0, 0, 2*TMath::Pi() ); + Tube entrCap(0, rmin + pipe_DR, entrCap_DZ / 2.0, 0, 2 * TMath::Pi()); // end cap farthest from IP - Tube exitCap( 0, rmin + pipe_DR, exitCap_DZ/2.0, 0, 2*TMath::Pi() ); + Tube exitCap(0, rmin + pipe_DR, exitCap_DZ / 2.0, 0, 2 * TMath::Pi()); // conversion foil - Tube convFoil( 0, rmin, conv_DZ/2.0, 0, 2*TMath::Pi() ); + Tube convFoil(0, rmin, conv_DZ / 2.0, 0, 2 * TMath::Pi()); ////////// // volumes - Volume vol_vac1( det_name + "_vol_vac1", vac1, description.material( mat_fill ) ); - vol_vac1.setVisAttributes( description.invisible() ); - Volume vol_vac2( det_name + "_vol_vac2", vac2, description.material( mat_fill ) ); - vol_vac2.setVisAttributes( description.invisible() ); + Volume vol_vac1(det_name + "_vol_vac1", vac1, description.material(mat_fill)); + vol_vac1.setVisAttributes(description.invisible()); + Volume vol_vac2(det_name + "_vol_vac2", vac2, description.material(mat_fill)); + vol_vac2.setVisAttributes(description.invisible()); - Volume vol_tube( det_name + "_vol_tube", tube, description.material( mat_pipe ) ); - vol_tube.setVisAttributes( description.visAttributes(x_det.visStr()) ); + Volume vol_tube(det_name + "_vol_tube", tube, description.material(mat_pipe)); + vol_tube.setVisAttributes(description.visAttributes(x_det.visStr())); - Volume vol_entrCap( det_name + "_vol_entrCap", entrCap, description.material( mat_entrCap ) ); - vol_entrCap.setVisAttributes( description.visAttributes(x_det.visStr()) ); + Volume vol_entrCap(det_name + "_vol_entrCap", entrCap, description.material(mat_entrCap)); + vol_entrCap.setVisAttributes(description.visAttributes(x_det.visStr())); - Volume vol_exitCap( det_name + "_vol_exitCap", exitCap, description.material( mat_exitCap ) ); - vol_exitCap.setVisAttributes( description.visAttributes(x_det.visStr()) ); + Volume vol_exitCap(det_name + "_vol_exitCap", exitCap, description.material(mat_exitCap)); + vol_exitCap.setVisAttributes(description.visAttributes(x_det.visStr())); - Volume vol_conv( det_name + "_vol_conversionFoil", convFoil, description.material( mat_conv ) ); - vol_conv.setVisAttributes( description.visAttributes(x_det.visStr()) ); + Volume vol_conv(det_name + "_vol_conversionFoil", convFoil, description.material(mat_conv)); + vol_conv.setVisAttributes(description.visAttributes(x_det.visStr())); // place each volume into assembly + assembly.placeVolume(vol_tube, + Transform3D(RotationZYX(0, 0, 0), Position(0, 0, (posZ1 + posZ2) / 2.))); + assembly.placeVolume(vol_entrCap, + Transform3D(RotationZYX(0, 0, 0), Position(0, 0, posZ1 + entrCap_DZ / 2.))); + assembly.placeVolume(vol_exitCap, + Transform3D(RotationZYX(0, 0, 0), Position(0, 0, posZ2 - exitCap_DZ / 2.))); + assembly.placeVolume(vol_conv, Transform3D(RotationZYX(0, 0, 0), Position(0, 0, posZconv))); assembly.placeVolume( - vol_tube, Transform3D( RotationZYX(0, 0, 0), Position(0, 0, (posZ1 + posZ2)/2.)) ); + vol_vac1, + Transform3D(RotationZYX(0, 0, 0), Position(0, 0, (posZ1 + (posZconv + conv_DZ / 2.0)) / 2.))); assembly.placeVolume( - vol_entrCap, Transform3D( RotationZYX(0, 0, 0), Position(0, 0, posZ1 + entrCap_DZ/2.)) ); - assembly.placeVolume( - vol_exitCap, Transform3D( RotationZYX(0, 0, 0), Position(0, 0, posZ2 - exitCap_DZ/2.)) ); - assembly.placeVolume( - vol_conv, Transform3D( RotationZYX(0, 0, 0), Position(0, 0, posZconv)) ); - assembly.placeVolume( - vol_vac1, Transform3D( RotationZYX(0, 0, 0), Position(0, 0, (posZ1 + (posZconv+conv_DZ/2.0))/2.)) ); - assembly.placeVolume( - vol_vac2, Transform3D( RotationZYX(0, 0, 0), Position(0, 0, (posZ2 + (posZconv-conv_DZ/2.0))/2.)) ); + vol_vac2, + Transform3D(RotationZYX(0, 0, 0), Position(0, 0, (posZ2 + (posZconv - conv_DZ / 2.0)) / 2.))); // Place assembly into mother volume. Assembly is centered at origin - PlacedVolume phv = motherVol.placeVolume( assembly, Position(0.0, 0.0, 0.0) ); + PlacedVolume phv = motherVol.placeVolume(assembly, Position(0.0, 0.0, 0.0)); det.setPlacement(phv); diff --git a/src/LumiSpecHomoCAL_geo.cpp b/src/LumiSpecHomoCAL_geo.cpp index cfb9fdc6f..f33abdc4a 100644 --- a/src/LumiSpecHomoCAL_geo.cpp +++ b/src/LumiSpecHomoCAL_geo.cpp @@ -14,66 +14,67 @@ using namespace std; using namespace dd4hep; // Definition of function to build the modules -static tuple<Volume, Position> build_specHomoCAL_module(const Detector& description, const xml::Component& mod_x, SensitiveDetector& sens); +static tuple<Volume, Position> build_specHomoCAL_module(const Detector& description, + const xml::Component& mod_x, + SensitiveDetector& sens); // Driver Function -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { sens.setType("calorimeter"); - xml_det_t x_det = e; - xml_comp_t x_mod = x_det.child( _Unicode(module) ); - string det_name = x_det.nameStr(); - int det_ID = x_det.id(); + xml_det_t x_det = e; + xml_comp_t x_mod = x_det.child(_Unicode(module)); + string det_name = x_det.nameStr(); + int det_ID = x_det.id(); // Create main detector element to be returned at the end - DetElement det( det_name, det_ID ); + DetElement det(det_name, det_ID); // Mother volume - Volume motherVol = description.pickMotherVolume( det ); + Volume motherVol = description.pickMotherVolume(det); // Detector assembly - Assembly assembly( det_name ); - assembly.setVisAttributes( description.invisible() ); + Assembly assembly(det_name); + assembly.setVisAttributes(description.invisible()); // Create Modules auto [modVol, modSize] = build_specHomoCAL_module(description, x_mod, sens); - double detSizeXY = getAttrOrDefault( x_det, _Unicode(sizeXY), 20 ); - int nxy = int( detSizeXY / modSize.x() ); - double xypos0 = -nxy*modSize.x()/2.0 + modSize.x()/2.0; + double detSizeXY = getAttrOrDefault(x_det, _Unicode(sizeXY), 20); + int nxy = int(detSizeXY / modSize.x()); + double xypos0 = -nxy * modSize.x() / 2.0 + modSize.x() / 2.0; // Build detector components // loop over sectors - for( xml_coll_t si(x_det, _Unicode(sector)); si; si++) { // sectors (top,bottom) + for (xml_coll_t si(x_det, _Unicode(sector)); si; si++) { // sectors (top,bottom) - xml_comp_t x_sector( si ); + xml_comp_t x_sector(si); int sector_id = x_sector.id(); - int mod_id = 0; + int mod_id = 0; xml_comp_t x_pos = x_sector.position(); xml_comp_t x_rot = x_sector.rotation(); - for(int ix=0; ix< nxy; ix++){ - for(int iy=0; iy< nxy; iy++){ + for (int ix = 0; ix < nxy; ix++) { + for (int iy = 0; iy < nxy; iy++) { - double mod_pos_x = x_pos.x() + xypos0 + ix*modSize.x(); - double mod_pos_y = x_pos.y() + xypos0 + iy*modSize.y(); - double mod_pos_z = x_pos.z() + 0.0*cm; + double mod_pos_x = x_pos.x() + xypos0 + ix * modSize.x(); + double mod_pos_y = x_pos.y() + xypos0 + iy * modSize.y(); + double mod_pos_z = x_pos.z() + 0.0 * cm; - PlacedVolume modPV = assembly.placeVolume( - modVol, Transform3D( RotationZYX( x_rot.x(), x_rot.y(), x_rot.z()), Position( mod_pos_x, mod_pos_y, mod_pos_z ) ) ); + PlacedVolume modPV = + assembly.placeVolume(modVol, Transform3D(RotationZYX(x_rot.x(), x_rot.y(), x_rot.z()), + Position(mod_pos_x, mod_pos_y, mod_pos_z))); - modPV.addPhysVolID( "sector", sector_id ).addPhysVolID( "module", mod_id ); + modPV.addPhysVolID("sector", sector_id).addPhysVolID("module", mod_id); mod_id++; } } - } // sectors // Place assembly into mother volume. Assembly is centered at origin - PlacedVolume detPV = motherVol.placeVolume( assembly, Position(0.0, 0.0, 0.0) ); + PlacedVolume detPV = motherVol.placeVolume(assembly, Position(0.0, 0.0, 0.0)); detPV.addPhysVolID("system", det_ID); // Connect to system ID @@ -84,15 +85,17 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s //-------------------------------------------------------------------- //Function for building the module -static tuple<Volume, Position> build_specHomoCAL_module( const Detector& description, const xml::Component& mod_x, SensitiveDetector& sens){ +static tuple<Volume, Position> build_specHomoCAL_module(const Detector& description, + const xml::Component& mod_x, + SensitiveDetector& sens) { - double sx = mod_x.attr<double>(_Unicode(sizex)); - double sy = mod_x.attr<double>(_Unicode(sizey)); - double sz = mod_x.attr<double>(_Unicode(sizez)); + double sx = mod_x.attr<double>(_Unicode(sizex)); + double sy = mod_x.attr<double>(_Unicode(sizey)); + double sz = mod_x.attr<double>(_Unicode(sizez)); double frame_size = mod_x.attr<double>(_Unicode(frameSize)); - Box modShape( (sx/2.0 -frame_size) , (sy/2.0 -frame_size) , sz/2.0 ); - auto modMat = description.material(mod_x.attr<std::string>(_Unicode(material))); + Box modShape((sx / 2.0 - frame_size), (sy / 2.0 - frame_size), sz / 2.0); + auto modMat = description.material(mod_x.attr<std::string>(_Unicode(material))); Volume modVol("module_vol", modShape, modMat); if (mod_x.hasAttr(_Unicode(vis))) { @@ -100,7 +103,7 @@ static tuple<Volume, Position> build_specHomoCAL_module( const Detector& descrip } modVol.setSensitiveDetector(sens); - return make_tuple(modVol, Position{sx, sy, sz} ); + return make_tuple(modVol, Position{sx, sy, sz}); } DECLARE_DETELEMENT(LumiSpecHomoCAL, create_detector) //(det_type, driver func) diff --git a/src/LumiSpecTracker_geo.cpp b/src/LumiSpecTracker_geo.cpp index 302469f0d..a8a7277d0 100644 --- a/src/LumiSpecTracker_geo.cpp +++ b/src/LumiSpecTracker_geo.cpp @@ -8,69 +8,68 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { sens.setType("tracker"); - xml_det_t x_det = e; - string det_name = x_det.nameStr(); - int det_ID = x_det.id(); - string vis_Si = getAttrOrDefault<string>(x_det, _Unicode(vis), "TrackerVis"); - string vis_Cu = getAttrOrDefault<string>(x_det, _Unicode(visCu), "TrackerServiceVis"); - string Si_name = getAttrOrDefault<string>(x_det, _Unicode(materialSi), "SiliconOxide"); - string Cu_name = getAttrOrDefault<string>(x_det, _Unicode(materialCu), "Copper"); - double Si_DZ = getAttrOrDefault<double>(x_det, _Unicode(thicknessSi), 0.03/2.0); - double Cu_DZ = getAttrOrDefault<double>(x_det, _Unicode(thicknessCu), 0.014/2.0); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); + int det_ID = x_det.id(); + string vis_Si = getAttrOrDefault<string>(x_det, _Unicode(vis), "TrackerVis"); + string vis_Cu = getAttrOrDefault<string>(x_det, _Unicode(visCu), "TrackerServiceVis"); + string Si_name = getAttrOrDefault<string>(x_det, _Unicode(materialSi), "SiliconOxide"); + string Cu_name = getAttrOrDefault<string>(x_det, _Unicode(materialCu), "Copper"); + double Si_DZ = getAttrOrDefault<double>(x_det, _Unicode(thicknessSi), 0.03 / 2.0); + double Cu_DZ = getAttrOrDefault<double>(x_det, _Unicode(thicknessCu), 0.014 / 2.0); - Material m_Si = description.material( Si_name ); - Material m_Cu = description.material( Cu_name ); + Material m_Si = description.material(Si_name); + Material m_Cu = description.material(Cu_name); // Create main detector element to be returned at the end - DetElement det( det_name, det_ID ); + DetElement det(det_name, det_ID); // Mother volume - Volume motherVol = description.pickMotherVolume( det ); + Volume motherVol = description.pickMotherVolume(det); // Detector assembly - Assembly assembly( det_name ); - assembly.setVisAttributes( description.invisible() ); + Assembly assembly(det_name); + assembly.setVisAttributes(description.invisible()); // Build detector components // loop over modules - for( xml_coll_t mi(x_det, _Unicode(module)); mi; mi++) { // modules + for (xml_coll_t mi(x_det, _Unicode(module)); mi; mi++) { // modules - xml_comp_t x_mod( mi ); + xml_comp_t x_mod(mi); int module_id = x_mod.id(); // loop over sectors within each module - for( xml_coll_t si( mi, _Unicode(sector)); si; si++) { // sectors + for (xml_coll_t si(mi, _Unicode(sector)); si; si++) { // sectors - xml_comp_t x_sector( si ); + xml_comp_t x_sector(si); int sector_id = x_sector.id(); - string name = getAttrOrDefault<string>(x_sector, _Unicode(name), ""); + string name = getAttrOrDefault<string>(x_sector, _Unicode(name), ""); - double posX = x_sector.position().x(); - double posY = x_sector.position().y(); - double posZ = x_sector.position().z(); + double posX = x_sector.position().x(); + double posY = x_sector.position().y(); + double posZ = x_sector.position().z(); double sizeX = x_sector.dimensions().x(); double sizeY = x_sector.dimensions().y(); // Silicon sensor - Box box_Si( sizeX, sizeY, Si_DZ ); - Volume vol_Si( det_name + "_" + name, box_Si, m_Si ); - vol_Si.setVisAttributes( description.visAttributes( vis_Si ) ); - vol_Si.setSensitiveDetector( sens ); + Box box_Si(sizeX, sizeY, Si_DZ); + Volume vol_Si(det_name + "_" + name, box_Si, m_Si); + vol_Si.setVisAttributes(description.visAttributes(vis_Si)); + vol_Si.setSensitiveDetector(sens); // Cu layer to approximate ASICs/cooling - Box box_Cu( sizeX, sizeY, Cu_DZ ); - Volume vol_Cu( det_name + "_" + name + "_Cu", box_Cu, m_Cu ); - vol_Cu.setVisAttributes( description.visAttributes( vis_Cu ) ); + Box box_Cu(sizeX, sizeY, Cu_DZ); + Volume vol_Cu(det_name + "_" + name + "_Cu", box_Cu, m_Cu); + vol_Cu.setVisAttributes(description.visAttributes(vis_Cu)); // place into assembly PlacedVolume pv = assembly.placeVolume( - vol_Si, Transform3D( RotationZYX(0.0,0.0,0.0), Position( posX, posY, posZ ) ) ); - assembly.placeVolume( - vol_Cu, Transform3D( RotationZYX(0.0,0.0,0.0), Position( posX, posY, posZ - (Si_DZ+Cu_DZ) ) ) ); + vol_Si, Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(posX, posY, posZ))); + assembly.placeVolume(vol_Cu, Transform3D(RotationZYX(0.0, 0.0, 0.0), + Position(posX, posY, posZ - (Si_DZ + Cu_DZ)))); // Connect sector and module IDs pv.addPhysVolID("sector", sector_id).addPhysVolID("module", module_id); @@ -79,12 +78,12 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s } // modules // Place assembly into mother volume. Assembly is centered at origin - PlacedVolume detPV = motherVol.placeVolume( assembly, Position(0.0, 0.0, 0.0) ); + PlacedVolume detPV = motherVol.placeVolume(assembly, Position(0.0, 0.0, 0.0)); // Connect system ID - detPV.addPhysVolID( "system", det_ID ); + detPV.addPhysVolID("system", det_ID); - det.setPlacement( detPV ); + det.setPlacement(detPV); return det; } diff --git a/src/LumiWindow_geo.cpp b/src/LumiWindow_geo.cpp index fa3f6dd1b..19f78f3b1 100644 --- a/src/LumiWindow_geo.cpp +++ b/src/LumiWindow_geo.cpp @@ -12,36 +12,35 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /*sens*/) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /*sens*/) { - xml_det_t x_det = e; - xml_comp_t x_dim = x_det.dimensions(); - xml_comp_t x_pos = x_det.position(); - xml_comp_t x_rot = x_det.rotation(); + xml_det_t x_det = e; + xml_comp_t x_dim = x_det.dimensions(); + xml_comp_t x_pos = x_det.position(); + xml_comp_t x_rot = x_det.rotation(); // - string det_name = x_det.nameStr(); - string mat_name = dd4hep::getAttrOrDefault<string>( x_det, _U(material), "Aluminum" ); + string det_name = x_det.nameStr(); + string mat_name = dd4hep::getAttrOrDefault<string>(x_det, _U(material), "Aluminum"); // - double sizeX = x_dim.x(); - double sizeY = x_dim.y(); - double sizeZ = x_dim.z(); - double posX = x_pos.x(); - double posY = x_pos.y(); - double posZ = x_pos.z(); - double rotX = x_rot.x(); - double rotY = x_rot.y(); - double rotZ = x_rot.z(); - - Box box( sizeX, sizeY, sizeZ ); - Volume vol( det_name + "_vol_ExitWindow", box, description.material( mat_name ) ); - vol.setVisAttributes( description.visAttributes(x_det.visStr()) ); - - Transform3D pos( RotationZYX(rotX, rotY, rotZ), Position(posX, posY, posZ) ); + double sizeX = x_dim.x(); + double sizeY = x_dim.y(); + double sizeZ = x_dim.z(); + double posX = x_pos.x(); + double posY = x_pos.y(); + double posZ = x_pos.z(); + double rotX = x_rot.x(); + double rotY = x_rot.y(); + double rotZ = x_rot.z(); + + Box box(sizeX, sizeY, sizeZ); + Volume vol(det_name + "_vol_ExitWindow", box, description.material(mat_name)); + vol.setVisAttributes(description.visAttributes(x_det.visStr())); + + Transform3D pos(RotationZYX(rotX, rotY, rotZ), Position(posX, posY, posZ)); DetElement det(det_name, x_det.id()); - Volume motherVol = description.pickMotherVolume( det ); - PlacedVolume phv = motherVol.placeVolume( vol, pos ); + Volume motherVol = description.pickMotherVolume(det); + PlacedVolume phv = motherVol.placeVolume(vol, pos); det.setPlacement(phv); diff --git a/src/MRich_geo.cpp b/src/MRich_geo.cpp index 566e6c1ac..36fd117fb 100644 --- a/src/MRich_geo.cpp +++ b/src/MRich_geo.cpp @@ -23,13 +23,12 @@ using namespace dd4hep::rec; using Placements = vector<PlacedVolume>; -static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - Material air = description.material("AirOptical"); - string det_name = x_det.nameStr(); +static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDetector sens) { + xml_det_t x_det = e; + Material air = description.material("AirOptical"); + string det_name = x_det.nameStr(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name); + Assembly assembly(det_name); sens.setType("tracker"); OpticalSurfaceManager surfMgr = description.surfaceManager(); @@ -38,59 +37,59 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet PlacedVolume pv; - map<string, Volume> modules; - map<string, Placements> sensitives; - map<string, Volume> module_assemblies; + map<string, Volume> modules; + map<string, Placements> sensitives; + map<string, Volume> module_assemblies; std::map<std::string, DetElement> module_assembly_delements; int n_sensor = 1; // dimensions - xml::Component dims = x_det.dimensions(); - auto rmin = dims.rmin(); - auto rmax = dims.rmax(); - auto length = dims.length(); - auto zmin = dims.zmin(); - auto zpos = zmin + length / 2; + xml::Component dims = x_det.dimensions(); + auto rmin = dims.rmin(); + auto rmax = dims.rmax(); + auto length = dims.length(); + auto zmin = dims.zmin(); + auto zpos = zmin + length / 2; // envelope - Tube envShape(rmin, rmax, length / 2., 0., 2 * M_PI); + Tube envShape(rmin, rmax, length / 2., 0., 2 * M_PI); Volume envVol("MRICH_Envelope", envShape, air); envVol.setVisAttributes(description.visAttributes(x_det.visStr())); if (x_det.hasChild(_Unicode(envelope))) { - xml_comp_t x_envelope = x_det.child(_Unicode(envelope)); - double thickness = x_envelope.thickness(); - Material material = description.material(x_envelope.materialStr()); - Tube envInsideShape(rmin + thickness, rmax - thickness, length / 2. - thickness); + xml_comp_t x_envelope = x_det.child(_Unicode(envelope)); + double thickness = x_envelope.thickness(); + Material material = description.material(x_envelope.materialStr()); + Tube envInsideShape(rmin + thickness, rmax - thickness, length / 2. - thickness); SubtractionSolid envShellShape(envShape, envInsideShape); - Volume envShell("MRICH_Envelope_Inside", envShellShape, material); + Volume envShell("MRICH_Envelope_Inside", envShellShape, material); envVol.placeVolume(envShell); } // expect only one module (for now) - xml_comp_t x_mod = x_det.child(_U(module)); - string mod_name = x_mod.nameStr(); - double mod_width = getAttrOrDefault(x_mod, _U(width), 130.0 * mm); - double mod_height = getAttrOrDefault(x_mod, _U(height), 130.0 * mm); - double mod_length = getAttrOrDefault(x_mod, _U(length), 130.0 * mm); + xml_comp_t x_mod = x_det.child(_U(module)); + string mod_name = x_mod.nameStr(); + double mod_width = getAttrOrDefault(x_mod, _U(width), 130.0 * mm); + double mod_height = getAttrOrDefault(x_mod, _U(height), 130.0 * mm); + double mod_length = getAttrOrDefault(x_mod, _U(length), 130.0 * mm); // module - Box m_solid(mod_width / 2.0, mod_height / 2.0, mod_length / 2.0); + Box m_solid(mod_width / 2.0, mod_height / 2.0, mod_length / 2.0); Volume m_volume(mod_name, m_solid, air); m_volume.setVisAttributes(description.visAttributes(x_mod.visStr())); DetElement mod_de(mod_name + std::string("_mod_") + std::to_string(1), 1); - double z_placement = -mod_length / 2.0; + double z_placement = -mod_length / 2.0; // todo module frame if (x_mod.hasChild(_Unicode(frame))) { - xml_comp_t x_frame = x_mod.child(_Unicode(frame)); - double frame_thickness = getAttrOrDefault(x_frame, _U(thickness), 2.0 * mm); - Box frame_inside(mod_width / 2.0 - frame_thickness, mod_height / 2.0 - frame_thickness, - mod_length / 2.0 - frame_thickness); + xml_comp_t x_frame = x_mod.child(_Unicode(frame)); + double frame_thickness = getAttrOrDefault(x_frame, _U(thickness), 2.0 * mm); + Box frame_inside(mod_width / 2.0 - frame_thickness, mod_height / 2.0 - frame_thickness, + mod_length / 2.0 - frame_thickness); SubtractionSolid frame_solid(m_solid, frame_inside); - Material frame_mat = description.material(x_frame.materialStr()); - Volume frame_vol(mod_name + "_frame", frame_solid, frame_mat); - auto frame_vis = getAttrOrDefault<std::string>(x_frame, _U(vis), std::string("GrayVis")); + Material frame_mat = description.material(x_frame.materialStr()); + Volume frame_vol(mod_name + "_frame", frame_solid, frame_mat); + auto frame_vis = getAttrOrDefault<std::string>(x_frame, _U(vis), std::string("GrayVis")); frame_vol.setVisAttributes(description.visAttributes(frame_vis)); // update position z_placement += frame_thickness / 2.0; @@ -102,27 +101,29 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet // aerogel box if (x_mod.hasChild(_Unicode(aerogel))) { - xml_comp_t x_aerogel = x_mod.child(_Unicode(aerogel)); - double aerogel_width = getAttrOrDefault(x_aerogel, _U(width), 130.0 * mm); - double aerogel_length = getAttrOrDefault(x_aerogel, _U(length), 130.0 * mm); - Material aerogel_mat = description.material(x_aerogel.materialStr()); - auto aerogel_vis = getAttrOrDefault<std::string>(x_aerogel, _U(vis), std::string("InvisibleWithDaughters")); + xml_comp_t x_aerogel = x_mod.child(_Unicode(aerogel)); + double aerogel_width = getAttrOrDefault(x_aerogel, _U(width), 130.0 * mm); + double aerogel_length = getAttrOrDefault(x_aerogel, _U(length), 130.0 * mm); + Material aerogel_mat = description.material(x_aerogel.materialStr()); + auto aerogel_vis = + getAttrOrDefault<std::string>(x_aerogel, _U(vis), std::string("InvisibleWithDaughters")); xml_comp_t x_aerogel_frame = x_aerogel.child(_Unicode(frame)); - double foam_thickness = getAttrOrDefault(x_aerogel_frame, _U(thickness), 2.0 * mm); - Material foam_mat = description.material(x_aerogel_frame.materialStr()); - auto foam_vis = getAttrOrDefault<std::string>(x_aerogel_frame, _U(vis), std::string("RedVis")); + double foam_thickness = getAttrOrDefault(x_aerogel_frame, _U(thickness), 2.0 * mm); + Material foam_mat = description.material(x_aerogel_frame.materialStr()); + auto foam_vis = getAttrOrDefault<std::string>(x_aerogel_frame, _U(vis), std::string("RedVis")); // foam frame - Box foam_box(aerogel_width / 2.0 + foam_thickness, aerogel_width / 2.0 + foam_thickness, - (aerogel_length + foam_thickness) / 2.0); - Box foam_sub_box(aerogel_width / 2.0, aerogel_width / 2.0, (aerogel_length + foam_thickness) / 2.0); + Box foam_box(aerogel_width / 2.0 + foam_thickness, aerogel_width / 2.0 + foam_thickness, + (aerogel_length + foam_thickness) / 2.0); + Box foam_sub_box(aerogel_width / 2.0, aerogel_width / 2.0, + (aerogel_length + foam_thickness) / 2.0); SubtractionSolid foam_frame_solid(foam_box, foam_sub_box, Position(0, 0, foam_thickness)); - Volume foam_vol(mod_name + "_aerogel_frame", foam_frame_solid, foam_mat); + Volume foam_vol(mod_name + "_aerogel_frame", foam_frame_solid, foam_mat); foam_vol.setVisAttributes(description.visAttributes(foam_vis)); // aerogel - Box aerogel_box(aerogel_width / 2.0, aerogel_width / 2.0, (aerogel_length) / 2.0); + Box aerogel_box(aerogel_width / 2.0, aerogel_width / 2.0, (aerogel_length) / 2.0); Volume aerogel_vol(mod_name + "_aerogel", aerogel_box, aerogel_mat); aerogel_vol.setVisAttributes(description.visAttributes(aerogel_vis)); @@ -139,9 +140,10 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet z_placement += aerogel_length / 2.0; // optical surfaces - auto aerogel_surf = surfMgr.opticalSurface( - dd4hep::getAttrOrDefault<std::string>(x_aerogel, _Unicode(surface), "MRICH_AerogelOpticalSurface")); - SkinSurface skin_surf(description, aerogel_de, Form("MRICH_aerogel_skin_surface_%d", 1), aerogel_surf, aerogel_vol); + auto aerogel_surf = surfMgr.opticalSurface(dd4hep::getAttrOrDefault<std::string>( + x_aerogel, _Unicode(surface), "MRICH_AerogelOpticalSurface")); + SkinSurface skin_surf(description, aerogel_de, Form("MRICH_aerogel_skin_surface_%d", 1), + aerogel_surf, aerogel_vol); skin_surf.isValid(); } @@ -152,12 +154,13 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet // - The lens has a constant groove pitch (delta r) as opposed to fixing the groove height. // - The lens area outside of the effective diamtere is flat. // - The grooves are not curved, rather they are polycone shaped, ie a flat approximating the curvature. - auto lens_vis = getAttrOrDefault<std::string>(x_lens, _U(vis), std::string("AnlBlue")); - double groove_pitch = getAttrOrDefault(x_lens, _Unicode(pitch), 0.2 * mm); // 0.5 * mm); - double lens_f = getAttrOrDefault(x_lens, _Unicode(focal_length), 6.0 * 2.54 * cm); - double eff_diameter = getAttrOrDefault(x_lens, _Unicode(effective_diameter), 152.4 * mm); - double lens_width = getAttrOrDefault(x_lens, _Unicode(width), 6.7 * 2.54 * cm); - double center_thickness = getAttrOrDefault(x_lens, _U(thickness), 0.068 * 2.54 * cm); // 2.0 * mm); + auto lens_vis = getAttrOrDefault<std::string>(x_lens, _U(vis), std::string("AnlBlue")); + double groove_pitch = getAttrOrDefault(x_lens, _Unicode(pitch), 0.2 * mm); // 0.5 * mm); + double lens_f = getAttrOrDefault(x_lens, _Unicode(focal_length), 6.0 * 2.54 * cm); + double eff_diameter = getAttrOrDefault(x_lens, _Unicode(effective_diameter), 152.4 * mm); + double lens_width = getAttrOrDefault(x_lens, _Unicode(width), 6.7 * 2.54 * cm); + double center_thickness = + getAttrOrDefault(x_lens, _U(thickness), 0.068 * 2.54 * cm); // 2.0 * mm); double n_acrylic = 1.49; double lens_curvature = 1.0 / (lens_f * (n_acrylic - 1.0)); // confirmed @@ -167,27 +170,29 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet double groove_last_rmin = (N_grooves - 1) * groove_pitch; double groove_last_rmax = N_grooves * groove_pitch; - auto groove_sagitta = [&](double r) { return lens_curvature * std::pow(r, 2) / (1.0 + 1.0); }; - double lens_thickness = groove_sagitta(groove_last_rmax) - groove_sagitta(groove_last_rmin) + center_thickness; + auto groove_sagitta = [&](double r) { return lens_curvature * std::pow(r, 2) / (1.0 + 1.0); }; + double lens_thickness = + groove_sagitta(groove_last_rmax) - groove_sagitta(groove_last_rmin) + center_thickness; - Material lens_mat = description.material(x_lens.materialStr()); - Box lens_box(lens_width / 2.0, lens_width / 2.0, (center_thickness) / 2.0); + Material lens_mat = description.material(x_lens.materialStr()); + Box lens_box(lens_width / 2.0, lens_width / 2.0, (center_thickness) / 2.0); SubtractionSolid flat_lens(lens_box, Tube(0.0, full_ring_rmax, 2 * center_thickness)); Assembly lens_vol(mod_name + "_lens"); - Volume flatpart_lens_vol("flatpart_lens", flat_lens, lens_mat); + Volume flatpart_lens_vol("flatpart_lens", flat_lens, lens_mat); lens_vol.placeVolume(flatpart_lens_vol); - int i_groove = 0; + int i_groove = 0; double groove_rmax = groove_pitch; double groove_rmin = 0; while (groove_rmax <= full_ring_rmax) { - double dZ = groove_sagitta(groove_rmax) - groove_sagitta(groove_rmin); - Polycone groove_solid(0, 2.0 * M_PI, {groove_rmin, groove_rmin, groove_rmin}, - {groove_rmax, groove_rmax, groove_rmin}, - {-lens_thickness / 2.0, lens_thickness / 2.0 - dZ, lens_thickness / 2.0}); - Volume lens_groove_vol("lens_groove_" + std::to_string(i_groove), groove_solid, lens_mat); + double dZ = groove_sagitta(groove_rmax) - groove_sagitta(groove_rmin); + Polycone groove_solid( + 0, 2.0 * M_PI, {groove_rmin, groove_rmin, groove_rmin}, + {groove_rmax, groove_rmax, groove_rmin}, + {-lens_thickness / 2.0, lens_thickness / 2.0 - dZ, lens_thickness / 2.0}); + Volume lens_groove_vol("lens_groove_" + std::to_string(i_groove), groove_solid, lens_mat); lens_vol.placeVolume(lens_groove_vol); i_groove++; @@ -207,9 +212,10 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet z_placement += lens_thickness / 2.0; // optical surfaces - auto lens_surf = surfMgr.opticalSurface( - dd4hep::getAttrOrDefault<std::string>(x_lens, _Unicode(surface), "MRICH_LensOpticalSurface")); - SkinSurface skin_surf(description, lens_de, Form("MRichFresnelLens_skin_surface_%d", 1), lens_surf, lens_vol); + auto lens_surf = surfMgr.opticalSurface(dd4hep::getAttrOrDefault<std::string>( + x_lens, _Unicode(surface), "MRICH_LensOpticalSurface")); + SkinSurface skin_surf(description, lens_de, Form("MRichFresnelLens_skin_surface_%d", 1), + lens_surf, lens_vol); skin_surf.isValid(); } @@ -221,20 +227,20 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet // mirror if (x_mod.hasChild(_Unicode(mirror))) { - xml_comp_t x_mirror = x_mod.child(_Unicode(mirror)); - auto mirror_vis = getAttrOrDefault<std::string>(x_mirror, _U(vis), std::string("AnlGray")); - double mirror_x1 = getAttrOrDefault(x_mirror, _U(x1), 100.0 * mm); - double mirror_x2 = getAttrOrDefault(x_mirror, _U(x2), 80.0 * mm); - double mirror_length = getAttrOrDefault(x_mirror, _U(length), 130.0 * mm); - double mirror_thickness = getAttrOrDefault(x_mirror, _U(thickness), 2.0 * mm); - double outer_x1 = (mirror_x1 + mirror_thickness) / 2.0; - double outer_x2 = (mirror_x2 + mirror_thickness) / 2.0; - Trd2 outer_mirror_trd(outer_x1, outer_x2, outer_x1, outer_x2, mirror_length / 2.0); - Trd2 inner_mirror_trd(mirror_x1 / 2.0, mirror_x2 / 2.0, mirror_x1 / 2.0, mirror_x2 / 2.0, - mirror_length / 2.0 + 0.1 * mm); + xml_comp_t x_mirror = x_mod.child(_Unicode(mirror)); + auto mirror_vis = getAttrOrDefault<std::string>(x_mirror, _U(vis), std::string("AnlGray")); + double mirror_x1 = getAttrOrDefault(x_mirror, _U(x1), 100.0 * mm); + double mirror_x2 = getAttrOrDefault(x_mirror, _U(x2), 80.0 * mm); + double mirror_length = getAttrOrDefault(x_mirror, _U(length), 130.0 * mm); + double mirror_thickness = getAttrOrDefault(x_mirror, _U(thickness), 2.0 * mm); + double outer_x1 = (mirror_x1 + mirror_thickness) / 2.0; + double outer_x2 = (mirror_x2 + mirror_thickness) / 2.0; + Trd2 outer_mirror_trd(outer_x1, outer_x2, outer_x1, outer_x2, mirror_length / 2.0); + Trd2 inner_mirror_trd(mirror_x1 / 2.0, mirror_x2 / 2.0, mirror_x1 / 2.0, mirror_x2 / 2.0, + mirror_length / 2.0 + 0.1 * mm); SubtractionSolid mirror_solid(outer_mirror_trd, inner_mirror_trd); - Material mirror_mat = description.material(x_mirror.materialStr()); - Volume mirror_vol(mod_name + "_mirror", mirror_solid, mirror_mat); + Material mirror_mat = description.material(x_mirror.materialStr()); + Volume mirror_vol(mod_name + "_mirror", mirror_solid, mirror_mat); // update position z_placement += mirror_length / 2.0; @@ -246,21 +252,22 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet z_placement += mirror_length / 2.0; // optical surfaces - auto mirror_surf = surfMgr.opticalSurface( - dd4hep::getAttrOrDefault<std::string>(x_mirror, _Unicode(surface), "MRICH_MirrorOpticalSurface")); - SkinSurface skin_surf(description, mirror_de, Form("MRICH_mirror_skin_surface_%d", 1), mirror_surf, mirror_vol); + auto mirror_surf = surfMgr.opticalSurface(dd4hep::getAttrOrDefault<std::string>( + x_mirror, _Unicode(surface), "MRICH_MirrorOpticalSurface")); + SkinSurface skin_surf(description, mirror_de, Form("MRICH_mirror_skin_surface_%d", 1), + mirror_surf, mirror_vol); skin_surf.isValid(); } // photon detector if (x_mod.hasChild(_Unicode(photodet))) { - xml_comp_t x_photodet = x_mod.child(_Unicode(photodet)); - auto photodet_vis = getAttrOrDefault<std::string>(x_photodet, _U(vis), std::string("AnlRed")); - double photodet_width = getAttrOrDefault(x_photodet, _U(width), 130.0 * mm); - double photodet_thickness = getAttrOrDefault(x_photodet, _U(thickness), 2.0 * mm); - Material photodet_mat = description.material(x_photodet.materialStr()); - Box window_box(photodet_width / 2.0, photodet_width / 2.0, photodet_thickness / 2.0); - Volume window_vol(mod_name + "_window", window_box, photodet_mat); + xml_comp_t x_photodet = x_mod.child(_Unicode(photodet)); + auto photodet_vis = getAttrOrDefault<std::string>(x_photodet, _U(vis), std::string("AnlRed")); + double photodet_width = getAttrOrDefault(x_photodet, _U(width), 130.0 * mm); + double photodet_thickness = getAttrOrDefault(x_photodet, _U(thickness), 2.0 * mm); + Material photodet_mat = description.material(x_photodet.materialStr()); + Box window_box(photodet_width / 2.0, photodet_width / 2.0, photodet_thickness / 2.0); + Volume window_vol(mod_name + "_window", window_box, photodet_mat); // update position z_placement += photodet_thickness / 2.0; @@ -288,17 +295,18 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet // layers int i_layer = 1; for (xml_coll_t li(x_photodet, _Unicode(layer)); li; ++li) { - xml_comp_t x_layer = li; - Material layer_mat = description.material(x_layer.materialStr()); - double layer_thickness = x_layer.thickness(); - Box layer_box(photodet_width / 2.0, photodet_width / 2.0, layer_thickness / 2.0); - Volume layer_vol(mod_name + "_layer_" + std::to_string(i_layer), layer_box, layer_mat); + xml_comp_t x_layer = li; + Material layer_mat = description.material(x_layer.materialStr()); + double layer_thickness = x_layer.thickness(); + Box layer_box(photodet_width / 2.0, photodet_width / 2.0, layer_thickness / 2.0); + Volume layer_vol(mod_name + "_layer_" + std::to_string(i_layer), layer_box, layer_mat); // update position z_placement += layer_thickness / 2.0; // place volume pv = m_volume.placeVolume(layer_vol, Position(0, 0, z_placement)); - DetElement layer_de(mod_de, mod_name + std::string("_layer_de_") + std::to_string(i_layer), 1); + DetElement layer_de(mod_de, mod_name + std::string("_layer_de_") + std::to_string(i_layer), + 1); layer_de.setPlacement(pv); // update position z_placement += layer_thickness / 2.0; @@ -338,7 +346,8 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet for (xml_coll_t x_position_i(x_positions, _U(position)); x_position_i; ++x_position_i) { xml_comp_t x_position = x_position_i; positions.push_back(std::make_tuple(x_positions.scale() * x_position.x() * mm, - x_positions.scale() * x_position.y() * mm, -x_positions.z0())); + x_positions.scale() * x_position.y() * mm, + -x_positions.z0())); } } // if no positions, then autoplacement @@ -387,7 +396,8 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet pv = envVol.placeVolume(mod_v, tr); pv.addPhysVolID("module", i_mod); - auto mod_det_element = module_assembly_delements[mod_name].clone(mod_name + "__" + std::to_string(i_mod)); + auto mod_det_element = + module_assembly_delements[mod_name].clone(mod_name + "__" + std::to_string(i_mod)); mod_det_element.setPlacement(pv); sdet.add(mod_det_element); @@ -397,11 +407,11 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet // additional layers if (x_det.hasChild(_Unicode(layer))) { - xml_comp_t x_layer = x_det.child(_Unicode(layer)); - double layer_thickness = x_layer.thickness(); - Material layer_mat = description.material(x_layer.materialStr()); - Tube frameShape(rmin, rmax, layer_thickness / 2., 0., 2 * M_PI); - Volume frameVol("MRICH_Frame", frameShape, layer_mat); + xml_comp_t x_layer = x_det.child(_Unicode(layer)); + double layer_thickness = x_layer.thickness(); + Material layer_mat = description.material(x_layer.materialStr()); + Tube frameShape(rmin, rmax, layer_thickness / 2., 0., 2 * M_PI); + Volume frameVol("MRICH_Frame", frameShape, layer_mat); pv = envVol.placeVolume(frameVol, Position(0, 0, (length - layer_thickness) / 2.0)); } diff --git a/src/OffMomentumTracker_geo.cpp b/src/OffMomentumTracker_geo.cpp index 3a2b2e1f5..6960eb7e4 100644 --- a/src/OffMomentumTracker_geo.cpp +++ b/src/OffMomentumTracker_geo.cpp @@ -17,60 +17,62 @@ using namespace dd4hep::detail; * * @author Whitney Armstrong */ -static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; - Material vacuum = description.vacuum(); - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - DetElement sdet(det_name, det_id); - Assembly assembly(det_name); - xml::Component pos = x_det.position(); - xml::Component rot = x_det.rotation(); + xml_det_t x_det = e; + Material vacuum = description.vacuum(); + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + DetElement sdet(det_name, det_id); + Assembly assembly(det_name); + xml::Component pos = x_det.position(); + xml::Component rot = x_det.rotation(); // Material air = description.material("Air"); // Volume assembly (det_name,Box(10000,10000,10000),vacuum); - Volume motherVol = description.pickMotherVolume(sdet); - int m_id = 0, c_id = 0, n_sensor = 0; - map<string, Volume> modules; + Volume motherVol = description.pickMotherVolume(sdet); + int m_id = 0, c_id = 0, n_sensor = 0; + map<string, Volume> modules; map<string, Placements> sensitives; - PlacedVolume pv; + PlacedVolume pv; assembly.setVisAttributes(description.invisible()); sens.setType("tracker"); for (xml_coll_t su(x_det, _U(support)); su; ++su) { - xml_comp_t x_support = su; - double support_thickness = getAttrOrDefault<double>(x_support, _U(thickness), 2.0 * mm); - double support_length = getAttrOrDefault<double>(x_support, _U(length), 2.0 * mm); - double support_rmin = getAttrOrDefault<double>(x_support, _U(rmin), 2.0 * mm); - double support_zstart = getAttrOrDefault<double>(x_support, _U(zstart), 2.0 * mm); - std::string support_name = getAttrOrDefault<std::string>(x_support, _Unicode(name), "support_tube"); - std::string support_vis = getAttrOrDefault<std::string>(x_support, _Unicode(vis), "AnlRed"); - xml_dim_t support_pos(x_support.child(_U(position), false)); - xml_dim_t support_rot(x_support.child(_U(rotation), false)); - Solid support_solid; + xml_comp_t x_support = su; + double support_thickness = getAttrOrDefault<double>(x_support, _U(thickness), 2.0 * mm); + double support_length = getAttrOrDefault<double>(x_support, _U(length), 2.0 * mm); + double support_rmin = getAttrOrDefault<double>(x_support, _U(rmin), 2.0 * mm); + double support_zstart = getAttrOrDefault<double>(x_support, _U(zstart), 2.0 * mm); + std::string support_name = + getAttrOrDefault<std::string>(x_support, _Unicode(name), "support_tube"); + std::string support_vis = getAttrOrDefault<std::string>(x_support, _Unicode(vis), "AnlRed"); + xml_dim_t support_pos(x_support.child(_U(position), false)); + xml_dim_t support_rot(x_support.child(_U(rotation), false)); + Solid support_solid; if (x_support.hasChild(_U(shape))) { xml_comp_t shape(x_support.child(_U(shape))); - string shape_type = shape.typeStr(); - support_solid = xml::createShape(description, shape_type, shape); + string shape_type = shape.typeStr(); + support_solid = xml::createShape(description, shape_type, shape); } else { support_solid = Tube(support_rmin, support_rmin + support_thickness, support_length / 2); } - Transform3D tr = Transform3D(Rotation3D(), Position(0, 0, (support_zstart + support_length / 2))); + Transform3D tr = + Transform3D(Rotation3D(), Position(0, 0, (support_zstart + support_length / 2))); if (support_pos.ptr() && support_rot.ptr()) { Rotation3D rot3D(RotationZYX(support_rot.z(0), support_rot.y(0), support_rot.x(0))); - Position pos3D(support_pos.x(0), support_pos.y(0), support_pos.z(0)); + Position pos3D(support_pos.x(0), support_pos.y(0), support_pos.z(0)); tr = Transform3D(rot3D, pos3D); } else if (support_pos.ptr()) { - tr = Transform3D(Rotation3D(), Position(support_pos.x(0), support_pos.y(0), support_pos.z(0))); + tr = + Transform3D(Rotation3D(), Position(support_pos.x(0), support_pos.y(0), support_pos.z(0))); } else if (support_rot.ptr()) { Rotation3D rot3D(RotationZYX(support_rot.z(0), support_rot.y(0), support_rot.x(0))); tr = Transform3D(rot3D, Position()); } Material support_mat = description.material(x_support.materialStr()); - Volume support_vol(support_name, support_solid, support_mat); + Volume support_vol(support_name, support_solid, support_mat); support_vol.setVisAttributes(description.visAttributes(support_vis)); pv = assembly.placeVolume(support_vol, tr); // pv = assembly.placeVolume(support_vol, Position(0, 0, support_zstart + support_length / 2)); @@ -78,7 +80,7 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive for (xml_coll_t mi(x_det, _U(module)); mi; ++mi, ++m_id) { xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); + string m_nam = x_mod.nameStr(); xml_comp_t x_box = x_mod.shape(); double x1 = x_box.x(); @@ -91,7 +93,7 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive total_thickness += xml_comp_t(ci).thickness(); } - Box m_solid(x1 / 2.0, y1 / 2.0, total_thickness / 2.0); + Box m_solid(x1 / 2.0, y1 / 2.0, total_thickness / 2.0); Volume m_volume(m_nam, m_solid, vacuum); m_volume.setVisAttributes(description.visAttributes(x_mod.visStr())); @@ -122,15 +124,15 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive double posZ = -total_thickness / 2.0; for (ci.reset(), n_sensor = 1, c_id = 0, posZ = -total_thickness / 2.0; ci; ++ci, ++c_id) { - xml_comp_t c = ci; - double c_thick = c.thickness(); - auto comp_x = getAttrOrDefault(c, _Unicode(x), x1); - auto comp_y = getAttrOrDefault(c, _Unicode(y), y1); + xml_comp_t c = ci; + double c_thick = c.thickness(); + auto comp_x = getAttrOrDefault(c, _Unicode(x), x1); + auto comp_y = getAttrOrDefault(c, _Unicode(y), y1); - Material c_mat = description.material(c.materialStr()); - string c_name = _toString(c_id, "OMD_component%d"); + Material c_mat = description.material(c.materialStr()); + string c_name = _toString(c_id, "OMD_component%d"); - Box comp_s1(comp_x / 2.0, comp_y / 2.0, c_thick / 2e0); + Box comp_s1(comp_x / 2.0, comp_y / 2.0, c_thick / 2e0); Solid comp_shape = comp_s1; // if(frame_s.isValid()) { // comp_shape = SubtractionSolid( comp_s1, frame_s); @@ -141,7 +143,8 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive pv = m_volume.placeVolume(c_vol, Position(0, 0, posZ + c_thick / 2.0)); if (c.isSensitive()) { // std::cout << " adding sensitive volume" << c_name << "\n"; - sdet.check(n_sensor > 2, "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); + sdet.check(n_sensor > 2, + "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); pv.addPhysVolID("slice", n_sensor); sens.setType("tracker"); c_vol.setSensitiveDetector(sens); @@ -155,11 +158,11 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive for (xml_coll_t li(x_det, _U(layer)); li; ++li) { xml_comp_t x_layer(li); - int l_id = x_layer.id(); - int mod_num = 1; + int l_id = x_layer.id(); + int mod_num = 1; - xml_comp_t l_env = x_layer.child(_U(envelope)); - string layer_name = det_name + std::string("_layer") + std::to_string(l_id); + xml_comp_t l_env = x_layer.child(_U(envelope)); + string layer_name = det_name + std::string("_layer") + std::to_string(l_id); std::string layer_vis = l_env.attr<std::string>(_Unicode(vis)); // double layer_x = l_env.attr<double>(_Unicode(x)); @@ -191,8 +194,8 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive DetElement layer_element(sdet, layer_name, l_id); layer_element.setPlacement(layer_pv); - string m_nam = x_layer.moduleStr(); - Volume m_vol = modules[m_nam]; + string m_nam = x_layer.moduleStr(); + Volume m_vol = modules[m_nam]; Placements& sensVols = sensitives[m_nam]; DetElement module(layer_element, "module_", l_id); @@ -201,9 +204,8 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(module, sens_pv.volume().name(), mod_num); + DetElement comp_elt(module, sens_pv.volume().name(), mod_num); comp_elt.setPlacement(sens_pv); - } // for (xml_coll_t ri(x_layer, _U(ring)); ri; ++ri) { @@ -261,7 +263,8 @@ static Ref_t create_OffMomentumTracker(Detector& description, xml_h e, Sensitive //} ++mod_num; } - Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), + Position(pos.x(), pos.y(), pos.z())); pv = motherVol.placeVolume(assembly, posAndRot); pv.addPhysVolID("system", det_id); sdet.setPlacement(pv); diff --git a/src/PFRICH_geo.cpp b/src/PFRICH_geo.cpp index aba06b4f7..db9fbe1bc 100644 --- a/src/PFRICH_geo.cpp +++ b/src/PFRICH_geo.cpp @@ -31,679 +31,702 @@ using namespace dd4hep::detail; static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector sens) { - xml_det_t x_det = e; - int det_id = x_det.id(); + xml_det_t x_det = e; + int det_id = x_det.id(); - string det_name = x_det.nameStr(); - Material air = description.air(); + string det_name = x_det.nameStr(); + Material air = description.air(); - DetElement sdet(det_name, det_id); + DetElement sdet(det_name, det_id); - std::vector<double> rmins = {100, 100}; - std::vector<double> rmaxs = {1300, 1300}; - std::vector<double> zs = {-5000, 5000}; + std::vector<double> rmins = {100, 100}; + std::vector<double> rmaxs = {1300, 1300}; + std::vector<double> zs = {-5000, 5000}; - sens.setType("tracker"); - description.invisible(); + sens.setType("tracker"); + description.invisible(); - xml::DetElement detElem = e; - std::string detName = detElem.nameStr(); - xml::Component dims = detElem.dimensions(); + xml::DetElement detElem = e; + std::string detName = detElem.nameStr(); + xml::Component dims = detElem.dimensions(); - xml_dim_t x_par(x_det.child(_U(parent))); + xml_dim_t x_par(x_det.child(_U(parent))); - string name = x_det.nameStr(); - string par_nam = x_par.nameStr(); - DetElement det_parent = description.detector(par_nam); + string name = x_det.nameStr(); + string par_nam = x_par.nameStr(); + DetElement det_parent = description.detector(par_nam); - Volume mother = det_parent.volume(); - PlacedVolume pv; + Volume mother = det_parent.volume(); + PlacedVolume pv; - int id = x_det.hasAttr(_U(id)) ? x_det.id() : 0; - xml_dim_t x_pos(x_det.child(_U(position), false)); - xml_dim_t x_rot(x_det.child(_U(rotation), false)); + int id = x_det.hasAttr(_U(id)) ? x_det.id() : 0; + xml_dim_t x_pos(x_det.child(_U(position), false)); + xml_dim_t x_rot(x_det.child(_U(rotation), false)); - auto vesselMat = description.material("VacuumOptical"); + auto vesselMat = description.material("VacuumOptical"); - Tube pfRICH_air_volume(0.0, 65.0, 25.0); // dimension of the pfRICH world in cm + Tube pfRICH_air_volume(0.0, 65.0, 25.0); // dimension of the pfRICH world in cm - Rotation3D rot(RotationZYX(0, M_PI, 0)); - Transform3D transform(rot, Position(0, 0, -149)); + Rotation3D rot(RotationZYX(0, M_PI, 0)); + Transform3D transform(rot, Position(0, 0, -149)); - // BUILD SENSORS /////////////////////// - // solid and volume: single sensor module + // BUILD SENSORS /////////////////////// + // solid and volume: single sensor module - OpticalSurfaceManager surfMgr = description.surfaceManager(); + OpticalSurfaceManager surfMgr = description.surfaceManager(); - // - sensor module - auto sensorElem = detElem.child(_Unicode(sensors)).child(_Unicode(module)); - auto sensorMat = description.material(sensorElem.attr<std::string>(_Unicode(material))); - auto sensorVis = description.visAttributes(sensorElem.attr<std::string>(_Unicode(vis))); - auto sensorSurf = surfMgr.opticalSurface(sensorElem.attr<std::string>(_Unicode(surface))); - double sensorSide = sensorElem.attr<double>(_Unicode(side)); - double sensorThickness = sensorElem.attr<double>(_Unicode(thickness)); - auto readoutName = detElem.attr<std::string>(_Unicode(readout)); + // - sensor module + auto sensorElem = detElem.child(_Unicode(sensors)).child(_Unicode(module)); + auto sensorMat = description.material(sensorElem.attr<std::string>(_Unicode(material))); + auto sensorVis = description.visAttributes(sensorElem.attr<std::string>(_Unicode(vis))); + auto sensorSurf = surfMgr.opticalSurface(sensorElem.attr<std::string>(_Unicode(surface))); + double sensorSide = sensorElem.attr<double>(_Unicode(side)); + double sensorThickness = sensorElem.attr<double>(_Unicode(thickness)); + auto readoutName = detElem.attr<std::string>(_Unicode(readout)); - double vesselRmin0 = dims.attr<double>(_Unicode(rmin0)); - double vesselRmin1 = dims.attr<double>(_Unicode(rmin1)); - double vesselRmax0 = dims.attr<double>(_Unicode(rmax0)); - double vesselRmax1 = dims.attr<double>(_Unicode(rmax1)); + double vesselRmin0 = dims.attr<double>(_Unicode(rmin0)); + double vesselRmin1 = dims.attr<double>(_Unicode(rmin1)); + double vesselRmax0 = dims.attr<double>(_Unicode(rmax0)); + double vesselRmax1 = dims.attr<double>(_Unicode(rmax1)); - int imod = 0; // module number + int imod = 0; // module number - auto gasvolMat = description.material("C4F10_PFRICH"); - auto gasvolVis = description.visAttributes("DRICH_gas_vis"); - auto vesselVis = description.visAttributes("DRICH_gas_vis"); + auto gasvolMat = description.material("C4F10_PFRICH"); + auto gasvolVis = description.visAttributes("DRICH_gas_vis"); + auto vesselVis = description.visAttributes("DRICH_gas_vis"); - double windowThickness = dims.attr<double>(_Unicode(window_thickness)); - double wallThickness = dims.attr<double>(_Unicode(wall_thickness)); + double windowThickness = dims.attr<double>(_Unicode(window_thickness)); + double wallThickness = dims.attr<double>(_Unicode(wall_thickness)); - double proximityGap = dims.attr<double>(_Unicode(proximity_gap)); + double proximityGap = dims.attr<double>(_Unicode(proximity_gap)); - long debug_optics_mode = description.constantAsLong("PFRICH_debug_optics"); + long debug_optics_mode = description.constantAsLong("PFRICH_debug_optics"); - bool debug_optics = debug_optics_mode > 0; + bool debug_optics = debug_optics_mode > 0; - auto radiatorElem = detElem.child(_Unicode(radiator)); - double radiatorFrontplane = radiatorElem.attr<double>(_Unicode(frontplane)); + auto radiatorElem = detElem.child(_Unicode(radiator)); + double radiatorFrontplane = radiatorElem.attr<double>(_Unicode(frontplane)); - auto aerogelElem = radiatorElem.child(_Unicode(aerogel)); - double aerogelThickness = aerogelElem.attr<double>(_Unicode(thickness)); + auto aerogelElem = radiatorElem.child(_Unicode(aerogel)); + double aerogelThickness = aerogelElem.attr<double>(_Unicode(thickness)); - double radiatorRmin = radiatorElem.attr<double>(_Unicode(rmin)); - double radiatorRmax = radiatorElem.attr<double>(_Unicode(rmax)); + double radiatorRmin = radiatorElem.attr<double>(_Unicode(rmin)); + double radiatorRmax = radiatorElem.attr<double>(_Unicode(rmax)); - double airgapThickness = 0.1; - double filterThickness = 1; + double airgapThickness = 0.1; + double filterThickness = 1; - auto aerogelMat = description.material("C4F10_PFRICH"); - auto filterMat = description.material("C4F10_PFRICH"); + auto aerogelMat = description.material("C4F10_PFRICH"); + auto filterMat = description.material("C4F10_PFRICH"); - double vesselLength = dims.attr<double>(_Unicode(length)); - auto originFront = Position(0., 0., vesselLength / 2.0); - double sensorZpos = radiatorFrontplane - aerogelThickness - proximityGap - 0.5 * sensorThickness; - auto sensorPlanePos = Position(0., 0., sensorZpos) + originFront; // reference position + double vesselLength = dims.attr<double>(_Unicode(length)); + auto originFront = Position(0., 0., vesselLength / 2.0); + double sensorZpos = radiatorFrontplane - aerogelThickness - proximityGap - 0.5 * sensorThickness; + auto sensorPlanePos = Position(0., 0., sensorZpos) + originFront; // reference position - // readout coder <-> unique sensor ID - /* - `sensorIDfields` is a list of readout fields used to specify a unique sensor ID + // readout coder <-> unique sensor ID + /* - `sensorIDfields` is a list of readout fields used to specify a unique sensor ID * - `cellMask` is defined such that a hit's `cellID & cellMask` is the corresponding sensor's unique ID * - this redundant generalization is for future flexibility, and consistency with dRICH */ - std::vector<std::string> sensorIDfields = {"module"}; - const auto& readoutCoder = *description.readout(readoutName).idSpec().decoder(); - // determine `cellMask` based on `sensorIDfields` - uint64_t cellMask = 0; - for (const auto& idField : sensorIDfields) - cellMask |= readoutCoder[idField].mask(); - description.add(Constant("PFRICH_cell_mask", std::to_string(cellMask))); - // create a unique sensor ID from a sensor's PlacedVolume::volIDs - auto encodeSensorID = [&readoutCoder](auto ids) { - uint64_t enc = 0; - for (const auto& [idField, idValue] : ids) - enc |= uint64_t(idValue) << readoutCoder[idField].offset(); - return enc; - }; - - auto mirrorElem = detElem.child(_Unicode(mirror)); - auto mirrorMat = description.material(mirrorElem.attr<std::string>(_Unicode(material))); - auto mirrorVis = description.visAttributes(mirrorElem.attr<std::string>(_Unicode(vis))); - - Cone mirror_cone(vesselLength / 2.0, vesselRmax1-7, vesselRmax1-7+0.3, vesselRmax1-13, vesselRmax1-13+0.3); - - // flange - - float _FLANGE_EPIPE_DIAMETER_ = 10.53; // in cm - float _FLANGE_HPIPE_DIAMETER_ = 4.47; // in cm - float _FLANGE_HPIPE_OFFSET_ = 6.76; // in cm - float clearance = 0.5; // in cm - - /// Inner mirror cone - // A wedge bridging two cylinders; - - Tube eflange(0.0, _FLANGE_EPIPE_DIAMETER_/2 + clearance, 25); - Tube hflange(0.0, _FLANGE_HPIPE_DIAMETER_/2 + clearance, 25); - - double r0 = _FLANGE_EPIPE_DIAMETER_/2 + clearance; - double r1 = _FLANGE_HPIPE_DIAMETER_/2 + clearance; - double L = _FLANGE_HPIPE_OFFSET_; - double a = r0*L/(r0-r1); - double b = r0*r0/a; - double c = r1*(a-b)/r0; - - // GEANT variables to define G4Trap; - double pDz = 25, pTheta = 0.0, pPhi = 0.0, pDy1 = (a - b - c)/2, pDy2 = pDy1; - double pDx1 = sqrt(r0*r0 - b*b), pDx2 = pDx1*r1/r0, pDx3 = pDx1, pDx4 = pDx2, pAlp1 = 0.0, pAlp2 = 0.0; - - Trap wedge(pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2); - - UnionSolid flange_shape(eflange, hflange, Position(-_FLANGE_HPIPE_OFFSET_, 0.0, 0.0)); - Rotation3D rZ(RotationZYX(M_PI/2.0, 0.0, 0.0)); - Transform3D transform_flange(rZ, Position(-b - pDy1, 0.0, 0.0)); - UnionSolid flange_final_shape(flange_shape, wedge, transform_flange); - - Volume flangeVol(detName + "_flange", flange_final_shape, mirrorMat); - flangeVol.setVisAttributes(mirrorVis); - - SubtractionSolid pfRICH_volume_shape(pfRICH_air_volume, flange_final_shape); - - Volume pfRICH_volume(detName +"_Vol", pfRICH_volume_shape, vesselMat); // dimension of the pfRICH world in cm + std::vector<std::string> sensorIDfields = {"module"}; + const auto& readoutCoder = *description.readout(readoutName).idSpec().decoder(); + // determine `cellMask` based on `sensorIDfields` + uint64_t cellMask = 0; + for (const auto& idField : sensorIDfields) + cellMask |= readoutCoder[idField].mask(); + description.add(Constant("PFRICH_cell_mask", std::to_string(cellMask))); + // create a unique sensor ID from a sensor's PlacedVolume::volIDs + auto encodeSensorID = [&readoutCoder](auto ids) { + uint64_t enc = 0; + for (const auto& [idField, idValue] : ids) + enc |= uint64_t(idValue) << readoutCoder[idField].offset(); + return enc; + }; + + auto mirrorElem = detElem.child(_Unicode(mirror)); + auto mirrorMat = description.material(mirrorElem.attr<std::string>(_Unicode(material))); + auto mirrorVis = description.visAttributes(mirrorElem.attr<std::string>(_Unicode(vis))); + + Cone mirror_cone(vesselLength / 2.0, vesselRmax1 - 7, vesselRmax1 - 7 + 0.3, vesselRmax1 - 13, + vesselRmax1 - 13 + 0.3); + + // flange + + float _FLANGE_EPIPE_DIAMETER_ = 10.53; // in cm + float _FLANGE_HPIPE_DIAMETER_ = 4.47; // in cm + float _FLANGE_HPIPE_OFFSET_ = 6.76; // in cm + float clearance = 0.5; // in cm + + /// Inner mirror cone + // A wedge bridging two cylinders; + + Tube eflange(0.0, _FLANGE_EPIPE_DIAMETER_ / 2 + clearance, 25); + Tube hflange(0.0, _FLANGE_HPIPE_DIAMETER_ / 2 + clearance, 25); + + double r0 = _FLANGE_EPIPE_DIAMETER_ / 2 + clearance; + double r1 = _FLANGE_HPIPE_DIAMETER_ / 2 + clearance; + double L = _FLANGE_HPIPE_OFFSET_; + double a = r0 * L / (r0 - r1); + double b = r0 * r0 / a; + double c = r1 * (a - b) / r0; + + // GEANT variables to define G4Trap; + double pDz = 25, pTheta = 0.0, pPhi = 0.0, pDy1 = (a - b - c) / 2, pDy2 = pDy1; + double pDx1 = sqrt(r0 * r0 - b * b), pDx2 = pDx1 * r1 / r0, pDx3 = pDx1, pDx4 = pDx2, pAlp1 = 0.0, + pAlp2 = 0.0; + + Trap wedge(pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2); + + UnionSolid flange_shape(eflange, hflange, Position(-_FLANGE_HPIPE_OFFSET_, 0.0, 0.0)); + Rotation3D rZ(RotationZYX(M_PI / 2.0, 0.0, 0.0)); + Transform3D transform_flange(rZ, Position(-b - pDy1, 0.0, 0.0)); + UnionSolid flange_final_shape(flange_shape, wedge, transform_flange); + + Volume flangeVol(detName + "_flange", flange_final_shape, mirrorMat); + flangeVol.setVisAttributes(mirrorVis); + + SubtractionSolid pfRICH_volume_shape(pfRICH_air_volume, flange_final_shape); + + Volume pfRICH_volume(detName + "_Vol", pfRICH_volume_shape, + vesselMat); // dimension of the pfRICH world in cm + + pv = mother.placeVolume(pfRICH_volume, transform); + + if (id != 0) { + pv.addPhysVolID("system", id); + } + sdet.setPlacement(pv); + + /// tank solids + + double boreDelta = vesselRmin1 - vesselRmin0; + Cone vesselTank(vesselLength / 2.0, vesselRmin1, vesselRmax1, vesselRmin0, vesselRmax0); + Cone gasvolTank(vesselLength / 2.0 - windowThickness, vesselRmin1 + wallThickness, + vesselRmax1 - wallThickness, vesselRmin0 + wallThickness, + vesselRmax0 - wallThickness); + + Box gasvolBox(1000, 1000, 1000); + + Solid gasvolSolid; + gasvolSolid = gasvolTank; - pv = mother.placeVolume(pfRICH_volume, transform); + Solid vesselSolid; + vesselSolid = vesselTank; - if (id != 0) { - pv.addPhysVolID("system", id); - } - sdet.setPlacement(pv); - - /// tank solids - - double boreDelta = vesselRmin1 - vesselRmin0; - Cone vesselTank(vesselLength / 2.0, vesselRmin1, vesselRmax1, vesselRmin0, vesselRmax0); - Cone gasvolTank(vesselLength / 2.0 - windowThickness, vesselRmin1 + wallThickness, vesselRmax1 - wallThickness, - vesselRmin0 + wallThickness, vesselRmax0 - wallThickness); - - Box gasvolBox(1000, 1000, 1000); - - Solid gasvolSolid; - gasvolSolid = gasvolTank; - - Solid vesselSolid; - vesselSolid = vesselTank; - - Solid mirrorSolid; - mirrorSolid = mirror_cone; + Solid mirrorSolid; + mirrorSolid = mirror_cone; - Volume vesselVol(detName, vesselSolid, vesselMat); - Volume gasvolVol(detName + "_gas", gasvolSolid, gasvolMat); - vesselVol.setVisAttributes(vesselVis); - gasvolVol.setVisAttributes(gasvolVis); + Volume vesselVol(detName, vesselSolid, vesselMat); + Volume gasvolVol(detName + "_gas", gasvolSolid, gasvolMat); + vesselVol.setVisAttributes(vesselVis); + gasvolVol.setVisAttributes(gasvolVis); - Volume mirrorVol(detName, mirrorSolid, mirrorMat); - mirrorVol.setVisAttributes(mirrorVis); + Volume mirrorVol(detName, mirrorSolid, mirrorMat); + mirrorVol.setVisAttributes(mirrorVis); - // place gas volume - PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0)); - DetElement gasvolDE(sdet, "gasvol_de", 0); - gasvolDE.setPlacement(gasvolPV); + // place gas volume + PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0)); + DetElement gasvolDE(sdet, "gasvol_de", 0); + gasvolDE.setPlacement(gasvolPV); - // BUILD RADIATOR ////////////////////////////////////// + // BUILD RADIATOR ////////////////////////////////////// - // solid and volume: create aerogel and filter - Cone aerogelSolid(aerogelThickness / 2, radiatorRmin + boreDelta * aerogelThickness / vesselLength, /* at backplane */ - radiatorRmax, radiatorRmin, /* at frontplane */ - radiatorRmax); - Cone filterSolid(filterThickness / 2, - radiatorRmin + boreDelta * (aerogelThickness + airgapThickness + filterThickness) / - vesselLength, /* at backplane */ - radiatorRmax, - radiatorRmin + boreDelta * (aerogelThickness + airgapThickness) / vesselLength, /* at frontplane */ - radiatorRmax); - Volume aerogelVol(detName + "_aerogel", aerogelSolid, aerogelMat); - Volume filterVol(detName + "_filter", filterSolid, filterMat); + // solid and volume: create aerogel and filter + Cone aerogelSolid(aerogelThickness / 2, + radiatorRmin + boreDelta * aerogelThickness / vesselLength, /* at backplane */ + radiatorRmax, radiatorRmin, /* at frontplane */ + radiatorRmax); + Cone filterSolid(filterThickness / 2, + radiatorRmin + boreDelta * + (aerogelThickness + airgapThickness + filterThickness) / + vesselLength, /* at backplane */ + radiatorRmax, + radiatorRmin + boreDelta * (aerogelThickness + airgapThickness) / + vesselLength, /* at frontplane */ + radiatorRmax); + Volume aerogelVol(detName + "_aerogel", aerogelSolid, aerogelMat); + Volume filterVol(detName + "_filter", filterSolid, filterMat); - // radiator material names - description.add(Constant("PFRICH_aerogel_material", aerogelMat.ptr()->GetName(), "string")); - description.add(Constant("PFRICH_filter_material", filterMat.ptr()->GetName(), "string")); - description.add(Constant("PFRICH_gasvol_material", gasvolMat.ptr()->GetName(), "string")); + // radiator material names + description.add(Constant("PFRICH_aerogel_material", aerogelMat.ptr()->GetName(), "string")); + description.add(Constant("PFRICH_filter_material", filterMat.ptr()->GetName(), "string")); + description.add(Constant("PFRICH_gasvol_material", gasvolMat.ptr()->GetName(), "string")); - Box sensorSolid(sensorSide / 2., sensorSide / 2., sensorThickness / 2.); - Volume sensorVol(detName + "_sensor", sensorSolid, sensorMat); - sensorVol.setVisAttributes(sensorVis); + Box sensorSolid(sensorSide / 2., sensorSide / 2., sensorThickness / 2.); + Volume sensorVol(detName + "_sensor", sensorSolid, sensorMat); + sensorVol.setVisAttributes(sensorVis); - // -- Mirrors --------------------------------------------------------------------------------- - // Some "standard" value applied to all mirrors; - // At the downstream (sensor plane) location; upstream radii are calculated automatically; - double _CONICAL_MIRROR_INNER_RADIUS_ = 12.0; - double _CONICAL_MIRROR_OUTER_RADIUS_ = 57.0; + // -- Mirrors --------------------------------------------------------------------------------- + // Some "standard" value applied to all mirrors; + // At the downstream (sensor plane) location; upstream radii are calculated automatically; + double _CONICAL_MIRROR_INNER_RADIUS_ = 12.0; + double _CONICAL_MIRROR_OUTER_RADIUS_ = 57.0; - double _INNER_MIRROR_THICKNESS_ = 0.1; //0.29*_INCH - double _OUTER_MIRROR_THICKNESS_ = 0.2; //0.54*_INCH + double _INNER_MIRROR_THICKNESS_ = 0.1; //0.29*_INCH + double _OUTER_MIRROR_THICKNESS_ = 0.2; //0.54*_INCH - /// Detailed sensor description + /// Detailed sensor description - double _FIDUCIAL_VOLUME_LENGTH_ = 49.1; // cm - double _SENSOR_AREA_LENGTH_ = 5; // cm - double _HRPPD_CENTRAL_ROW_OFFSET_ = 4.0; // cm - double _HRPPD_WINDOW_THICKNESS_ = 0.38; // cm - double _HRPPD_CONTAINER_VOLUME_HEIGHT_ = 3.2; // cm - double _HRPPD_INSTALLATION_GAP_ = 0.25; // cm + double _FIDUCIAL_VOLUME_LENGTH_ = 49.1; // cm + double _SENSOR_AREA_LENGTH_ = 5; // cm + double _HRPPD_CENTRAL_ROW_OFFSET_ = 4.0; // cm + double _HRPPD_WINDOW_THICKNESS_ = 0.38; // cm + double _HRPPD_CONTAINER_VOLUME_HEIGHT_ = 3.2; // cm + double _HRPPD_INSTALLATION_GAP_ = 0.25; // cm - double _HRPPD_SUPPORT_GRID_BAR_HEIGHT_ = 0.2; + double _HRPPD_SUPPORT_GRID_BAR_HEIGHT_ = 0.2; - double _HRPPD_TILE_SIZE_ = 12.0; // cm - double _HRPPD_OPEN_AREA_SIZE_ = 11.4; // cm - double _HRPPD_ACTIVE_AREA_SIZE_ = 10.8; // cm - double _HRPPD_CERAMIC_BODY_THICKNESS_ = 0.9; // cm - double _HRPPD_BASEPLATE_THICKNESS_ = 0.3; // cm - double _HRPPD_PLATING_LAYER_THICKNESS_ = 0.006; // cm - double _EFFECTIVE_MCP_THICKNESS_ = 2*0.06*0.3; // cm + double _HRPPD_TILE_SIZE_ = 12.0; // cm + double _HRPPD_OPEN_AREA_SIZE_ = 11.4; // cm + double _HRPPD_ACTIVE_AREA_SIZE_ = 10.8; // cm + double _HRPPD_CERAMIC_BODY_THICKNESS_ = 0.9; // cm + double _HRPPD_BASEPLATE_THICKNESS_ = 0.3; // cm + double _HRPPD_PLATING_LAYER_THICKNESS_ = 0.006; // cm + double _EFFECTIVE_MCP_THICKNESS_ = 2 * 0.06 * 0.3; // cm - double _READOUT_PCB_THICKNESS_ = 0.2; - double _READOUT_PCB_SIZE_ = _HRPPD_OPEN_AREA_SIZE_ - 0.2; + double _READOUT_PCB_THICKNESS_ = 0.2; + double _READOUT_PCB_SIZE_ = _HRPPD_OPEN_AREA_SIZE_ - 0.2; - double _ASIC_SIZE_XY_ = 1.6; - double _ASIC_THICKNESS_ = 0.1; + double _ASIC_SIZE_XY_ = 1.6; + double _ASIC_THICKNESS_ = 0.1; - double xysize = _HRPPD_TILE_SIZE_, wndthick = _HRPPD_WINDOW_THICKNESS_; + double xysize = _HRPPD_TILE_SIZE_, wndthick = _HRPPD_WINDOW_THICKNESS_; - // HRPPD assembly container volume; - double hrppd_container_volume_thickness = _HRPPD_CONTAINER_VOLUME_HEIGHT_; + // HRPPD assembly container volume; + double hrppd_container_volume_thickness = _HRPPD_CONTAINER_VOLUME_HEIGHT_; - double _ACRYLIC_THICKNESS_ = 0.3; + double _ACRYLIC_THICKNESS_ = 0.3; - // HRPPD - Box hrppd_Solid(xysize/2, xysize/2, hrppd_container_volume_thickness/2); + // HRPPD + Box hrppd_Solid(xysize / 2, xysize / 2, hrppd_container_volume_thickness / 2); - Volume hrppdVol_air(detName + "_air_hrppd", hrppd_Solid, air); - Volume hrppdVol(detName + "_hrppd", hrppd_Solid, sensorMat); + Volume hrppdVol_air(detName + "_air_hrppd", hrppd_Solid, air); + Volume hrppdVol(detName + "_hrppd", hrppd_Solid, sensorMat); - hrppdVol_air.setVisAttributes(gasvolVis); - DetElement hrppdDE(sdet, "hrppd_de", 0); + hrppdVol_air.setVisAttributes(gasvolVis); + DetElement hrppdDE(sdet, "hrppd_de", 0); - // Quartz Window - Box wnd_Solid(xysize/2, xysize/2, wndthick/2); + // Quartz Window + Box wnd_Solid(xysize / 2, xysize / 2, wndthick / 2); - Volume wndVol(detName + "_wnd", wnd_Solid, gasvolMat); - wndVol.setVisAttributes(gasvolVis); + Volume wndVol(detName + "_wnd", wnd_Solid, gasvolMat); + wndVol.setVisAttributes(gasvolVis); - double accu = -hrppd_container_volume_thickness/2; + double accu = -hrppd_container_volume_thickness / 2; - PlacedVolume wndPV = hrppdVol_air.placeVolume(wndVol, Position(0, 0, accu + wndthick/2)); + PlacedVolume wndPV = hrppdVol_air.placeVolume(wndVol, Position(0, 0, accu + wndthick / 2)); - DetElement wndDE(hrppdDE, "wnd_de", 0); - wndDE.setPlacement(wndPV); + DetElement wndDE(hrppdDE, "wnd_de", 0); + wndDE.setPlacement(wndPV); - // double pitch = xysize + _HRPPD_INSTALLATION_GAP_; - double xyactive = _HRPPD_ACTIVE_AREA_SIZE_; - double xyopen = _HRPPD_OPEN_AREA_SIZE_; - double certhick = _HRPPD_CERAMIC_BODY_THICKNESS_;//, zcer = azOffset + wndthick + certhick/2; + // double pitch = xysize + _HRPPD_INSTALLATION_GAP_; + double xyactive = _HRPPD_ACTIVE_AREA_SIZE_; + double xyopen = _HRPPD_OPEN_AREA_SIZE_; + double certhick = _HRPPD_CERAMIC_BODY_THICKNESS_; //, zcer = azOffset + wndthick + certhick/2; - accu += wndthick; + accu += wndthick; - // Ceramic body - Box cerbox(xysize/2, xysize/2, certhick/2); - Box cut_box(xyopen/2, xyopen/2, certhick/2); + // Ceramic body + Box cerbox(xysize / 2, xysize / 2, certhick / 2); + Box cut_box(xyopen / 2, xyopen / 2, certhick / 2); - SubtractionSolid ceramic (cerbox, cut_box, Position(0,0, -_HRPPD_BASEPLATE_THICKNESS_)); + SubtractionSolid ceramic(cerbox, cut_box, Position(0, 0, -_HRPPD_BASEPLATE_THICKNESS_)); - Volume ceramicVol(detName + "_ceramic", ceramic, air); - ceramicVol.setVisAttributes(gasvolVis); + Volume ceramicVol(detName + "_ceramic", ceramic, air); + ceramicVol.setVisAttributes(gasvolVis); - PlacedVolume ceramicPV = hrppdVol_air.placeVolume(ceramicVol, Position(0.0, 0.0, accu + certhick/2)); - DetElement ceramicDE(sdet, "ceramic_de", 0); - ceramicDE.setPlacement(ceramicPV); + PlacedVolume ceramicPV = + hrppdVol_air.placeVolume(ceramicVol, Position(0.0, 0.0, accu + certhick / 2)); + DetElement ceramicDE(sdet, "ceramic_de", 0); + ceramicDE.setPlacement(ceramicPV); - // Plating body + // Plating body - Box plating_solid(xyopen/2, xyopen/2, _HRPPD_PLATING_LAYER_THICKNESS_/2); - Volume platingVol( detName + "_plating", plating_solid, air); + Box plating_solid(xyopen / 2, xyopen / 2, _HRPPD_PLATING_LAYER_THICKNESS_ / 2); + Volume platingVol(detName + "_plating", plating_solid, air); - platingVol.setVisAttributes(gasvolVis); - PlacedVolume platingPV = hrppdVol_air.placeVolume(platingVol, Position(0.0, 0.0, accu + certhick/2)); - DetElement platingDE(sdet, "plating_de", 0); - platingDE.setPlacement(platingPV); + platingVol.setVisAttributes(gasvolVis); + PlacedVolume platingPV = + hrppdVol_air.placeVolume(platingVol, Position(0.0, 0.0, accu + certhick / 2)); + DetElement platingDE(sdet, "plating_de", 0); + platingDE.setPlacement(platingPV); - // MCP body + // MCP body - Box mcp_solid( xyopen/2, xyopen/2, _EFFECTIVE_MCP_THICKNESS_/2); - Volume mcpVol( detName + "_mcp", mcp_solid, air); + Box mcp_solid(xyopen / 2, xyopen / 2, _EFFECTIVE_MCP_THICKNESS_ / 2); + Volume mcpVol(detName + "_mcp", mcp_solid, air); - mcpVol.setVisAttributes(gasvolVis); - PlacedVolume mcpPV = hrppdVol_air.placeVolume(mcpVol, Position(0.0, 0.0, accu + certhick/2 + - _HRPPD_PLATING_LAYER_THICKNESS_/2 + _EFFECTIVE_MCP_THICKNESS_/2)); - DetElement mcpDE(sdet, "mcp_de", 0); - mcpDE.setPlacement(mcpPV); + mcpVol.setVisAttributes(gasvolVis); + PlacedVolume mcpPV = hrppdVol_air.placeVolume( + mcpVol, Position(0.0, 0.0, + accu + certhick / 2 + _HRPPD_PLATING_LAYER_THICKNESS_ / 2 + + _EFFECTIVE_MCP_THICKNESS_ / 2)); + DetElement mcpDE(sdet, "mcp_de", 0); + mcpDE.setPlacement(mcpPV); - double pdthick = 0.001; + double pdthick = 0.001; - Box pdbox_solid(xyactive/2, xyactive/2, pdthick/2); - Volume pdboxVol( detName + "_pd", pdbox_solid, air); + Box pdbox_solid(xyactive / 2, xyactive / 2, pdthick / 2); + Volume pdboxVol(detName + "_pd", pdbox_solid, air); - pdboxVol.setVisAttributes(gasvolVis); - PlacedVolume pdboxPV = hrppdVol_air.placeVolume(pdboxVol, Position(0.0, 0.0, accu + pdthick + pdthick/2)); + pdboxVol.setVisAttributes(gasvolVis); + PlacedVolume pdboxPV = + hrppdVol_air.placeVolume(pdboxVol, Position(0.0, 0.0, accu + pdthick + pdthick / 2)); - DetElement pdboxDE(sdet, "pdbox_de", 0); - pdboxDE.setPlacement(pdboxPV); + DetElement pdboxDE(sdet, "pdbox_de", 0); + pdboxDE.setPlacement(pdboxPV); - Box qdbox_solid(xyactive/2, xyactive/2, pdthick/2); - Volume qdboxVol( detName + "_qd", qdbox_solid, air); + Box qdbox_solid(xyactive / 2, xyactive / 2, pdthick / 2); + Volume qdboxVol(detName + "_qd", qdbox_solid, air); - qdboxVol.setVisAttributes(gasvolVis); - PlacedVolume qdboxPV = hrppdVol_air.placeVolume(qdboxVol, Position(0.0, 0.0, accu + pdthick/2)); + qdboxVol.setVisAttributes(gasvolVis); + PlacedVolume qdboxPV = hrppdVol_air.placeVolume(qdboxVol, Position(0.0, 0.0, accu + pdthick / 2)); - DetElement qdboxDE(sdet, "qdbox_de", 0); - pdboxDE.setPlacement(qdboxPV); + DetElement qdboxDE(sdet, "qdbox_de", 0); + pdboxDE.setPlacement(qdboxPV); - accu += certhick + 1*mm; + accu += certhick + 1 * mm; - /// PCB Board + /// PCB Board - Box pcb_solid (_READOUT_PCB_SIZE_/2, _READOUT_PCB_SIZE_/2, _READOUT_PCB_THICKNESS_/2); - Volume pcbVol( detName + "_pcb", pcb_solid, air); + Box pcb_solid(_READOUT_PCB_SIZE_ / 2, _READOUT_PCB_SIZE_ / 2, _READOUT_PCB_THICKNESS_ / 2); + Volume pcbVol(detName + "_pcb", pcb_solid, air); - pcbVol.setVisAttributes(gasvolVis); - PlacedVolume pcbPV = hrppdVol_air.placeVolume(pcbVol, Position(0.0, 0.0, accu + _READOUT_PCB_THICKNESS_ /2)); + pcbVol.setVisAttributes(gasvolVis); + PlacedVolume pcbPV = + hrppdVol_air.placeVolume(pcbVol, Position(0.0, 0.0, accu + _READOUT_PCB_THICKNESS_ / 2)); - DetElement pcbDE(sdet, "pcb_de", 0); - pcbDE.setPlacement(pcbPV); + DetElement pcbDE(sdet, "pcb_de", 0); + pcbDE.setPlacement(pcbPV); - accu += _READOUT_PCB_THICKNESS_ + 0.001; + accu += _READOUT_PCB_THICKNESS_ + 0.001; - // ASIC Board + // ASIC Board - Box asic_solid( _ASIC_SIZE_XY_/2, _ASIC_SIZE_XY_/2, _ASIC_THICKNESS_/2); - Volume asicVol( detName + "_asic", asic_solid, mirrorMat); - asicVol.setVisAttributes(mirrorVis); + Box asic_solid(_ASIC_SIZE_XY_ / 2, _ASIC_SIZE_XY_ / 2, _ASIC_THICKNESS_ / 2); + Volume asicVol(detName + "_asic", asic_solid, mirrorMat); + asicVol.setVisAttributes(mirrorVis); - double asic_pitch = _READOUT_PCB_SIZE_/2; + double asic_pitch = _READOUT_PCB_SIZE_ / 2; - imod = 0; + imod = 0; - for(unsigned ix=0; ix<2; ix++) { - double xOffset = asic_pitch*(ix - (2-1)/2.); + for (unsigned ix = 0; ix < 2; ix++) { + double xOffset = asic_pitch * (ix - (2 - 1) / 2.); - for(unsigned iy=0; iy<2; iy++) { - double yOffset = asic_pitch*(iy - (2-1)/2.); + for (unsigned iy = 0; iy < 2; iy++) { + double yOffset = asic_pitch * (iy - (2 - 1) / 2.); - auto asicPV = hrppdVol_air.placeVolume(asicVol, Position(xOffset, yOffset, accu + _ASIC_THICKNESS_/2)); + auto asicPV = hrppdVol_air.placeVolume( + asicVol, Position(xOffset, yOffset, accu + _ASIC_THICKNESS_ / 2)); - DetElement asicDE(sdet, "asic_de_" + std::to_string(imod), 0); - asicDE.setPlacement(asicPV); + DetElement asicDE(sdet, "asic_de_" + std::to_string(imod), 0); + asicDE.setPlacement(asicPV); - imod++; + imod++; - } //for iy - } //for ix + } //for iy + } //for ix - accu += _ASIC_THICKNESS_ + 0.01*mm; + accu += _ASIC_THICKNESS_ + 0.01 * mm; - // Loading the coordinates + // Loading the coordinates - unsigned const hdim = 9; - const unsigned flags[hdim][hdim] = { - // NB: WYSIWIG fashion; well, it is top/ bottom and left/right symmetric; - {0, 0, 1, 1, 1, 1, 1, 0, 0}, - {0, 1, 1, 1, 1, 1, 1, 1, 0}, - {1, 1, 1, 1, 1, 1, 1, 1, 1}, - {1, 1, 1, 1, 2, 1, 1, 1, 1}, - {3, 3, 3, 4, 0, 2, 1, 1, 1}, - {1, 1, 1, 1, 2, 1, 1, 1, 1}, - {1, 1, 1, 1, 1, 1, 1, 1, 1}, - {0, 1, 1, 1, 1, 1, 1, 1, 0}, - {0, 0, 1, 1, 1, 1, 1, 0, 0} - }; + unsigned const hdim = 9; + const unsigned flags[hdim][hdim] = { + // NB: WYSIWIG fashion; well, it is top/ bottom and left/right symmetric; + {0, 0, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 1}, + {1, 1, 1, 1, 2, 1, 1, 1, 1}, {3, 3, 3, 4, 0, 2, 1, 1, 1}, {1, 1, 1, 1, 2, 1, 1, 1, 1}, + {1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 0, 0}}; - std::vector<std::pair<TVector2, bool>> coord; + std::vector<std::pair<TVector2, bool>> coord; - for(unsigned ix=0; ix<hdim; ix++) { - double xOffset = (_HRPPD_TILE_SIZE_ + _HRPPD_INSTALLATION_GAP_)*(ix - (hdim-1)/2.); + for (unsigned ix = 0; ix < hdim; ix++) { + double xOffset = (_HRPPD_TILE_SIZE_ + _HRPPD_INSTALLATION_GAP_) * (ix - (hdim - 1) / 2.); - for(unsigned iy=0; iy<hdim; iy++) { - double yOffset = (_HRPPD_TILE_SIZE_ + _HRPPD_INSTALLATION_GAP_)*(iy - (hdim-1)/2.); - unsigned flag = flags[hdim-iy-1][ix]; + for (unsigned iy = 0; iy < hdim; iy++) { + double yOffset = (_HRPPD_TILE_SIZE_ + _HRPPD_INSTALLATION_GAP_) * (iy - (hdim - 1) / 2.); + unsigned flag = flags[hdim - iy - 1][ix]; - if (!flag) continue; + if (!flag) + continue; - double qxOffset = xOffset + (flag >= 3 ? -_HRPPD_CENTRAL_ROW_OFFSET_ : 0.0); - coord.push_back(std::make_pair(TVector2(qxOffset, yOffset), flag%2)); - } //for iy - } //for ix + double qxOffset = xOffset + (flag >= 3 ? -_HRPPD_CENTRAL_ROW_OFFSET_ : 0.0); + coord.push_back(std::make_pair(TVector2(qxOffset, yOffset), flag % 2)); + } //for iy + } //for ix - /// Set sensors into the coordinates - /// - for(auto xyptr: coord) { - auto &xy = xyptr.first; + /// Set sensors into the coordinates + /// + for (auto xyptr : coord) { + auto& xy = xyptr.first; - double sx = xy.X(); - double sy = xy.Y(); + double sx = xy.X(); + double sy = xy.Y(); - // placement (note: transformations are in reverse order) - auto sensorPlacement = Transform3D( - Translation3D(sensorPlanePos.x(), sensorPlanePos.y(), sensorPlanePos.z() + 34) * // move to reference position - Translation3D(sx, sy, 0.) // move to grid position - ); + // placement (note: transformations are in reverse order) + auto sensorPlacement = + Transform3D(Translation3D(sensorPlanePos.x(), sensorPlanePos.y(), + sensorPlanePos.z() + 34) * // move to reference position + Translation3D(sx, sy, 0.) // move to grid position + ); - auto sensorPV = pfRICH_volume.placeVolume(hrppdVol_air, sensorPlacement); + auto sensorPV = pfRICH_volume.placeVolume(hrppdVol_air, sensorPlacement); - // properties - sensorPV.addPhysVolID("module", imod); // NOTE: must be consistent with `sensorIDfields` - auto imodEnc = encodeSensorID(sensorPV.volIDs()); - DetElement sensorDE(sdet, "sensor_de_" + std::to_string(imod), imodEnc); - sensorDE.setPlacement(sensorPV); - if (!debug_optics) { - SkinSurface sensorSkin(description, sensorDE, "sensor_optical_surface_" + std::to_string(imod), sensorSurf, - sensorVol); - sensorSkin.isValid(); - }; - - // increment sensor module number - imod++; + // properties + sensorPV.addPhysVolID("module", imod); // NOTE: must be consistent with `sensorIDfields` + auto imodEnc = encodeSensorID(sensorPV.volIDs()); + DetElement sensorDE(sdet, "sensor_de_" + std::to_string(imod), imodEnc); + sensorDE.setPlacement(sensorPV); + if (!debug_optics) { + SkinSurface sensorSkin(description, sensorDE, + "sensor_optical_surface_" + std::to_string(imod), sensorSurf, + sensorVol); + sensorSkin.isValid(); + }; - } + // increment sensor module number + imod++; + } /// Aerogel - float _AEROGEL_INNER_WALL_THICKNESS_ = 0.01; - - float _VESSEL_INNER_WALL_THICKNESS_ = 0.29 * 2.54; - - float _VESSEL_OUTER_WALL_THICKNESS_ = 0.54 * 2.54;; + float _AEROGEL_INNER_WALL_THICKNESS_ = 0.01; - float _VESSEL_OUTER_RADIUS_ = 63.8; + float _VESSEL_INNER_WALL_THICKNESS_ = 0.29 * 2.54; - double _VESSEL_FRONT_SIDE_THICKNESS_ = 0.29*2.54; + float _VESSEL_OUTER_WALL_THICKNESS_ = 0.54 * 2.54; + ; - double m_gas_volume_length = _FIDUCIAL_VOLUME_LENGTH_ - _VESSEL_FRONT_SIDE_THICKNESS_ - _SENSOR_AREA_LENGTH_; - double m_gas_volume_radius = _VESSEL_OUTER_RADIUS_ - _VESSEL_OUTER_WALL_THICKNESS_; + float _VESSEL_OUTER_RADIUS_ = 63.8; - float _FLANGE_CLEARANCE_ = 0.5; - float _BUILDING_BLOCK_CLEARANCE_ = 0.1; + double _VESSEL_FRONT_SIDE_THICKNESS_ = 0.29 * 2.54; - const int _AEROGEL_BAND_COUNT_ = 3; + double m_gas_volume_length = + _FIDUCIAL_VOLUME_LENGTH_ - _VESSEL_FRONT_SIDE_THICKNESS_ - _SENSOR_AREA_LENGTH_; + double m_gas_volume_radius = _VESSEL_OUTER_RADIUS_ - _VESSEL_OUTER_WALL_THICKNESS_; - float _AEROGEL_SEPARATOR_WALL_THICKNESS_ = 0.05; + float _FLANGE_CLEARANCE_ = 0.5; + float _BUILDING_BLOCK_CLEARANCE_ = 0.1; - float _AEROGEL_OUTER_WALL_THICKNESS_ = 0.1; + const int _AEROGEL_BAND_COUNT_ = 3; - float m_r0min = _FLANGE_EPIPE_DIAMETER_/2 + _FLANGE_CLEARANCE_ + _VESSEL_INNER_WALL_THICKNESS_ + _BUILDING_BLOCK_CLEARANCE_; - float m_r0max = m_gas_volume_radius - _BUILDING_BLOCK_CLEARANCE_; + float _AEROGEL_SEPARATOR_WALL_THICKNESS_ = 0.05; - const unsigned adim[_AEROGEL_BAND_COUNT_] = {9, 14, 20}; - double rheight = (m_r0max - m_r0min - (_AEROGEL_BAND_COUNT_-1)*_AEROGEL_SEPARATOR_WALL_THICKNESS_ - - _AEROGEL_INNER_WALL_THICKNESS_ - _AEROGEL_OUTER_WALL_THICKNESS_) / _AEROGEL_BAND_COUNT_; + float _AEROGEL_OUTER_WALL_THICKNESS_ = 0.1; - double agthick = 2.5; // cm + float m_r0min = _FLANGE_EPIPE_DIAMETER_ / 2 + _FLANGE_CLEARANCE_ + _VESSEL_INNER_WALL_THICKNESS_ + + _BUILDING_BLOCK_CLEARANCE_; + float m_r0max = m_gas_volume_radius - _BUILDING_BLOCK_CLEARANCE_; - double m_gzOffset = m_gas_volume_length/2 + _BUILDING_BLOCK_CLEARANCE_ + agthick/2; + const unsigned adim[_AEROGEL_BAND_COUNT_] = {9, 14, 20}; + double rheight = + (m_r0max - m_r0min - (_AEROGEL_BAND_COUNT_ - 1) * _AEROGEL_SEPARATOR_WALL_THICKNESS_ - + _AEROGEL_INNER_WALL_THICKNESS_ - _AEROGEL_OUTER_WALL_THICKNESS_) / + _AEROGEL_BAND_COUNT_; - string aerogel_name = "a1040"; + double agthick = 2.5; // cm - int kkcounter = 0; + double m_gzOffset = m_gas_volume_length / 2 + _BUILDING_BLOCK_CLEARANCE_ + agthick / 2; - for(unsigned ir=0; ir<_AEROGEL_BAND_COUNT_; ir++) { - int counter = ir ? -1 : 0; - double apitch = 360*degree / adim[ir]; - double aerogel_r0 = m_r0min + _AEROGEL_INNER_WALL_THICKNESS_ + ir*(_AEROGEL_SEPARATOR_WALL_THICKNESS_ + rheight); - double aerogel_r1 = aerogel_r0 + rheight; - double rm = (aerogel_r0+aerogel_r1)/2; + string aerogel_name = "a1040"; - // Calculate angular space occupied by the spacers and by the tiles; no gas gaps for now; - // assume that a wegde shape is good enough (GEANT visualization does not like boolean objects), - // rather than creating constant thicjkess azimuthal spacers; just assume that spacer thickness is - // _AEROGEL_FRAME_WALL_THICKNESS_ at r=rm; - double l0 = 2*M_PI*rm/adim[ir]; - double l1 = _AEROGEL_SEPARATOR_WALL_THICKNESS_; - double lsum = l0 + l1; + int kkcounter = 0; - // FIXME: names overlap in several places!; - double wd0 = (l0/lsum)*(360*degree / adim[ir]); - double wd1 = (l1/lsum)*(360*degree / adim[ir]); - TString ag_name = "Tmp", sp_name = "Tmp"; + for (unsigned ir = 0; ir < _AEROGEL_BAND_COUNT_; ir++) { + int counter = ir ? -1 : 0; + double apitch = 360 * degree / adim[ir]; + double aerogel_r0 = m_r0min + _AEROGEL_INNER_WALL_THICKNESS_ + + ir * (_AEROGEL_SEPARATOR_WALL_THICKNESS_ + rheight); + double aerogel_r1 = aerogel_r0 + rheight; + double rm = (aerogel_r0 + aerogel_r1) / 2; - if (ir) ag_name.Form("%s-%d-00", aerogel_name.c_str(), ir); - if (ir) sp_name.Form("A-Spacer--%d-00", ir); + // Calculate angular space occupied by the spacers and by the tiles; no gas gaps for now; + // assume that a wegde shape is good enough (GEANT visualization does not like boolean objects), + // rather than creating constant thicjkess azimuthal spacers; just assume that spacer thickness is + // _AEROGEL_FRAME_WALL_THICKNESS_ at r=rm; + double l0 = 2 * M_PI * rm / adim[ir]; + double l1 = _AEROGEL_SEPARATOR_WALL_THICKNESS_; + double lsum = l0 + l1; - Tube agtube(aerogel_r0, aerogel_r1, agthick/2, 0*degree, wd0); - Tube sptube(aerogel_r0, aerogel_r1, agthick/2, wd0, wd0 + wd1); + // FIXME: names overlap in several places!; + double wd0 = (l0 / lsum) * (360 * degree / adim[ir]); + double wd1 = (l1 / lsum) * (360 * degree / adim[ir]); + TString ag_name = "Tmp", sp_name = "Tmp"; - for(unsigned ia=0; ia<adim[ir]; ia++) { + if (ir) + ag_name.Form("%s-%d-00", aerogel_name.c_str(), ir); + if (ir) + sp_name.Form("A-Spacer--%d-00", ir); - Rotation3D r_aerogel_Z(RotationZYX(ia*apitch, 0.0, 0.0)); - Rotation3D r_aerogel_Zinv(RotationZYX(-1.*ia*apitch, 0.0, 0.0)); + Tube agtube(aerogel_r0, aerogel_r1, agthick / 2, 0 * degree, wd0); + Tube sptube(aerogel_r0, aerogel_r1, agthick / 2, wd0, wd0 + wd1); - if (ir) { - ag_name.Form("%s-%d-%02d", "aerogel", ir, ia); + for (unsigned ia = 0; ia < adim[ir]; ia++) { - Volume agtubeVol(ag_name.Data(), agtube, gasvolMat); - auto aerogelTilePlacement = Transform3D(r_aerogel_Z, Position(0.0, 0.0, -m_gzOffset)); - auto aerogelTilePV = pfRICH_volume.placeVolume(agtubeVol, aerogelTilePlacement); - DetElement aerogelDE(sdet, "aerogel_de_" + std::to_string(kkcounter), 0); - aerogelDE.setPlacement(aerogelTilePV); + Rotation3D r_aerogel_Z(RotationZYX(ia * apitch, 0.0, 0.0)); + Rotation3D r_aerogel_Zinv(RotationZYX(-1. * ia * apitch, 0.0, 0.0)); - Volume sptubeVol(detName + "_sptube", sptube, mirrorMat); - auto sptubePlacement = Transform3D(r_aerogel_Z, Position(0.0, 0.0, -m_gzOffset)); - auto sptubePV = pfRICH_volume.placeVolume(sptubeVol, sptubePlacement); - DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(kkcounter), 0); - sptubeDE.setPlacement(sptubePV); + if (ir) { + ag_name.Form("%s-%d-%02d", "aerogel", ir, ia); - } else { + Volume agtubeVol(ag_name.Data(), agtube, gasvolMat); + auto aerogelTilePlacement = Transform3D(r_aerogel_Z, Position(0.0, 0.0, -m_gzOffset)); + auto aerogelTilePV = pfRICH_volume.placeVolume(agtubeVol, aerogelTilePlacement); + DetElement aerogelDE(sdet, "aerogel_de_" + std::to_string(kkcounter), 0); + aerogelDE.setPlacement(aerogelTilePV); - ag_name.Form("%s-%d-%02d", "aerogel_inner", ir, ia); + Volume sptubeVol(detName + "_sptube", sptube, mirrorMat); + auto sptubePlacement = Transform3D(r_aerogel_Z, Position(0.0, 0.0, -m_gzOffset)); + auto sptubePV = pfRICH_volume.placeVolume(sptubeVol, sptubePlacement); + DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(kkcounter), 0); + sptubeDE.setPlacement(sptubePV); - Tube agtube_inner(aerogel_r0, aerogel_r1, agthick/2, 0*degree + ia*apitch, wd0 + ia*apitch); - SubtractionSolid agsub (agtube_inner, flange_final_shape); - Volume agsubtubeVol(ag_name.Data(), agsub, gasvolMat); - auto aerogelTilePlacement = Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); - auto agsubTilePV = pfRICH_volume.placeVolume(agsubtubeVol, aerogelTilePlacement); + } else { - DetElement aerogelDE(sdet, "agsubTile_de_" + std::to_string(counter), 0); - aerogelDE.setPlacement(agsubTilePV); + ag_name.Form("%s-%d-%02d", "aerogel_inner", ir, ia); - sp_name.Form("%s-%d-%02d", "sp_inner", ir, ia); - Tube sptube_inner(aerogel_r0, aerogel_r1, agthick/2, wd0 + ia*apitch, wd0+wd1 + ia*apitch); + Tube agtube_inner(aerogel_r0, aerogel_r1, agthick / 2, 0 * degree + ia * apitch, + wd0 + ia * apitch); + SubtractionSolid agsub(agtube_inner, flange_final_shape); + Volume agsubtubeVol(ag_name.Data(), agsub, gasvolMat); + auto aerogelTilePlacement = + Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); + auto agsubTilePV = pfRICH_volume.placeVolume(agsubtubeVol, aerogelTilePlacement); - SubtractionSolid spsub (sptube_inner, flange_final_shape); - Volume spsubtubeVol(sp_name.Data(), spsub, mirrorMat); - auto spTilePlacement = Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); - auto spsubTilePV = pfRICH_volume.placeVolume(spsubtubeVol, spTilePlacement); + DetElement aerogelDE(sdet, "agsubTile_de_" + std::to_string(counter), 0); + aerogelDE.setPlacement(agsubTilePV); - DetElement sptubeTileDE(sdet, "sptubeTile_de_" + std::to_string(counter), 0); - sptubeTileDE.setPlacement(spsubTilePV); + sp_name.Form("%s-%d-%02d", "sp_inner", ir, ia); + Tube sptube_inner(aerogel_r0, aerogel_r1, agthick / 2, wd0 + ia * apitch, + wd0 + wd1 + ia * apitch); - sp_name.Form("A-Spacer--%d-%02d", ir, ia); + SubtractionSolid spsub(sptube_inner, flange_final_shape); + Volume spsubtubeVol(sp_name.Data(), spsub, mirrorMat); + auto spTilePlacement = + Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); + auto spsubTilePV = pfRICH_volume.placeVolume(spsubtubeVol, spTilePlacement); - } //if + DetElement sptubeTileDE(sdet, "sptubeTile_de_" + std::to_string(counter), 0); + sptubeTileDE.setPlacement(spsubTilePV); - counter++; - kkcounter++; + sp_name.Form("A-Spacer--%d-%02d", ir, ia); - } //for ia - } // for ir + } //if - // Placing radial spacer + counter++; + kkcounter++; - double sp_accu = m_r0min; - int tube_counter = 0; + } //for ia + } // for ir - for(unsigned ir=0; ir<_AEROGEL_BAND_COUNT_+1; ir++) { - double thickness = ir ? (ir == _AEROGEL_BAND_COUNT_ ? _AEROGEL_OUTER_WALL_THICKNESS_ : - _AEROGEL_SEPARATOR_WALL_THICKNESS_) : _AEROGEL_INNER_WALL_THICKNESS_; - double sp_r0 = sp_accu; - double sp_r1 = sp_r0 + thickness; + // Placing radial spacer - TString sp_name = "Tmp"; if (ir) sp_name.Form("R-Spacer--%d-00", ir); + double sp_accu = m_r0min; + int tube_counter = 0; - Tube sptube(sp_r0, sp_r1, agthick/2, 0*degree, 360*degree); - Volume sptubeVol(detName + "_radial_sptube", sptube, sensorMat); - auto sptubePlacement = Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); + for (unsigned ir = 0; ir < _AEROGEL_BAND_COUNT_ + 1; ir++) { + double thickness = ir ? (ir == _AEROGEL_BAND_COUNT_ ? _AEROGEL_OUTER_WALL_THICKNESS_ + : _AEROGEL_SEPARATOR_WALL_THICKNESS_) + : _AEROGEL_INNER_WALL_THICKNESS_; + double sp_r0 = sp_accu; + double sp_r1 = sp_r0 + thickness; - if (ir) { + TString sp_name = "Tmp"; + if (ir) + sp_name.Form("R-Spacer--%d-00", ir); - auto sptubePV = pfRICH_volume.placeVolume(sptubeVol, sptubePlacement); + Tube sptube(sp_r0, sp_r1, agthick / 2, 0 * degree, 360 * degree); + Volume sptubeVol(detName + "_radial_sptube", sptube, sensorMat); + auto sptubePlacement = Transform3D(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, -m_gzOffset)); - DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(tube_counter), 0); - sptubeDE.setPlacement(sptubePV); + if (ir) { - } + auto sptubePV = pfRICH_volume.placeVolume(sptubeVol, sptubePlacement); - else { + DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(tube_counter), 0); + sptubeDE.setPlacement(sptubePV); - SubtractionSolid spsub (sptube, flange_final_shape); - Volume agsubtubeVol(detName + "_radial_sptube_inner", spsub, gasvolMat); - - auto sptubePV = pfRICH_volume.placeVolume(agsubtubeVol, sptubePlacement); + } - DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(tube_counter), 0); - sptubeDE.setPlacement(sptubePV); + else { - } //if + SubtractionSolid spsub(sptube, flange_final_shape); + Volume agsubtubeVol(detName + "_radial_sptube_inner", spsub, gasvolMat); - sp_accu += thickness + rheight; + auto sptubePV = pfRICH_volume.placeVolume(agsubtubeVol, sptubePlacement); - tube_counter++; + DetElement sptubeDE(sdet, "sptube_de_" + std::to_string(tube_counter), 0); + sptubeDE.setPlacement(sptubePV); - } //for ir + } //if - /// Mirror construction + sp_accu += thickness + rheight; - double mlen = m_gas_volume_length - _BUILDING_BLOCK_CLEARANCE_; + tube_counter++; - mlen -= _BUILDING_BLOCK_CLEARANCE_ + _HRPPD_SUPPORT_GRID_BAR_HEIGHT_; + } //for ir - double mirror_r0[2] = {m_r0min, m_r0max}; - double mirror_r1[2] = {_CONICAL_MIRROR_INNER_RADIUS_, _CONICAL_MIRROR_OUTER_RADIUS_}; + /// Mirror construction - for(unsigned im=0; im<2; im++) { + double mlen = m_gas_volume_length - _BUILDING_BLOCK_CLEARANCE_; - double mirror_thickness = im ? _OUTER_MIRROR_THICKNESS_ : _INNER_MIRROR_THICKNESS_; + mlen -= _BUILDING_BLOCK_CLEARANCE_ + _HRPPD_SUPPORT_GRID_BAR_HEIGHT_; - if (im) { + double mirror_r0[2] = {m_r0min, m_r0max}; + double mirror_r1[2] = {_CONICAL_MIRROR_INNER_RADIUS_, _CONICAL_MIRROR_OUTER_RADIUS_}; - Cone mirror_outer_cone_shape(mlen/2.0, mirror_r0[im], mirror_r0[im] + mirror_thickness, mirror_r1[im], mirror_r1[im] + mirror_thickness); + for (unsigned im = 0; im < 2; im++) { - Volume outer_mirrorVol(detName +"_outer_mirror", mirror_outer_cone_shape, mirrorMat); + double mirror_thickness = im ? _OUTER_MIRROR_THICKNESS_ : _INNER_MIRROR_THICKNESS_; - PlacedVolume mirror_outerPV = pfRICH_volume.placeVolume(outer_mirrorVol, Position(0, 0, 0)); + if (im) { - DetElement mirror_outerDE(sdet, "_outer_mirror_de" , 0); - mirror_outerDE.setPlacement(mirror_outerPV); + Cone mirror_outer_cone_shape(mlen / 2.0, mirror_r0[im], mirror_r0[im] + mirror_thickness, + mirror_r1[im], mirror_r1[im] + mirror_thickness); - } else { + Volume outer_mirrorVol(detName + "_outer_mirror", mirror_outer_cone_shape, mirrorMat); - Cone mirror_inner_cone_shape(mlen/2., mirror_r0[im], mirror_r0[im] + mirror_thickness, mirror_r1[im], mirror_r1[im] + mirror_thickness); + PlacedVolume mirror_outerPV = pfRICH_volume.placeVolume(outer_mirrorVol, Position(0, 0, 0)); - SubtractionSolid mirror_inner_sub (mirror_inner_cone_shape, flange_final_shape); + DetElement mirror_outerDE(sdet, "_outer_mirror_de", 0); + mirror_outerDE.setPlacement(mirror_outerPV); + } else { - Volume inner_mirrorVol(detName +"_inner_mirror", mirror_inner_sub, mirrorMat); + Cone mirror_inner_cone_shape(mlen / 2., mirror_r0[im], mirror_r0[im] + mirror_thickness, + mirror_r1[im], mirror_r1[im] + mirror_thickness); - PlacedVolume mirror_innerPV = pfRICH_volume.placeVolume(inner_mirrorVol, Position(0, 0, 0)); + SubtractionSolid mirror_inner_sub(mirror_inner_cone_shape, flange_final_shape); - DetElement mirror_innerDE(sdet, "_inner_mirror_de" , 0); - mirror_innerDE.setPlacement(mirror_innerPV); + Volume inner_mirrorVol(detName + "_inner_mirror", mirror_inner_sub, mirrorMat); - } + PlacedVolume mirror_innerPV = pfRICH_volume.placeVolume(inner_mirrorVol, Position(0, 0, 0)); - } //for im + DetElement mirror_innerDE(sdet, "_inner_mirror_de", 0); + mirror_innerDE.setPlacement(mirror_innerPV); + } - // Acrylic filter + } //for im - double acthick = _ACRYLIC_THICKNESS_; - // m_gzOffset += acthick/2; + // Acrylic filter - Tube ac_tube(m_r0min+3, m_r0max-1, acthick/2, 0*degree, 360*degree); - SubtractionSolid ac_shape(ac_tube, flange_final_shape); + double acthick = _ACRYLIC_THICKNESS_; + // m_gzOffset += acthick/2; - Volume acVol(detName +"_ac", ac_shape, gasvolMat); + Tube ac_tube(m_r0min + 3, m_r0max - 1, acthick / 2, 0 * degree, 360 * degree); + SubtractionSolid ac_shape(ac_tube, flange_final_shape); - PlacedVolume ac_PV = pfRICH_volume.placeVolume(acVol, Position(0, 0, -21.3)); + Volume acVol(detName + "_ac", ac_shape, gasvolMat); - DetElement acDE(sdet, "ac_de" , 0); - acDE.setPlacement(ac_PV); + PlacedVolume ac_PV = pfRICH_volume.placeVolume(acVol, Position(0, 0, -21.3)); - return sdet; + DetElement acDE(sdet, "ac_de", 0); + acDE.setPlacement(ac_PV); + return sdet; } // clang-format off diff --git a/src/PolyhedraEndcapCalorimeter2_geo.cpp b/src/PolyhedraEndcapCalorimeter2_geo.cpp index fdd65aa3e..546b84278 100644 --- a/src/PolyhedraEndcapCalorimeter2_geo.cpp +++ b/src/PolyhedraEndcapCalorimeter2_geo.cpp @@ -24,32 +24,31 @@ using namespace std; using namespace dd4hep; using namespace dd4hep::detail; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - xml_dim_t dim = x_det.dimensions(); - int det_id = x_det.id(); - bool reflect = x_det.reflect(true); - string det_name = x_det.nameStr(); - Material air = description.air(); - int numsides = dim.numsides(); - xml::Component pos = x_det.position(); - double rmin = dim.rmin(); - double rmax = dim.rmax(); - double zmin = dim.zmin(); - Layering layering(x_det); - double totalThickness = layering.totalThickness(); - Volume endcapVol("endcap", PolyhedraRegular(numsides, rmin, rmax, totalThickness), air); - DetElement endcap("endcap", det_id); +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { + xml_det_t x_det = e; + xml_dim_t dim = x_det.dimensions(); + int det_id = x_det.id(); + bool reflect = x_det.reflect(true); + string det_name = x_det.nameStr(); + Material air = description.air(); + int numsides = dim.numsides(); + xml::Component pos = x_det.position(); + double rmin = dim.rmin(); + double rmax = dim.rmax(); + double zmin = dim.zmin(); + Layering layering(x_det); + double totalThickness = layering.totalThickness(); + Volume endcapVol("endcap", PolyhedraRegular(numsides, rmin, rmax, totalThickness), air); + DetElement endcap("endcap", det_id); // std::cout << "totalThickness = " << totalThickness << "\n"; // std::cout << "zmin = " << zmin << "\n"; // std::cout << "rmin = " << rmin << "\n"; // std::cout << "rmax = " << rmax << "\n"; // std::cout << "nlayers = " << std::size(layering.layers()) << "\n"; - int l_num = 1; - int layerType = 0; - double layerZ = -totalThickness / 2; + int l_num = 1; + int layerType = 0; + double layerZ = -totalThickness / 2; endcapVol.setAttributes(description, x_det.regionStr(), x_det.limitsStr(), x_det.visStr()); @@ -57,21 +56,21 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s // std::cout << "l_num = " << l_num << "\n"; // std::cout << "xc = " << xc << "\n"; xml_comp_t x_layer = xc; - double l_thick = layering.layer(l_num - 1)->thickness(); + double l_thick = layering.layer(l_num - 1)->thickness(); // std::cout << "xc = " << xc << "\n"; - string l_name = _toString(layerType, "layer%d"); - int l_repeat = x_layer.repeat(); - Volume l_vol(l_name, PolyhedraRegular(numsides, rmin, rmax, l_thick), air); + string l_name = _toString(layerType, "layer%d"); + int l_repeat = x_layer.repeat(); + Volume l_vol(l_name, PolyhedraRegular(numsides, rmin, rmax, l_thick), air); vector<PlacedVolume> sensitives; - int s_num = 1; + int s_num = 1; double sliceZ = -l_thick / 2; for (xml_coll_t xs(x_layer, _U(slice)); xs; ++xs) { xml_comp_t x_slice = xs; - string s_name = _toString(s_num, "slice%d"); - double s_thick = x_slice.thickness(); - Material s_mat = description.material(x_slice.materialStr()); - Volume s_vol(s_name, PolyhedraRegular(numsides, rmin, rmax, s_thick), s_mat); + string s_name = _toString(s_num, "slice%d"); + double s_thick = x_slice.thickness(); + Material s_mat = description.material(x_slice.materialStr()); + Volume s_vol(s_name, PolyhedraRegular(numsides, rmin, rmax, s_thick), s_mat); s_vol.setVisAttributes(description.visAttributes(x_slice.visStr())); sliceZ += s_thick / 2; @@ -91,13 +90,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s for (int j = 0; j < l_repeat; ++j) { string phys_lay = _toString(l_num, "layer%d"); layerZ += l_thick / 2; - DetElement layer_elt(endcap, phys_lay, l_num); + DetElement layer_elt(endcap, phys_lay, l_num); PlacedVolume pv = endcapVol.placeVolume(l_vol, Position(0, 0, layerZ)); pv.addPhysVolID("layer", l_num); layer_elt.setPlacement(pv); for (size_t ic = 0; ic < sensitives.size(); ++ic) { PlacedVolume sens_pv = sensitives[ic]; - DetElement comp_elt(layer_elt, sens_pv.volume().name(), l_num); + DetElement comp_elt(layer_elt, sens_pv.volume().name(), l_num); comp_elt.setPlacement(sens_pv); } layerZ += l_thick / 2; @@ -106,19 +105,21 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ++layerType; } - double z_pos = zmin + totalThickness / 2; + double z_pos = zmin + totalThickness / 2; PlacedVolume pv; // Reflect it. - Assembly assembly(det_name); + Assembly assembly(det_name); DetElement endcapAssyDE(det_name, det_id); - Volume motherVol = description.pickMotherVolume(endcapAssyDE); + Volume motherVol = description.pickMotherVolume(endcapAssyDE); if (reflect) { - pv = assembly.placeVolume(endcapVol, Transform3D(RotationZYX(M_PI / numsides, M_PI, 0), Position(0, 0, -z_pos))); + pv = assembly.placeVolume( + endcapVol, Transform3D(RotationZYX(M_PI / numsides, M_PI, 0), Position(0, 0, -z_pos))); pv.addPhysVolID("barrel", 2); Ref_t(endcap)->SetName((det_name + "_backward").c_str()); endcap.setPlacement(pv); } else { - pv = assembly.placeVolume(endcapVol, Transform3D(RotationZYX(M_PI / numsides, 0, 0), Position(0, 0, z_pos))); + pv = assembly.placeVolume( + endcapVol, Transform3D(RotationZYX(M_PI / numsides, 0, 0), Position(0, 0, z_pos))); pv.addPhysVolID("barrel", 1); Ref_t(endcap)->SetName((det_name + "_forward").c_str()); endcap.setPlacement(pv); diff --git a/src/ScFiCalorimeter_geo.cpp b/src/ScFiCalorimeter_geo.cpp index 6c9daca7b..e1823a0e9 100644 --- a/src/ScFiCalorimeter_geo.cpp +++ b/src/ScFiCalorimeter_geo.cpp @@ -21,12 +21,11 @@ using namespace dd4hep; using Point = ROOT::Math::XYPoint; -std::tuple<Volume, Position> build_module(const Detector& desc, const xml::Component& mod_x, SensitiveDetector& sens); +std::tuple<Volume, Position> build_module(const Detector& desc, const xml::Component& mod_x, + SensitiveDetector& sens); // helper function to get x, y, z if defined in a xml component -template <class XmlComp> -Position get_xml_xyz(const XmlComp& comp, dd4hep::xml::Strng_t name) -{ +template <class XmlComp> Position get_xml_xyz(const XmlComp& comp, dd4hep::xml::Strng_t name) { Position pos(0., 0., 0.); if (comp.hasChild(name)) { auto child = comp.child(name); @@ -38,12 +37,11 @@ Position get_xml_xyz(const XmlComp& comp, dd4hep::xml::Strng_t name) } // main -static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) { xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + DetElement det(detName, detID); sens.setType("calorimeter"); auto dim = detElem.dimensions(); auto rmin = dim.rmin(); @@ -52,21 +50,21 @@ static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDete auto phimin = dd4hep::getAttrOrDefault<double>(dim, _Unicode(phimin), 0.); auto phimax = dd4hep::getAttrOrDefault<double>(dim, _Unicode(phimax), 2. * M_PI); // envelope - Tube envShape(rmin, rmax, length / 2., phimin, phimax); + Tube envShape(rmin, rmax, length / 2., phimin, phimax); Volume env(detName + "_envelope", envShape, desc.material("Air")); env.setVisAttributes(desc.visAttributes(detElem.visStr())); // build module - auto [modVol, modSize] = build_module(desc, detElem.child(_Unicode(module)), sens); - double modSizeR = std::sqrt(modSize.x() * modSize.x() + modSize.y() * modSize.y()); - double assembly_rwidth = modSizeR * 2.; - int nas = int((rmax - rmin) / assembly_rwidth) + 1; + auto [modVol, modSize] = build_module(desc, detElem.child(_Unicode(module)), sens); + double modSizeR = std::sqrt(modSize.x() * modSize.x() + modSize.y() * modSize.y()); + double assembly_rwidth = modSizeR * 2.; + int nas = int((rmax - rmin) / assembly_rwidth) + 1; std::vector<Assembly> assemblies; // calorimeter block z-offsets (as blocks are shorter than the volume length) const double block_offset = -0.5 * (length - modSize.z()); for (int i = 0; i < nas; ++i) { Assembly assembly(detName + Form("_ring%d", i + 1)); - auto assemblyPV = env.placeVolume(assembly, Position{0., 0., block_offset}); + auto assemblyPV = env.placeVolume(assembly, Position{0., 0., block_offset}); assemblyPV.addPhysVolID("ring", i + 1); assemblies.emplace_back(std::move(assembly)); } @@ -79,9 +77,9 @@ static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDete double my = modSize.y() * iy - rmax; double mr = std::sqrt(mx * mx + my * my); if (mr - modSizeR >= rmin && mr + modSizeR <= rmax) { - int ias = int((mr - rmin) / assembly_rwidth); + int ias = int((mr - rmin) / assembly_rwidth); auto& assembly = assemblies[ias]; - auto modPV = assembly.placeVolume(modVol, Position(mx, my, 0.)); + auto modPV = assembly.placeVolume(modVol, Position(mx, my, 0.)); modPV.addPhysVolID("module", modid++); } } @@ -94,38 +92,39 @@ static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDete } // detector position and rotation - auto pos = get_xml_xyz(detElem, _Unicode(position)); - auto rot = get_xml_xyz(detElem, _Unicode(rotation)); - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr = Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x()); - PlacedVolume envPV = motherVol.placeVolume(env, tr); + auto pos = get_xml_xyz(detElem, _Unicode(position)); + auto rot = get_xml_xyz(detElem, _Unicode(rotation)); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr = + Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x()); + PlacedVolume envPV = motherVol.placeVolume(env, tr); envPV.addPhysVolID("system", detID); det.setPlacement(envPV); return det; } // helper function to build module with scintillating fibers -std::tuple<Volume, Position> build_module(const Detector& desc, const xml::Component& mod_x, SensitiveDetector& sens) -{ +std::tuple<Volume, Position> build_module(const Detector& desc, const xml::Component& mod_x, + SensitiveDetector& sens) { auto sx = mod_x.attr<double>(_Unicode(sizex)); auto sy = mod_x.attr<double>(_Unicode(sizey)); auto sz = mod_x.attr<double>(_Unicode(sizez)); - Box modShape(sx / 2., sy / 2., sz / 2.); - auto modMat = desc.material(mod_x.attr<std::string>(_Unicode(material))); + Box modShape(sx / 2., sy / 2., sz / 2.); + auto modMat = desc.material(mod_x.attr<std::string>(_Unicode(material))); Volume modVol("module_vol", modShape, modMat); if (mod_x.hasAttr(_Unicode(vis))) { modVol.setVisAttributes(desc.visAttributes(mod_x.attr<std::string>(_Unicode(vis)))); } if (mod_x.hasChild(_Unicode(fiber))) { - auto fiber_x = mod_x.child(_Unicode(fiber)); - auto fr = fiber_x.attr<double>(_Unicode(radius)); - auto fsx = fiber_x.attr<double>(_Unicode(spacex)); - auto fsy = fiber_x.attr<double>(_Unicode(spacey)); - auto foff = dd4hep::getAttrOrDefault<double>(fiber_x, _Unicode(offset), 0.5 * mm); - auto fiberMat = desc.material(fiber_x.attr<std::string>(_Unicode(material))); - Tube fiberShape(0., fr, sz / 2.); + auto fiber_x = mod_x.child(_Unicode(fiber)); + auto fr = fiber_x.attr<double>(_Unicode(radius)); + auto fsx = fiber_x.attr<double>(_Unicode(spacex)); + auto fsy = fiber_x.attr<double>(_Unicode(spacey)); + auto foff = dd4hep::getAttrOrDefault<double>(fiber_x, _Unicode(offset), 0.5 * mm); + auto fiberMat = desc.material(fiber_x.attr<std::string>(_Unicode(material))); + Tube fiberShape(0., fr, sz / 2.); Volume fiberVol("fiber_vol", fiberShape, fiberMat); fiberVol.setSensitiveDetector(sens); @@ -156,8 +155,8 @@ std::tuple<Volume, Position> build_module(const Detector& desc, const xml::Compo // std::cout << sx << ", " << sy << ", " << fr << ", " << nx << ", " << ny << std::endl; // place the fibers - double y0 = (foff + fside); - int nfibers = 0; + double y0 = (foff + fside); + int nfibers = 0; for (int iy = 0; iy < ny; ++iy) { double y = y0 + fdisty * iy; // about to touch the boundary @@ -171,7 +170,8 @@ std::tuple<Volume, Position> build_module(const Detector& desc, const xml::Compo if ((sx - x) < x0) { break; } - auto fiberPV = modVol.placeVolume(fiberVol, nfibers++, Position{x - sx / 2., y - sy / 2., 0}); + auto fiberPV = + modVol.placeVolume(fiberVol, nfibers++, Position{x - sx / 2., y - sy / 2., 0}); // std::cout << "(" << ix << ", " << iy << ", " << x - sx/2. << ", " << y - sy/2. << ", " << fr << "),\n"; fiberPV.addPhysVolID("fiber_x", ix + 1).addPhysVolID("fiber_y", iy + 1); } diff --git a/src/SimpleDiskDetector_geo.cpp b/src/SimpleDiskDetector_geo.cpp index 4e3b36b8e..49dc02e2d 100644 --- a/src/SimpleDiskDetector_geo.cpp +++ b/src/SimpleDiskDetector_geo.cpp @@ -23,35 +23,35 @@ using namespace std; using namespace dd4hep; using namespace dd4hep::detail; -static Ref_t SimpleDiskDetector_create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - Material air = description.air(); - string det_name = x_det.nameStr(); - bool reflect = x_det.reflect(); - DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name); - PlacedVolume pv; - int l_num = 0; - xml::Component pos = x_det.position(); +static Ref_t SimpleDiskDetector_create_detector(Detector& description, xml_h e, + SensitiveDetector sens) { + xml_det_t x_det = e; + Material air = description.air(); + string det_name = x_det.nameStr(); + bool reflect = x_det.reflect(); + DetElement sdet(det_name, x_det.id()); + Assembly assembly(det_name); + PlacedVolume pv; + int l_num = 0; + xml::Component pos = x_det.position(); for (xml_coll_t i(x_det, _U(layer)); i; ++i, ++l_num) { - xml_comp_t x_layer = i; - string l_nam = det_name + _toString(l_num, "_layer%d"); - double zmin = x_layer.inner_z(); - double rmin = x_layer.inner_r(); - double rmax = x_layer.outer_r(); - double layerWidth = 0.; - int s_num = 0; + xml_comp_t x_layer = i; + string l_nam = det_name + _toString(l_num, "_layer%d"); + double zmin = x_layer.inner_z(); + double rmin = x_layer.inner_r(); + double rmax = x_layer.outer_r(); + double layerWidth = 0.; + int s_num = 0; for (xml_coll_t j(x_layer, _U(slice)); j; ++j) { double thickness = xml_comp_t(j).thickness(); layerWidth += thickness; } - Tube l_tub(rmin, rmax, layerWidth / 2.0, 2 * M_PI); + Tube l_tub(rmin, rmax, layerWidth / 2.0, 2 * M_PI); Volume l_vol(l_nam, l_tub, air); l_vol.setVisAttributes(description, x_layer.visStr()); - DetElement layer; + DetElement layer; PlacedVolume layer_pv; if (!reflect) { layer = DetElement(sdet, l_nam + "_pos", l_num); @@ -60,7 +60,8 @@ static Ref_t SimpleDiskDetector_create_detector(Detector& description, xml_h e, layer.setPlacement(layer_pv); } else { layer = DetElement(sdet, l_nam + "_neg", l_num); - layer_pv = assembly.placeVolume(l_vol, Transform3D(RotationY(M_PI), Position(0, 0, -zmin - layerWidth / 2))); + layer_pv = assembly.placeVolume( + l_vol, Transform3D(RotationY(M_PI), Position(0, 0, -zmin - layerWidth / 2))); layer_pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_num); layer.setPlacement(layer_pv); // DetElement layerR = layer.clone(l_nam+"_neg"); @@ -70,10 +71,10 @@ static Ref_t SimpleDiskDetector_create_detector(Detector& description, xml_h e, double tot_thickness = -layerWidth / 2.0; for (xml_coll_t j(x_layer, _U(slice)); j; ++j, ++s_num) { xml_comp_t x_slice = j; - double thick = x_slice.thickness(); - Material mat = description.material(x_slice.materialStr()); - string s_nam = l_nam + _toString(s_num, "_slice%d"); - Volume s_vol(s_nam, Tube(rmin, rmax, thick / 2.0), mat); + double thick = x_slice.thickness(); + Material mat = description.material(x_slice.materialStr()); + string s_nam = l_nam + _toString(s_num, "_slice%d"); + Volume s_vol(s_nam, Tube(rmin, rmax, thick / 2.0), mat); if (!reflect) { s_nam += "_pos"; } else { @@ -94,7 +95,8 @@ static Ref_t SimpleDiskDetector_create_detector(Detector& description, xml_h e, if (x_det.hasAttr(_U(combineHits))) { sdet.setCombineHits(x_det.attr<bool>(_U(combineHits)), sens); } - pv = description.pickMotherVolume(sdet).placeVolume(assembly, Position(pos.x(), pos.y(), pos.z())); + pv = + description.pickMotherVolume(sdet).placeVolume(assembly, Position(pos.x(), pos.y(), pos.z())); pv.addPhysVolID("system", x_det.id()); // Set the subdetector system ID. sdet.setPlacement(pv); return sdet; diff --git a/src/Solenoid_geo.cpp b/src/Solenoid_geo.cpp index c8fcf86d8..4e49f8136 100644 --- a/src/Solenoid_geo.cpp +++ b/src/Solenoid_geo.cpp @@ -23,40 +23,43 @@ using namespace std; using namespace dd4hep; using namespace dd4hep::detail; -static Ref_t create_detector(Detector& description, xml_h e, [[maybe_unused]] SensitiveDetector sens) -{ - xml_det_t x_det = e; - string det_name = x_det.nameStr(); - Material air = description.air(); - DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); +static Ref_t create_detector(Detector& description, xml_h e, + [[maybe_unused]] SensitiveDetector sens) { + xml_det_t x_det = e; + string det_name = x_det.nameStr(); + Material air = description.air(); + DetElement sdet(det_name, x_det.id()); + Assembly assembly(det_name + "_assembly"); PlacedVolume pv; int i_layer = 0; for (xml_coll_t l_iter(x_det, _U(layer)); l_iter; ++l_iter, ++i_layer) { xml_comp_t x_layer = l_iter; - string l_name = getAttrOrDefault<string>(x_layer, _U(name), det_name + _toString(i_layer, "_layer%d")); - double outer_z = x_layer.outer_z(); - double inner_r = x_layer.inner_r(); - double outer_r = inner_r; + string l_name = + getAttrOrDefault<string>(x_layer, _U(name), det_name + _toString(i_layer, "_layer%d")); + double outer_z = x_layer.outer_z(); + double inner_r = x_layer.inner_r(); + double outer_r = inner_r; DetElement layer(sdet, _toString(i_layer, "layer%d"), x_layer.id()); - Tube l_tub(inner_r, 2 * inner_r, outer_z); // outer_r will be updated - Volume l_vol(l_name, l_tub, air); + Tube l_tub(inner_r, 2 * inner_r, outer_z); // outer_r will be updated + Volume l_vol(l_name, l_tub, air); - int i_slice = 0; + int i_slice = 0; double l_thickness = 0.0; for (xml_coll_t s_iter(x_layer, _U(slice)); s_iter; ++s_iter, ++i_slice) { // If slices are only given a thickness attribute, they are radially concentric slices // If slices are given an inner_z attribute, they are longitudinal slices with equal rmin - xml_comp_t x_slice = s_iter; - Material mat = description.material(x_slice.materialStr()); - string s_name = getAttrOrDefault<string>(x_slice, _U(name), l_name + _toString(i_slice, "_slice%d")); - double thickness = x_slice.thickness(); + xml_comp_t x_slice = s_iter; + Material mat = description.material(x_slice.materialStr()); + string s_name = + getAttrOrDefault<string>(x_slice, _U(name), l_name + _toString(i_slice, "_slice%d")); + double thickness = x_slice.thickness(); if (thickness > l_thickness) l_thickness = thickness; double s_outer_z = dd4hep::getAttrOrDefault(x_slice, _Unicode(outer_z), outer_z); double s_inner_z = dd4hep::getAttrOrDefault(x_slice, _Unicode(inner_z), 0.0 * cm); - Tube s_tub(inner_r, inner_r + thickness, (s_inner_z > 0 ? 0.5 * (s_outer_z - s_inner_z) : s_outer_z)); + Tube s_tub(inner_r, inner_r + thickness, + (s_inner_z > 0 ? 0.5 * (s_outer_z - s_inner_z) : s_outer_z)); Volume s_vol(s_name, s_tub, mat); s_vol.setAttributes(description, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); @@ -82,7 +85,7 @@ static Ref_t create_detector(Detector& description, xml_h e, [[maybe_unused]] Se // Get position and place volume xml::Component x_pos = x_det.position(); - Position pos(x_pos.x(), x_pos.y(), x_pos.z()); + Position pos(x_pos.x(), x_pos.y(), x_pos.z()); pv = description.pickMotherVolume(sdet).placeVolume(assembly, pos); pv.addPhysVolID("system", sdet.id()).addPhysVolID("barrel", 0); sdet.setPlacement(pv); diff --git a/src/SupportServiceMaterial_geo.cpp b/src/SupportServiceMaterial_geo.cpp index 516519ad7..c476f888c 100644 --- a/src/SupportServiceMaterial_geo.cpp +++ b/src/SupportServiceMaterial_geo.cpp @@ -21,93 +21,93 @@ using namespace std; using namespace dd4hep; namespace { - std::pair<Volume, Transform3D> build_shape(const Detector& descr, const xml_det_t& x_det, const xml_comp_t& x_support, - const xml_comp_t& x_child, const double offset = 0) - { - // Get Initial rotation/translation info - xml_dim_t x_pos(x_child.child(_U(position), false)); - xml_dim_t x_rot(x_child.child(_U(rotation), false)); - Position pos3D{0, 0, 0}; - Rotation3D rot3D; +std::pair<Volume, Transform3D> build_shape(const Detector& descr, const xml_det_t& x_det, + const xml_comp_t& x_support, const xml_comp_t& x_child, + const double offset = 0) { + // Get Initial rotation/translation info + xml_dim_t x_pos(x_child.child(_U(position), false)); + xml_dim_t x_rot(x_child.child(_U(rotation), false)); + Position pos3D{0, 0, 0}; + Rotation3D rot3D; - if (x_rot) { - rot3D = RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)); - } - if (x_pos) { - pos3D = Position(x_pos.x(0), x_pos.y(0), x_pos.z(0)); - } + if (x_rot) { + rot3D = RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)); + } + if (x_pos) { + pos3D = Position(x_pos.x(0), x_pos.y(0), x_pos.z(0)); + } - // handle different known shapes and create solids - Solid solid; - const std::string type = x_support.attr<std::string>(_U(type)); - if (type == "Tube" || type == "Cylinder") { - const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); - const double length = getAttrOrDefault(x_child, _U(length), x_support.length()); - const double rmin = getAttrOrDefault(x_child, _U(rmin), x_support.rmin()) + offset; - solid = Tube(rmin, rmin + thickness, length / 2); - } - // A disk is a cylinder, constructed differently - else if (type == "Disk") { - const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); - const double rmin = getAttrOrDefault(x_child, _U(rmin), x_support.rmin()); - const double rmax = getAttrOrDefault(x_child, _U(rmax), x_support.rmax()); - pos3D = pos3D + Position(0, 0, -x_support.thickness() / 2 + thickness / 2 + offset); - solid = Tube(rmin, rmax, thickness / 2); - } else if (type == "Cone") { - const double base_rmin1 = getAttrOrDefault(x_child, _U(rmin1), x_support.rmin1()); - const double base_rmin2 = getAttrOrDefault(x_child, _U(rmin2), x_support.rmin2()); - const double length = getAttrOrDefault(x_child, _U(length), x_support.length()); - // Account for the fact that the distance between base_rmin1 and rmax2 is the projection - // of the thickness on the transverse direction - const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); - const double transverse_thickness = thickness / cos(atan2(fabs(base_rmin2 - base_rmin1), length)); - // also account that the same is true for the offset - const double transverse_offset = offset / cos(atan2(fabs(base_rmin2 - base_rmin1), length)); - const double rmin1 = base_rmin1 + transverse_offset; - const double rmin2 = base_rmin2 + transverse_offset; - const double rmax1 = rmin1 + transverse_thickness; - const double rmax2 = rmin2 + transverse_thickness; - solid = Cone(length / 2, rmin1, rmax1, rmin2, rmax2); - } else { - printout(ERROR, x_det.nameStr(), "Unknown support type: %s", type.c_str()); - std::exit(1); - } - // Materials - Material mat = descr.material(getAttrOrDefault<std::string>(x_child, _U(material), "Air")); - // Create our volume - Volume vol{getAttrOrDefault<std::string>(x_child, _U(name), "support_vol"), solid, mat}; + // handle different known shapes and create solids + Solid solid; + const std::string type = x_support.attr<std::string>(_U(type)); + if (type == "Tube" || type == "Cylinder") { + const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); + const double length = getAttrOrDefault(x_child, _U(length), x_support.length()); + const double rmin = getAttrOrDefault(x_child, _U(rmin), x_support.rmin()) + offset; + solid = Tube(rmin, rmin + thickness, length / 2); + } + // A disk is a cylinder, constructed differently + else if (type == "Disk") { + const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); + const double rmin = getAttrOrDefault(x_child, _U(rmin), x_support.rmin()); + const double rmax = getAttrOrDefault(x_child, _U(rmax), x_support.rmax()); + pos3D = pos3D + Position(0, 0, -x_support.thickness() / 2 + thickness / 2 + offset); + solid = Tube(rmin, rmax, thickness / 2); + } else if (type == "Cone") { + const double base_rmin1 = getAttrOrDefault(x_child, _U(rmin1), x_support.rmin1()); + const double base_rmin2 = getAttrOrDefault(x_child, _U(rmin2), x_support.rmin2()); + const double length = getAttrOrDefault(x_child, _U(length), x_support.length()); + // Account for the fact that the distance between base_rmin1 and rmax2 is the projection + // of the thickness on the transverse direction + const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); + const double transverse_thickness = + thickness / cos(atan2(fabs(base_rmin2 - base_rmin1), length)); + // also account that the same is true for the offset + const double transverse_offset = offset / cos(atan2(fabs(base_rmin2 - base_rmin1), length)); + const double rmin1 = base_rmin1 + transverse_offset; + const double rmin2 = base_rmin2 + transverse_offset; + const double rmax1 = rmin1 + transverse_thickness; + const double rmax2 = rmin2 + transverse_thickness; + solid = Cone(length / 2, rmin1, rmax1, rmin2, rmax2); + } else { + printout(ERROR, x_det.nameStr(), "Unknown support type: %s", type.c_str()); + std::exit(1); + } + // Materials + Material mat = descr.material(getAttrOrDefault<std::string>(x_child, _U(material), "Air")); + // Create our volume + Volume vol{getAttrOrDefault<std::string>(x_child, _U(name), "support_vol"), solid, mat}; - // Create full transformation - Transform3D tr(rot3D, pos3D); + // Create full transformation + Transform3D tr(rot3D, pos3D); - // visualization? - if (x_child.hasAttr(_U(vis))) { - vol.setVisAttributes(descr.visAttributes(x_child.visStr())); - } - return {vol, tr}; - } - std::pair<Volume, Transform3D> build_shape(const Detector& descr, const xml_det_t& x_det, const xml_comp_t& x_support, - const double offset = 0) - { - return build_shape(descr, x_det, x_support, x_support, offset); + // visualization? + if (x_child.hasAttr(_U(vis))) { + vol.setVisAttributes(descr.visAttributes(x_child.visStr())); } + return {vol, tr}; +} +std::pair<Volume, Transform3D> build_shape(const Detector& descr, const xml_det_t& x_det, + const xml_comp_t& x_support, const double offset = 0) { + return build_shape(descr, x_det, x_support, x_support, offset); +} } // namespace /** Generic tracker support implementation, can consist of arbitrary shapes * * @author Sylvester Joosten */ -static Ref_t create_SupportServiceMaterial(Detector& description, xml_h e, [[maybe_unused]] SensitiveDetector sens) -{ - const xml_det_t x_det = e; - const int det_id = x_det.id(); - const string det_name = x_det.nameStr(); +static Ref_t create_SupportServiceMaterial(Detector& description, xml_h e, + [[maybe_unused]] SensitiveDetector sens) { + const xml_det_t x_det = e; + const int det_id = x_det.id(); + const string det_name = x_det.nameStr(); // global z-offset for the entire support assembly const double offset = getAttrOrDefault(x_det, _U(offset), 0.); DetElement det(det_name, det_id); - Assembly assembly(det_name + "_assembly"); + Assembly assembly(det_name + "_assembly"); // Loop over the supports for (xml_coll_t su{x_det, _U(support)}; su; ++su) { @@ -125,8 +125,8 @@ static Ref_t create_SupportServiceMaterial(Detector& description, xml_h e, [[may } // final placement - Volume motherVol = description.pickMotherVolume(det); - Position pos(0, 0, offset); + Volume motherVol = description.pickMotherVolume(det); + Position pos(0, 0, offset); PlacedVolume pv = motherVol.placeVolume(assembly, pos); pv.addPhysVolID("system", det.id()); det.setPlacement(pv); diff --git a/src/TaggerCalWSi_geo.cpp b/src/TaggerCalWSi_geo.cpp index 31dcfff60..201c2066f 100644 --- a/src/TaggerCalWSi_geo.cpp +++ b/src/TaggerCalWSi_geo.cpp @@ -15,16 +15,15 @@ using namespace std; using namespace dd4hep; -static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - string detName = x_det.nameStr(); - int detID = x_det.id(); +static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) { + xml_det_t x_det = e; + string detName = x_det.nameStr(); + int detID = x_det.id(); - xml_dim_t dim = x_det.dimensions(); - double Width = dim.x(); - double Height = dim.y(); - double Thickness = dim.z() / 2; + xml_dim_t dim = x_det.dimensions(); + double Width = dim.x(); + double Height = dim.y(); + double Thickness = dim.z() / 2; xml_dim_t pos = x_det.position(); // xml_dim_t rot = x_det.rotation(); @@ -36,7 +35,7 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) sens.setType("calorimeter"); // Create Global Volume - Box Tagger_Box(Width, Height, Thickness); + Box Tagger_Box(Width, Height, Thickness); Volume detVol("Tagger_Box", Tagger_Box, Vacuum); detVol.setVisAttributes(desc.visAttributes(x_det.visStr())); @@ -48,30 +47,30 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) for (int i = 0; i < 20; i++) { // absorber - Box Abso_Box(Width, Height, abso_z / 2); + Box Abso_Box(Width, Height, abso_z / 2); Volume absoVol("AbsorberVolume", Abso_Box, Absorber); absoVol.setVisAttributes(desc.visAttributes("BlueVis")); detVol.placeVolume(absoVol, Position(0, 0, Thickness - (i) * (abso_z + sens_z) - abso_z / 2)); // sensitive layer - Box Cal_Box(Width, Height, sens_z / 2); + Box Cal_Box(Width, Height, sens_z / 2); Volume calVol("SensVolume", Cal_Box, Silicon); calVol.setSensitiveDetector(sens); calVol.setVisAttributes(desc.visAttributes("RedVis")); - PlacedVolume pv_mod = - detVol.placeVolume(calVol, Position(0, 0, Thickness - (i) * (abso_z + sens_z) - abso_z - sens_z / 2)); + PlacedVolume pv_mod = detVol.placeVolume( + calVol, Position(0, 0, Thickness - (i) * (abso_z + sens_z) - abso_z - sens_z / 2)); pv_mod.addPhysVolID("layer", i + 3); // leave room for tracking IDs } // mother volume for calorimeter - std::string mother_nam = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(place_into), ""); - VolumeManager man = VolumeManager::getVolumeManager(desc); - DetElement mdet = man.detector().child(mother_nam); + std::string mother_nam = dd4hep::getAttrOrDefault<std::string>(x_det, _Unicode(place_into), ""); + VolumeManager man = VolumeManager::getVolumeManager(desc); + DetElement mdet = man.detector().child(mother_nam); // placement in envelope - Transform3D tr(RotationZYX(0, 0, 0), Position(pos.x(), pos.y(), pos.z())); + Transform3D tr(RotationZYX(0, 0, 0), Position(pos.x(), pos.y(), pos.z())); PlacedVolume detPV = mdet.volume().placeVolume(detVol, tr); detPV.addPhysVolID("system", detID); DetElement det(detName, detID); diff --git a/src/TrapEndcapTracker_geo.cpp b/src/TrapEndcapTracker_geo.cpp index 1872dd698..9cb9139d3 100644 --- a/src/TrapEndcapTracker_geo.cpp +++ b/src/TrapEndcapTracker_geo.cpp @@ -30,64 +30,64 @@ using namespace dd4hep::detail; * @author Whitney Armstrong * */ -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; - xml_det_t x_det = e; - Material vacuum = description.vacuum(); - int det_id = x_det.id(); - string det_name = x_det.nameStr(); - bool reflect = x_det.reflect(false); - DetElement sdet(det_name, det_id); - Assembly assembly(det_name); - - Material air = description.material("Air"); - Volume motherVol = description.pickMotherVolume(sdet); - int m_id = 0, c_id = 0, n_sensor = 0; - map<string, Volume> modules; - map<string, Placements> sensitives; + xml_det_t x_det = e; + Material vacuum = description.vacuum(); + int det_id = x_det.id(); + string det_name = x_det.nameStr(); + bool reflect = x_det.reflect(false); + DetElement sdet(det_name, det_id); + Assembly assembly(det_name); + + Material air = description.material("Air"); + Volume motherVol = description.pickMotherVolume(sdet); + int m_id = 0, c_id = 0, n_sensor = 0; + map<string, Volume> modules; + map<string, Placements> sensitives; map<string, std::vector<VolPlane>> volplane_surfaces; map<string, std::array<double, 2>> module_thicknesses; - PlacedVolume pv; + PlacedVolume pv; // Set detector type flag dd4hep::xml::setDetectorTypeFlag(x_det, sdet); - auto ¶ms = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( - sdet); + auto& params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(sdet); // Add the volume boundary material if configured for (xml_coll_t bmat(x_det, _Unicode(boundary_material)); bmat; ++bmat) { xml_comp_t x_boundary_material = bmat; DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, params, - "boundary_material"); + "boundary_material"); } assembly.setVisAttributes(description.invisible()); sens.setType("tracker"); for (xml_coll_t su(x_det, _U(support)); su; ++su) { - xml_comp_t x_support = su; - double support_thickness = getAttrOrDefault(x_support, _U(thickness), 2.0 * mm); - double support_length = getAttrOrDefault(x_support, _U(length), 2.0 * mm); - double support_rmin = getAttrOrDefault(x_support, _U(rmin), 2.0 * mm); - double support_zstart = getAttrOrDefault(x_support, _U(zstart), 2.0 * mm); - std::string support_name = getAttrOrDefault<std::string>(x_support, _Unicode(name), "support_tube"); - std::string support_vis = getAttrOrDefault<std::string>(x_support, _Unicode(vis), "AnlRed"); - xml_dim_t pos(x_support.child(_U(position), false)); - xml_dim_t rot(x_support.child(_U(rotation), false)); - Solid support_solid; + xml_comp_t x_support = su; + double support_thickness = getAttrOrDefault(x_support, _U(thickness), 2.0 * mm); + double support_length = getAttrOrDefault(x_support, _U(length), 2.0 * mm); + double support_rmin = getAttrOrDefault(x_support, _U(rmin), 2.0 * mm); + double support_zstart = getAttrOrDefault(x_support, _U(zstart), 2.0 * mm); + std::string support_name = + getAttrOrDefault<std::string>(x_support, _Unicode(name), "support_tube"); + std::string support_vis = getAttrOrDefault<std::string>(x_support, _Unicode(vis), "AnlRed"); + xml_dim_t pos(x_support.child(_U(position), false)); + xml_dim_t rot(x_support.child(_U(rotation), false)); + Solid support_solid; if (x_support.hasChild(_U(shape))) { xml_comp_t shape(x_support.child(_U(shape))); - string shape_type = shape.typeStr(); - support_solid = xml::createShape(description, shape_type, shape); + string shape_type = shape.typeStr(); + support_solid = xml::createShape(description, shape_type, shape); } else { support_solid = Tube(support_rmin, support_rmin + support_thickness, support_length / 2); } Transform3D tr = - Transform3D(Rotation3D(), Position(0, 0, (reflect ? -1.0 : 1.0) * (support_zstart + support_length / 2))); + Transform3D(Rotation3D(), + Position(0, 0, (reflect ? -1.0 : 1.0) * (support_zstart + support_length / 2))); if (pos.ptr() && rot.ptr()) { Rotation3D rot3D(RotationZYX(rot.z(0), rot.y(0), rot.x(0))); - Position pos3D(pos.x(0), pos.y(0), pos.z(0)); + Position pos3D(pos.x(0), pos.y(0), pos.z(0)); tr = Transform3D(rot3D, pos3D); } else if (pos.ptr()) { tr = Transform3D(Rotation3D(), Position(pos.x(0), pos.y(0), pos.z(0))); @@ -96,7 +96,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s tr = Transform3D(rot3D, Position()); } Material support_mat = description.material(x_support.materialStr()); - Volume support_vol(support_name, support_solid, support_mat); + Volume support_vol(support_name, support_solid, support_mat); support_vol.setVisAttributes(description.visAttributes(support_vis)); pv = assembly.placeVolume(support_vol, tr); // pv = assembly.placeVolume(support_vol, Position(0, 0, support_zstart + support_length / 2)); @@ -104,43 +104,43 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s for (xml_coll_t mi(x_det, _U(module)); mi; ++mi, ++m_id) { xml_comp_t x_mod = mi; - string m_nam = x_mod.nameStr(); + string m_nam = x_mod.nameStr(); xml_comp_t trd = x_mod.trd(); - double posY; - double x1 = trd.x1(); - double x2 = trd.x2(); - double z = trd.z(); - double total_thickness = 0.; + double posY; + double x1 = trd.x1(); + double x2 = trd.x2(); + double z = trd.z(); + double total_thickness = 0.; xml_coll_t ci(x_mod, _U(module_component)); for (ci.reset(), total_thickness = 0.0; ci; ++ci) total_thickness += xml_comp_t(ci).thickness(); - double thickness_so_far = 0.0; - double y1 = total_thickness / 2; - double y2 = total_thickness / 2; + double thickness_so_far = 0.0; + double y1 = total_thickness / 2; + double y2 = total_thickness / 2; Trapezoid m_solid(x1, x2, y1, y2, z); - Volume m_volume(m_nam, m_solid, vacuum); + Volume m_volume(m_nam, m_solid, vacuum); m_volume.setVisAttributes(description.visAttributes(x_mod.visStr())); Solid frame_s; if (x_mod.hasChild(_U(frame))) { // build frame from trd (assumed to be smaller) - xml_comp_t m_frame = x_mod.child(_U(frame)); - xml_comp_t f_pos = m_frame.child(_U(position)); - xml_comp_t frame_trd = m_frame.trd(); - double frame_thickness = getAttrOrDefault(m_frame, _U(thickness), total_thickness); - double frame_x1 = frame_trd.x1(); - double frame_x2 = frame_trd.x2(); - double frame_z = frame_trd.z(); + xml_comp_t m_frame = x_mod.child(_U(frame)); + xml_comp_t f_pos = m_frame.child(_U(position)); + xml_comp_t frame_trd = m_frame.trd(); + double frame_thickness = getAttrOrDefault(m_frame, _U(thickness), total_thickness); + double frame_x1 = frame_trd.x1(); + double frame_x2 = frame_trd.x2(); + double frame_z = frame_trd.z(); // make the frame match the total thickness if thickness attribute is not given - Trapezoid f_solid1(x1, x2, frame_thickness / 2.0, frame_thickness / 2.0, z); - Trapezoid f_solid(frame_x1, frame_x2, frame_thickness / 2.0, frame_thickness / 2.0, frame_z); + Trapezoid f_solid1(x1, x2, frame_thickness / 2.0, frame_thickness / 2.0, z); + Trapezoid f_solid(frame_x1, frame_x2, frame_thickness / 2.0, frame_thickness / 2.0, frame_z); SubtractionSolid frame_shape(f_solid1, f_solid); frame_s = frame_shape; Material f_mat = description.material(m_frame.materialStr()); - Volume f_vol(m_nam + "_frame", frame_shape, f_mat); + Volume f_vol(m_nam + "_frame", frame_shape, f_mat); f_vol.setVisAttributes(description.visAttributes(m_frame.visStr())); // figure out how to best place @@ -148,17 +148,17 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s } for (ci.reset(), n_sensor = 1, c_id = 0, posY = -y1; ci; ++ci, ++c_id) { - xml_comp_t c = ci; - double c_thick = c.thickness(); - auto comp_x1 = getAttrOrDefault(c, _Unicode(x1), x1); - auto comp_x2 = getAttrOrDefault(c, _Unicode(x2), x2); - auto comp_height = getAttrOrDefault(c, _Unicode(height), z); + xml_comp_t c = ci; + double c_thick = c.thickness(); + auto comp_x1 = getAttrOrDefault(c, _Unicode(x1), x1); + auto comp_x2 = getAttrOrDefault(c, _Unicode(x2), x2); + auto comp_height = getAttrOrDefault(c, _Unicode(height), z); - Material c_mat = description.material(c.materialStr()); - string c_name = _toString(c_id, "component%d"); + Material c_mat = description.material(c.materialStr()); + string c_name = _toString(c_id, "component%d"); Trapezoid comp_s1(comp_x1, comp_x2, c_thick / 2e0, c_thick / 2e0, comp_height); - Solid comp_shape = comp_s1; + Solid comp_shape = comp_s1; if (frame_s.isValid()) { comp_shape = SubtractionSolid(comp_s1, frame_s); } @@ -170,7 +170,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s module_thicknesses[m_nam] = {thickness_so_far + c_thick / 2.0, total_thickness - thickness_so_far - c_thick / 2.0}; // std::cout << " adding sensitive volume" << c_name << "\n"; - sdet.check(n_sensor > 2, "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); + sdet.check(n_sensor > 2, + "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); pv.addPhysVolID("sensor", n_sensor); c_vol.setSensitiveDetector(sens); sensitives[m_nam].push_back(pv); @@ -204,32 +205,32 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s for (xml_coll_t li(x_det, _U(layer)); li; ++li) { xml_comp_t x_layer(li); - int l_id = x_layer.id(); - int mod_num = 1; - - xml_comp_t l_env = x_layer.child(_U(envelope)); - string layer_name = det_name + std::string("_layer") + std::to_string(l_id); - - std::string layer_vis = l_env.attr<std::string>(_Unicode(vis)); - double layer_rmin = l_env.attr<double>(_Unicode(rmin)); - double layer_rmax = l_env.attr<double>(_Unicode(rmax)); - double layer_length = l_env.attr<double>(_Unicode(length)); - double layer_zstart = l_env.attr<double>(_Unicode(zstart)); - double layer_center_z = layer_zstart + layer_length / 2.0; + int l_id = x_layer.id(); + int mod_num = 1; + + xml_comp_t l_env = x_layer.child(_U(envelope)); + string layer_name = det_name + std::string("_layer") + std::to_string(l_id); + + std::string layer_vis = l_env.attr<std::string>(_Unicode(vis)); + double layer_rmin = l_env.attr<double>(_Unicode(rmin)); + double layer_rmax = l_env.attr<double>(_Unicode(rmax)); + double layer_length = l_env.attr<double>(_Unicode(length)); + double layer_zstart = l_env.attr<double>(_Unicode(zstart)); + double layer_center_z = layer_zstart + layer_length / 2.0; // printout(INFO,"ROOTGDMLParse","+++ Read geometry from GDML file file:%s",input.c_str()); // std::cout << "SiTracker Endcap layer " << l_id << " zstart = " << layer_zstart/dd4hep::mm << "mm ( " << // layer_length/dd4hep::mm << " mm thick )\n"; // Assembly layer_assembly(layer_name); // assembly.placeVolume(layer_assembly); - Tube layer_tub(layer_rmin, layer_rmax, layer_length / 2); + Tube layer_tub(layer_rmin, layer_rmax, layer_length / 2); Volume layer_vol(layer_name, layer_tub, air); // Create the layer envelope volume. layer_vol.setVisAttributes(description.visAttributes(layer_vis)); PlacedVolume layer_pv; if (reflect) { - layer_pv = - assembly.placeVolume(layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z))); + layer_pv = assembly.placeVolume( + layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z))); layer_pv.addPhysVolID("layer", l_id); layer_name += "_N"; } else { @@ -240,26 +241,26 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s DetElement layer_element(sdet, layer_name, l_id); layer_element.setPlacement(layer_pv); - auto &layerParams = - DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>( - layer_element); + auto& layerParams = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(layer_element); for (xml_coll_t lmat(x_layer, _Unicode(layer_material)); lmat; ++lmat) { xml_comp_t x_layer_material = lmat; - DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, "layer_material"); + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, layerParams, + "layer_material"); } for (xml_coll_t ri(x_layer, _U(ring)); ri; ++ri) { - xml_comp_t x_ring = ri; - double r = x_ring.r(); - double phi0 = x_ring.phi0(0); - double zstart = x_ring.zstart(); - double dz = x_ring.dz(0); - int nmodules = x_ring.nmodules(); - string m_nam = x_ring.moduleStr(); - Volume m_vol = modules[m_nam]; - double iphi = 2 * M_PI / nmodules; - double phi = phi0; + xml_comp_t x_ring = ri; + double r = x_ring.r(); + double phi0 = x_ring.phi0(0); + double zstart = x_ring.zstart(); + double dz = x_ring.dz(0); + int nmodules = x_ring.nmodules(); + string m_nam = x_ring.moduleStr(); + Volume m_vol = modules[m_nam]; + double iphi = 2 * M_PI / nmodules; + double phi = phi0; Placements& sensVols = sensitives[m_nam]; for (int k = 0; k < nmodules; ++k) { @@ -269,28 +270,30 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s if (!reflect) { DetElement module(layer_element, m_base + "_pos", det_id); - pv = layer_vol.placeVolume( - m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, zstart + dz))); + pv = layer_vol.placeVolume(m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), + Position(x, y, zstart + dz))); pv.addPhysVolID("module", mod_num); module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(module, sens_pv.volume().name(), mod_num); - auto &comp_elt_params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_elt); + DetElement comp_elt(module, sens_pv.volume().name(), mod_num); + auto& comp_elt_params = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_elt); comp_elt_params.set<string>("axis_definitions", "XZY"); comp_elt.setPlacement(sens_pv); volSurfaceList(comp_elt)->push_back(volplane_surfaces[m_nam][ic]); } } else { - pv = layer_vol.placeVolume( - m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, -zstart - dz))); + pv = layer_vol.placeVolume(m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), + Position(x, y, -zstart - dz))); pv.addPhysVolID("module", mod_num); DetElement r_module(layer_element, m_base + "_neg", det_id); r_module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; - DetElement comp_elt(r_module, sens_pv.volume().name(), mod_num); - auto &comp_elt_params = DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_elt); + DetElement comp_elt(r_module, sens_pv.volume().name(), mod_num); + auto& comp_elt_params = + DD4hepDetectorHelper::ensureExtension<dd4hep::rec::VariantParameters>(comp_elt); comp_elt_params.set<string>("axis_definitions", "XZY"); comp_elt.setPlacement(sens_pv); volSurfaceList(comp_elt)->push_back(volplane_surfaces[m_nam][ic]); diff --git a/src/ZDC_Crystal_geo.cpp b/src/ZDC_Crystal_geo.cpp index 52daa9f49..e9e7185a3 100644 --- a/src/ZDC_Crystal_geo.cpp +++ b/src/ZDC_Crystal_geo.cpp @@ -20,73 +20,72 @@ using namespace std; using namespace dd4hep; // main -static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) { xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + DetElement det(detName, detID); sens.setType("calorimeter"); - auto dim = detElem.dimensions(); - auto xwidth = dim.x(); - auto ywidth = dim.y(); - auto length = dim.z(); - xml_dim_t pos = detElem.position(); - xml_dim_t rot = detElem.rotation(); + auto dim = detElem.dimensions(); + auto xwidth = dim.x(); + auto ywidth = dim.y(); + auto length = dim.z(); + xml_dim_t pos = detElem.position(); + xml_dim_t rot = detElem.rotation(); // envelope - Box envShape(xwidth * 0.5, ywidth * 0.5, length * 0.5); + Box envShape(xwidth * 0.5, ywidth * 0.5, length * 0.5); Volume env(detName + "_envelope", envShape, desc.material("Air")); env.setVisAttributes(desc.visAttributes(detElem.visStr())); // build frame - xml_comp_t fr = detElem.child(_Unicode(support)); - auto fx = xwidth; - auto fy = ywidth; - auto fz = fr.attr<double>(_Unicode(sizez)); - auto fthickness = fr.attr<double>(_Unicode(thickness)); - - Box frShape(fx / 2., fy / 2., fz / 2.); - auto frMat = desc.material(fr.attr<std::string>(_Unicode(material))); + xml_comp_t fr = detElem.child(_Unicode(support)); + auto fx = xwidth; + auto fy = ywidth; + auto fz = fr.attr<double>(_Unicode(sizez)); + auto fthickness = fr.attr<double>(_Unicode(thickness)); + + Box frShape(fx / 2., fy / 2., fz / 2.); + auto frMat = desc.material(fr.attr<std::string>(_Unicode(material))); Volume frVol("frame_vol", frShape, frMat); frVol.setVisAttributes(desc.visAttributes(fr.visStr())); xml_comp_t mod_x = detElem.child(_Unicode(module)); - auto nx = mod_x.attr<int>(_Unicode(nx)); - auto ny = mod_x.attr<int>(_Unicode(ny)); + auto nx = mod_x.attr<int>(_Unicode(nx)); + auto ny = mod_x.attr<int>(_Unicode(ny)); // crystal tower - xml_comp_t twr = mod_x.child(_Unicode(tower)); - double tsx = twr.attr<double>(_Unicode(cellx)); - double tsy = twr.attr<double>(_Unicode(celly)); - double tsz = twr.thickness(); - Material t_mat = desc.material(twr.materialStr()); - string t_name = twr.nameStr(); - - Box t_Shape(tsx / 2., tsy / 2., tsz / 2.); + xml_comp_t twr = mod_x.child(_Unicode(tower)); + double tsx = twr.attr<double>(_Unicode(cellx)); + double tsy = twr.attr<double>(_Unicode(celly)); + double tsz = twr.thickness(); + Material t_mat = desc.material(twr.materialStr()); + string t_name = twr.nameStr(); + + Box t_Shape(tsx / 2., tsy / 2., tsz / 2.); Volume t_Vol("tower_vol", t_Shape, t_mat); t_Vol.setVisAttributes(desc.visAttributes(twr.visStr())); if (twr.isSensitive()) t_Vol.setSensitiveDetector(sens); // readout socket - xml_comp_t sct = mod_x.child(_Unicode(socket)); - double ssx = sct.attr<double>(_Unicode(cellx)); - double ssy = sct.attr<double>(_Unicode(celly)); - double ssz = sct.thickness(); - Material s_mat = desc.material(sct.materialStr()); - string s_name = sct.nameStr(); - - Box s_Shape(ssx / 2., ssy / 2., ssz / 2.); + xml_comp_t sct = mod_x.child(_Unicode(socket)); + double ssx = sct.attr<double>(_Unicode(cellx)); + double ssy = sct.attr<double>(_Unicode(celly)); + double ssz = sct.thickness(); + Material s_mat = desc.material(sct.materialStr()); + string s_name = sct.nameStr(); + + Box s_Shape(ssx / 2., ssy / 2., ssz / 2.); Volume s_Vol("socket_vol", s_Shape, s_mat); s_Vol.setVisAttributes(desc.visAttributes(sct.visStr())); PlacedVolume pv; - double x_pos_0 = -(nx * tsx + (nx - 1) * fthickness) / 2.; - double y_pos_0 = -(ny * tsy + (ny - 1) * fthickness) / 2.; - double twr_z_pos_in_fr = -fz / 2. + tsz / 2.; - double sct_z_pos_in_env = -length / 2. + tsz + ssz / 2.; - int mod_i = 0; + double x_pos_0 = -(nx * tsx + (nx - 1) * fthickness) / 2.; + double y_pos_0 = -(ny * tsy + (ny - 1) * fthickness) / 2.; + double twr_z_pos_in_fr = -fz / 2. + tsz / 2.; + double sct_z_pos_in_env = -length / 2. + tsz + ssz / 2.; + int mod_i = 0; for (int ix = 0; ix < nx; ix++) { double x_pos = x_pos_0 + ix * (tsx + fthickness) + tsx / 2.; @@ -104,13 +103,13 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen } } - double f_zpos = -length / 2. + fz / 2.; + double f_zpos = -length / 2. + fz / 2.; Position fr_pos(0, 0, f_zpos); pv = env.placeVolume(frVol, fr_pos); // detector position and rotation - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume envPV = motherVol.placeVolume(env, tr); envPV.addPhysVolID("system", detID); det.setPlacement(envPV); diff --git a/src/ZDC_ImagingCal_geo.cpp b/src/ZDC_ImagingCal_geo.cpp index 831bc85f7..d430eb7c0 100644 --- a/src/ZDC_ImagingCal_geo.cpp +++ b/src/ZDC_ImagingCal_geo.cpp @@ -20,47 +20,46 @@ using namespace std; using namespace dd4hep; // main -static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) { xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + DetElement det(detName, detID); sens.setType("calorimeter"); - auto dim = detElem.dimensions(); - auto xwidth = dim.x(); - auto ywidth = dim.y(); - auto length = dim.z(); - xml_dim_t pos = detElem.position(); - xml_dim_t rot = detElem.rotation(); + auto dim = detElem.dimensions(); + auto xwidth = dim.x(); + auto ywidth = dim.y(); + auto length = dim.z(); + xml_dim_t pos = detElem.position(); + xml_dim_t rot = detElem.rotation(); // envelope - Box envShape(xwidth * 0.5, ywidth * 0.5, length * 0.5); + Box envShape(xwidth * 0.5, ywidth * 0.5, length * 0.5); Volume env(detName + "_envelope", envShape, desc.material("Air")); env.setVisAttributes(desc.visAttributes(detElem.visStr())); - int layerid = 0; - double zpos_0 = -length / 2.; + int layerid = 0; + double zpos_0 = -length / 2.; for (xml_coll_t li(detElem, _Unicode(layer)); li; ++li) { xml_comp_t x_lyr = li; - auto nlyr = x_lyr.attr<int>(_Unicode(nlayer)); - auto gap_z = x_lyr.attr<double>(_Unicode(gapspace)); + auto nlyr = x_lyr.attr<int>(_Unicode(nlayer)); + auto gap_z = x_lyr.attr<double>(_Unicode(gapspace)); - map<int, string> v_sl_name; + map<int, string> v_sl_name; map<string, Volume> slices; map<string, double> sl_thickness; - int nsl = 0; + int nsl = 0; xml_coll_t ci(x_lyr, _Unicode(slice)); for (ci.reset(); ci; ++ci) { - xml_comp_t x_sl = ci; - Material sl_mat = desc.material(x_sl.materialStr()); - string sl_name = x_sl.nameStr(); - double sl_z = x_sl.thickness(); + xml_comp_t x_sl = ci; + Material sl_mat = desc.material(x_sl.materialStr()); + string sl_name = x_sl.nameStr(); + double sl_z = x_sl.thickness(); - Box sl_Shape(xwidth / 2., ywidth / 2., sl_z / 2.); + Box sl_Shape(xwidth / 2., ywidth / 2., sl_z / 2.); Volume sl_Vol("slice_vol", sl_Shape, sl_mat); sl_Vol.setVisAttributes(desc.visAttributes(x_sl.visStr())); if (x_sl.isSensitive()) @@ -77,8 +76,8 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen for (int isl = 0; isl < nsl; isl++) { string sl_name = v_sl_name[isl + 1]; - double zpos = zpos_0 + sl_thickness[sl_name] / 2.; - Position sl_pos(0, 0, zpos); + double zpos = zpos_0 + sl_thickness[sl_name] / 2.; + Position sl_pos(0, 0, zpos); PlacedVolume pv = env.placeVolume(slices[sl_name], sl_pos); if (slices[sl_name].isSensitive()) pv.addPhysVolID(sl_name, layerid); @@ -91,8 +90,8 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen } // detector position and rotation - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume envPV = motherVol.placeVolume(env, tr); envPV.addPhysVolID("system", detID); det.setPlacement(envPV); diff --git a/src/ZDC_SamplingCal_geo.cpp b/src/ZDC_SamplingCal_geo.cpp index 78044b443..9ae8e8014 100644 --- a/src/ZDC_SamplingCal_geo.cpp +++ b/src/ZDC_SamplingCal_geo.cpp @@ -20,45 +20,44 @@ using namespace std; using namespace dd4hep; // main -static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) { xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + DetElement det(detName, detID); sens.setType("calorimeter"); - auto dim = detElem.dimensions(); - auto xwidth = dim.x(); - auto ywidth = dim.y(); - auto length = dim.z(); - xml_dim_t pos = detElem.position(); - xml_dim_t rot = detElem.rotation(); + auto dim = detElem.dimensions(); + auto xwidth = dim.x(); + auto ywidth = dim.y(); + auto length = dim.z(); + xml_dim_t pos = detElem.position(); + xml_dim_t rot = detElem.rotation(); // envelope - Box envShape(xwidth * 0.5, ywidth * 0.5, length * 0.5); + Box envShape(xwidth * 0.5, ywidth * 0.5, length * 0.5); Volume env(detName + "_envelope", envShape, desc.material("Air")); env.setVisAttributes(desc.visAttributes(detElem.visStr())); - xml_comp_t mod_x = detElem.child(_Unicode(module)); - auto nbox = mod_x.attr<int>(_Unicode(nbox)); - auto boxgap = mod_x.attr<int>(_Unicode(gapspace)); + xml_comp_t mod_x = detElem.child(_Unicode(module)); + auto nbox = mod_x.attr<int>(_Unicode(nbox)); + auto boxgap = mod_x.attr<int>(_Unicode(gapspace)); xml_comp_t x_lyr = mod_x.child(_Unicode(layer)); - auto nlyr = x_lyr.attr<int>(_Unicode(nlayer)); + auto nlyr = x_lyr.attr<int>(_Unicode(nlayer)); - map<int, string> v_sl_name; + map<int, string> v_sl_name; map<string, Volume> slices; map<string, double> sl_thickness; - int nsl = 0; + int nsl = 0; xml_coll_t ci(x_lyr, _Unicode(slice)); for (ci.reset(); ci; ++ci) { - xml_comp_t x_sl = ci; - Material sl_mat = desc.material(x_sl.materialStr()); - string sl_name = x_sl.nameStr(); - double sl_z = x_sl.thickness(); + xml_comp_t x_sl = ci; + Material sl_mat = desc.material(x_sl.materialStr()); + string sl_name = x_sl.nameStr(); + double sl_z = x_sl.thickness(); - Box sl_Shape(xwidth / 2., ywidth / 2., sl_z / 2.); + Box sl_Shape(xwidth / 2., ywidth / 2., sl_z / 2.); Volume sl_Vol("slice_vol", sl_Shape, sl_mat); sl_Vol.setVisAttributes(desc.visAttributes(x_sl.visStr())); if (x_sl.isSensitive()) @@ -70,16 +69,16 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen sl_thickness[sl_name] = sl_z; } - double zpos_0 = -length / 2.; - int layerid = 0; + double zpos_0 = -length / 2.; + int layerid = 0; for (int ibox = 0; ibox < nbox; ibox++) { for (int ilyr = 0; ilyr < nlyr; ilyr++) { layerid++; for (int isl = 0; isl < nsl; isl++) { string sl_name = v_sl_name[isl + 1]; - double zpos = zpos_0 + sl_thickness[sl_name] / 2.; - Position sl_pos(0, 0, zpos); + double zpos = zpos_0 + sl_thickness[sl_name] / 2.; + Position sl_pos(0, 0, zpos); PlacedVolume pv = env.placeVolume(slices[sl_name], sl_pos); if (slices[sl_name].isSensitive()) pv.addPhysVolID(sl_name, layerid); @@ -91,8 +90,8 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen } // detector position and rotation - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume envPV = motherVol.placeVolume(env, tr); envPV.addPhysVolID("system", detID); det.setPlacement(envPV); diff --git a/src/ZeroDegreeCalorimeterEcalWSciFi_geo.cpp b/src/ZeroDegreeCalorimeterEcalWSciFi_geo.cpp index 2188784fb..c519f1623 100644 --- a/src/ZeroDegreeCalorimeterEcalWSciFi_geo.cpp +++ b/src/ZeroDegreeCalorimeterEcalWSciFi_geo.cpp @@ -20,44 +20,43 @@ using namespace std; using namespace dd4hep; // main -static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ +static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sens) { xml::DetElement detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); - DetElement det(detName, detID); + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + DetElement det(detName, detID); sens.setType("calorimeter"); - auto dim = detElem.dimensions(); - auto width = dim.x(); - auto length = dim.z(); - xml_dim_t pos = detElem.position(); - xml_dim_t rot = detElem.rotation(); + auto dim = detElem.dimensions(); + auto width = dim.x(); + auto length = dim.z(); + xml_dim_t pos = detElem.position(); + xml_dim_t rot = detElem.rotation(); // envelope - Box envShape(width * 0.5, width * 0.5, length * 0.5); + Box envShape(width * 0.5, width * 0.5, length * 0.5); Volume env(detName + "_envelope", envShape, desc.material("Air")); env.setVisAttributes(desc.visAttributes(detElem.visStr())); // build module xml_comp_t mod_x = detElem.child(_Unicode(module)); - auto sx = mod_x.attr<double>(_Unicode(sizex)); - auto sy = mod_x.attr<double>(_Unicode(sizey)); - auto sz = mod_x.attr<double>(_Unicode(sizez)); + auto sx = mod_x.attr<double>(_Unicode(sizex)); + auto sy = mod_x.attr<double>(_Unicode(sizey)); + auto sz = mod_x.attr<double>(_Unicode(sizez)); - Box modShape(sx / 2., sy / 2., sz / 2.); - auto modMat = desc.material(mod_x.attr<std::string>(_Unicode(material))); + Box modShape(sx / 2., sy / 2., sz / 2.); + auto modMat = desc.material(mod_x.attr<std::string>(_Unicode(material))); Volume modVol("module_vol", modShape, modMat); modVol.setVisAttributes(desc.visAttributes(mod_x.visStr())); // modVol.setSensitiveDetector(sens); if (mod_x.hasChild(_Unicode(fiber))) { - auto fiber_x = mod_x.child(_Unicode(fiber)); - auto fr = fiber_x.attr<double>(_Unicode(radius)); - auto fsx = fiber_x.attr<double>(_Unicode(spacex)); - auto fsy = fiber_x.attr<double>(_Unicode(spacey)); - auto foff = dd4hep::getAttrOrDefault<double>(fiber_x, _Unicode(offset), 0.5 * mm); - auto fiberMat = desc.material(fiber_x.attr<std::string>(_Unicode(material))); - Tube fiberShape(0., fr, sz / 2. - 1. * mm); + auto fiber_x = mod_x.child(_Unicode(fiber)); + auto fr = fiber_x.attr<double>(_Unicode(radius)); + auto fsx = fiber_x.attr<double>(_Unicode(spacex)); + auto fsy = fiber_x.attr<double>(_Unicode(spacey)); + auto foff = dd4hep::getAttrOrDefault<double>(fiber_x, _Unicode(offset), 0.5 * mm); + auto fiberMat = desc.material(fiber_x.attr<std::string>(_Unicode(material))); + Tube fiberShape(0., fr, sz / 2. - 1. * mm); Volume fiberVol("fiber_vol", fiberShape, fiberMat); fiberVol.setSensitiveDetector(sens); @@ -73,8 +72,8 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen int ny = int(sy / (2. * fr)) + 1; // place the fibers - double y0 = (foff + fside); - int nfibers = 0; + double y0 = (foff + fside); + int nfibers = 0; for (int iy = 0; iy < ny; ++iy) { double y = y0 + fdisty * iy; // about to touch the boundary @@ -88,7 +87,8 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen if ((sx - x) < x0) { break; } - auto fiberPV = modVol.placeVolume(fiberVol, nfibers++, Position{x - sx / 2., y - sy / 2., 0}); + auto fiberPV = + modVol.placeVolume(fiberVol, nfibers++, Position{x - sx / 2., y - sy / 2., 0}); fiberPV.addPhysVolID("fiber_x", ix + 1).addPhysVolID("fiber_y", iy + 1); } } @@ -102,7 +102,7 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen double mod_y_pos = 0.0; double mod_z_pos = 0.0 * mm; double mgap = 0.000001 * mm; - int mNTowers = floor(width / (sx + mgap)); + int mNTowers = floor(width / (sx + mgap)); // std::cout << "mNTowers: " << mNTowers << std::endl; int k = 0; @@ -127,8 +127,8 @@ static Ref_t create_detector(Detector& desc, xml_h handle, SensitiveDetector sen } // detector position and rotation - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume envPV = motherVol.placeVolume(env, tr); envPV.addPhysVolID("system", detID); det.setPlacement(envPV); diff --git a/src/ZeroDegreeCalorimeterEcal_geo.cpp b/src/ZeroDegreeCalorimeterEcal_geo.cpp index 54004fda5..c8e0693bf 100644 --- a/src/ZeroDegreeCalorimeterEcal_geo.cpp +++ b/src/ZeroDegreeCalorimeterEcal_geo.cpp @@ -14,37 +14,36 @@ using namespace std; using namespace dd4hep; -static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - string detName = x_det.nameStr(); - int detID = x_det.id(); +static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) { + xml_det_t x_det = e; + string detName = x_det.nameStr(); + int detID = x_det.id(); - xml_dim_t dim = x_det.dimensions(); - double Width = dim.x(); - double Thickness = dim.z(); + xml_dim_t dim = x_det.dimensions(); + double Width = dim.x(); + double Thickness = dim.z(); xml_dim_t pos = x_det.position(); xml_dim_t rot = x_det.rotation(); Material Vacuum = desc.material("Vacuum"); - xml_comp_t mod = x_det.child(_Unicode(module)); - string modName = mod.nameStr(); - Material mPbWO4 = desc.material(mod.materialStr()); - double mThickness = mod.attr<double>(_Unicode(thickness)); - double mWidth = mod.attr<double>(_Unicode(width)); - double mGap = mod.attr<double>(_Unicode(gap)); - int mNTowers = mod.attr<double>(_Unicode(ntower)); + xml_comp_t mod = x_det.child(_Unicode(module)); + string modName = mod.nameStr(); + Material mPbWO4 = desc.material(mod.materialStr()); + double mThickness = mod.attr<double>(_Unicode(thickness)); + double mWidth = mod.attr<double>(_Unicode(width)); + double mGap = mod.attr<double>(_Unicode(gap)); + int mNTowers = mod.attr<double>(_Unicode(ntower)); // Create Global Volume - Box ffi_ZDC_GVol_Solid(Width * 0.5, Width * 0.5, Thickness * 0.5); + Box ffi_ZDC_GVol_Solid(Width * 0.5, Width * 0.5, Thickness * 0.5); Volume detVol("ffi_ZDC_GVol_Logic", ffi_ZDC_GVol_Solid, Vacuum); detVol.setVisAttributes(desc.visAttributes(x_det.visStr())); // Construct Tower // Single Module - Box ffi_ZDC_ECAL_Solid_Tower(mWidth * 0.5, mWidth * 0.5, mThickness * 0.5); + Box ffi_ZDC_ECAL_Solid_Tower(mWidth * 0.5, mWidth * 0.5, mThickness * 0.5); Volume modVol("ffi_ZDC_ECAL_Logic_Tower", ffi_ZDC_ECAL_Solid_Tower, mPbWO4); modVol.setVisAttributes(desc.visAttributes(mod.visStr())); sens.setType("calorimeter"); @@ -74,15 +73,15 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) if (abs(mod_x + mWidth / 2.0) > Width / 2.0) continue; k++; - string module_name = detName + _toString(k, "_ECAL_Phys_%d"); - PlacedVolume pv_mod = detVol.placeVolume(modVol, Position(mod_x, mod_y, mod_z)); + string module_name = detName + _toString(k, "_ECAL_Phys_%d"); + PlacedVolume pv_mod = detVol.placeVolume(modVol, Position(mod_x, mod_y, mod_z)); pv_mod.addPhysVolID("module", k + 1); } } - DetElement det(detName, detID); - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); + DetElement det(detName, detID); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume detPV = motherVol.placeVolume(detVol, tr); detPV.addPhysVolID("system", detID); det.setPlacement(detPV); diff --git a/src/ZeroDegreeCalorimeterSampling_geo.cpp b/src/ZeroDegreeCalorimeterSampling_geo.cpp index d3f0d6641..9dd394295 100644 --- a/src/ZeroDegreeCalorimeterSampling_geo.cpp +++ b/src/ZeroDegreeCalorimeterSampling_geo.cpp @@ -15,25 +15,24 @@ using namespace std; using namespace dd4hep; -static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) -{ - xml_det_t x_det = e; - string detName = x_det.nameStr(); - int detID = x_det.id(); - - xml_dim_t dim = x_det.dimensions(); - double Width = dim.x(); +static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) { + xml_det_t x_det = e; + string detName = x_det.nameStr(); + int detID = x_det.id(); + + xml_dim_t dim = x_det.dimensions(); + double Width = dim.x(); // double Length = dim.z(); xml_dim_t pos = x_det.position(); - double z = pos.z(); + double z = pos.z(); xml_dim_t rot = x_det.rotation(); Material Vacuum = desc.material("Vacuum"); double totWidth = Layering(x_det).totalThickness(); - Box envelope(Width / 2.0, Width / 2.0, totWidth / 2.0); + Box envelope(Width / 2.0, Width / 2.0, totWidth / 2.0); Volume envelopeVol(detName + "_envelope", envelope, Vacuum); envelopeVol.setVisAttributes(desc.visAttributes(x_det.visStr())); PlacedVolume pv; @@ -41,9 +40,9 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) int layer_num = 1; // Read layers for (xml_coll_t c(x_det, _U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - double layerWidth = 0; + xml_comp_t x_layer = c; + int repeat = x_layer.repeat(); + double layerWidth = 0; for (xml_coll_t l(x_layer, _U(slice)); l; ++l) layerWidth += xml_comp_t(l).thickness(); @@ -57,11 +56,11 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) int slice_num = 1; // Loop over slices for (xml_coll_t l(x_layer, _U(slice)); l; ++l) { - xml_comp_t x_slice = l; - double w = x_slice.thickness(); - string slice_name = layer_name + _toString(slice_num, "slice%d"); - Material slice_mat = desc.material(x_slice.materialStr()); - Volume slice_vol(slice_name, Box(Width / 2.0, Width / 2.0, w / 2.0), slice_mat); + xml_comp_t x_slice = l; + double w = x_slice.thickness(); + string slice_name = layer_name + _toString(slice_num, "slice%d"); + Material slice_mat = desc.material(x_slice.materialStr()); + Volume slice_vol(slice_name, Box(Width / 2.0, Width / 2.0, w / 2.0), slice_mat); if (x_slice.isSensitive()) { sens.setType("calorimeter"); @@ -70,25 +69,29 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) slice_vol.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); pv = layer_vol.placeVolume( - slice_vol, Transform3D(RotationZYX(0, 0, 0), Position(0.0, 0.0, z - zlayer - layerWidth / 2.0 + w / 2.0))); + slice_vol, Transform3D(RotationZYX(0, 0, 0), + Position(0.0, 0.0, z - zlayer - layerWidth / 2.0 + w / 2.0))); pv.addPhysVolID("slice", slice_num); z += w; ++slice_num; } - string layer_vis = dd4hep::getAttrOrDefault<std::string>(x_layer, _Unicode(vis), "InvisibleWithDaughters"); + string layer_vis = + dd4hep::getAttrOrDefault<std::string>(x_layer, _Unicode(vis), "InvisibleWithDaughters"); layer_vol.setAttributes(desc, x_layer.regionStr(), x_layer.limitsStr(), layer_vis); pv = envelopeVol.placeVolume( layer_vol, - Transform3D(RotationZYX(0, 0, 0), Position(0, 0, zlayer - pos.z() - totWidth / 2.0 + layerWidth / 2.0))); + Transform3D(RotationZYX(0, 0, 0), + Position(0, 0, zlayer - pos.z() - totWidth / 2.0 + layerWidth / 2.0))); pv.addPhysVolID("layer", layer_num); ++layer_num; } } - DetElement det(detName, detID); - Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z() + totWidth / 2.0)); + DetElement det(detName, detID); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), + Position(pos.x(), pos.y(), pos.z() + totWidth / 2.0)); PlacedVolume phv = motherVol.placeVolume(envelopeVol, tr); phv.addPhysVolID("system", detID); det.setPlacement(phv); diff --git a/src/ZeroDegreeCalorimeterSiPMonTile_geo.cpp b/src/ZeroDegreeCalorimeterSiPMonTile_geo.cpp index a13142d01..0e7396226 100644 --- a/src/ZeroDegreeCalorimeterSiPMonTile_geo.cpp +++ b/src/ZeroDegreeCalorimeterSiPMonTile_geo.cpp @@ -13,21 +13,20 @@ using namespace dd4hep; -static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) -{ - xml_det_t detElem = handle; - std::string detName = detElem.nameStr(); - int detID = detElem.id(); +static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) { + xml_det_t detElem = handle; + std::string detName = detElem.nameStr(); + int detID = detElem.id(); - xml_dim_t dim = detElem.dimensions(); - double width = dim.x(); // Size along x-axis - double height = dim.y(); // Size along y-axis - double length = dim.z(); // Size along z-axis + xml_dim_t dim = detElem.dimensions(); + double width = dim.x(); // Size along x-axis + double height = dim.y(); // Size along y-axis + double length = dim.z(); // Size along z-axis - xml_dim_t pos = detElem.position(); // Position in global coordinates - xml_dim_t rot = detElem.rotation(); + xml_dim_t pos = detElem.position(); // Position in global coordinates + xml_dim_t rot = detElem.rotation(); - Material air = desc.material("Air"); + Material air = desc.material("Air"); // Defining envelope Box envelope(width / 2.0, height / 2.0, length / 2.0); @@ -35,12 +34,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens // Defining envelope volume Volume envelopeVol(detName, envelope, air); // Setting envelope attributes - envelopeVol.setAttributes( - desc, - detElem.regionStr(), - detElem.limitsStr(), - detElem.visStr() - ); + envelopeVol.setAttributes(desc, detElem.regionStr(), detElem.limitsStr(), detElem.visStr()); PlacedVolume pv; @@ -49,77 +43,54 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens int layer_num = 1; // Looping through all the different layer sections - for(xml_coll_t c(detElem,_U(layer)); c; ++c) - { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); + for (xml_coll_t c(detElem, _U(layer)); c; ++c) { + xml_comp_t x_layer = c; + int repeat = x_layer.repeat(); double layer_thickness = x_layer.thickness(); // Looping through the number of repeated layers in each section - for(int i = 0; i < repeat; i++) - { + for (int i = 0; i < repeat; i++) { std::string layer_name = detName + _toString(layer_num, "_layer%d"); Box layer(width / 2., height / 2., layer_thickness / 2.); Volume layer_vol(layer_name, layer, air); - int slice_num = 1; + int slice_num = 1; double slice_z = -layer_thickness / 2.; // Keeps track of slices' z locations in each layer // Looping over each layer's slices - for(xml_coll_t l(x_layer,_U(slice)); l; ++l) - { - xml_comp_t x_slice = l; + for (xml_coll_t l(x_layer, _U(slice)); l; ++l) { + xml_comp_t x_slice = l; double slice_thickness = x_slice.thickness(); std::string slice_name = layer_name + _toString(slice_num, "slice%d"); - Material slice_mat = desc.material(x_slice.materialStr()); - slice_z += slice_thickness/2.; // Going to slice halfway point + Material slice_mat = desc.material(x_slice.materialStr()); + slice_z += slice_thickness / 2.; // Going to slice halfway point - Box slice(width/2., height/2., slice_thickness/2.); + Box slice(width / 2., height / 2., slice_thickness / 2.); - Volume slice_vol (slice_name, slice, slice_mat); + Volume slice_vol(slice_name, slice, slice_mat); // Setting appropriate slices as sensitive - if(x_slice.isSensitive()) - { + if (x_slice.isSensitive()) { sens.setType("calorimeter"); slice_vol.setSensitiveDetector(sens); } // Setting slice attributes - slice_vol.setAttributes( - desc, - x_slice.regionStr(), - x_slice.limitsStr(), - x_slice.visStr() - ); + slice_vol.setAttributes(desc, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); // Placing slice within layer - pv = layer_vol.placeVolume( - slice_vol, - Transform3D( - RotationZYX(0, 0, 0), - Position( - 0., - 0., - slice_z - ) - ) - ); + pv = layer_vol.placeVolume(slice_vol, + Transform3D(RotationZYX(0, 0, 0), Position(0., 0., slice_z))); pv.addPhysVolID("slice", slice_num); - slice_z += slice_thickness/2.; + slice_z += slice_thickness / 2.; z_distance_traversed += slice_thickness; ++slice_num; } // Setting layer attributes - layer_vol.setAttributes( - desc, - x_layer.regionStr(), - x_layer.limitsStr(), - x_layer.visStr() - ); + layer_vol.setAttributes(desc, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr()); // Placing each layer inside the envelope volume // -length/2. is front of detector in global coordinate system // + (z_distance_traversed - layer_thickness) goes to the front of each layer @@ -129,26 +100,21 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens // Adding layer_thickness/2. goes to half the first layer thickness (proper place to put layer) // Each loop over repeat will increases z_distance_traversed by layer_thickness pv = envelopeVol.placeVolume( - layer_vol, - Transform3D( - RotationZYX(0, 0, 0), - Position( - 0., - 0., - -length/2. + (z_distance_traversed - layer_thickness) + layer_thickness/2. - ) - ) - ); + layer_vol, Transform3D(RotationZYX(0, 0, 0), + Position(0., 0., + -length / 2. + (z_distance_traversed - layer_thickness) + + layer_thickness / 2.))); pv.addPhysVolID("layer", layer_num); layer_num++; } } - DetElement det(detName, detID); + DetElement det(detName, detID); Volume motherVol = desc.pickMotherVolume(det); // Placing ZDC in world volume - auto tr = Transform3D(RotationZYX(rot.z(), rot.y(), rot.x()),Position(pos.x(), pos.y(), pos.z())); + auto tr = + Transform3D(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); PlacedVolume phv = motherVol.placeVolume(envelopeVol, tr); phv.addPhysVolID("system", detID); det.setPlacement(phv); diff --git a/src/forwardBeamPipeBrazil.cpp b/src/forwardBeamPipeBrazil.cpp index 0feb23991..122181474 100644 --- a/src/forwardBeamPipeBrazil.cpp +++ b/src/forwardBeamPipeBrazil.cpp @@ -9,491 +9,592 @@ using namespace std; using namespace dd4hep; -static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) -{ - - using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); - DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Al = det.material("Aluminum"); - Material m_Be = det.material("Beryllium"); - Material m_SS = det.material("StainlessSteel"); - Material m_vac = det.material("Vacuum"); - string vis_name = x_det.visStr(); - - PlacedVolume pv_assembly; - - double b0_hadron_tube_inner_r = 2.9 * dd4hep::cm; - double b0_hadron_tube_outer_r = 3.1 * dd4hep::cm; - double b0_hadron_tube_length = 120.0 * dd4hep::cm; - - double pipeThickness = 5.0 * dd4hep::mm; - - struct beampipe_dimensions_t { - Double_t length = 0.0; - Double_t innerXRadius = 0.0; - Double_t innerYRadius = 0.0; - Double_t outerXRadius = 0.0; - Double_t outerYRadius = 0.0; - Double_t xCenter = 0.0; - Double_t yCenter = 0.0; - Double_t zCenter = 0.0; - Double_t rotationAngle = 0.0; - }; - - std::vector<beampipe_dimensions_t> beampipe_dimensions; - - double globRotationAngle = -0.0454486856; //This is the angle of the proton orbit from the end of B1APF to the beginning of B2PF - double crossingAngle = -0.025; //relevant for the neutral cone - - double b1APFEndPoint_z = 22062.3828 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm - double b1APFEndPoint_x = 654.3372 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm - - double tmp_endpoint_z = 0.0; - double tmp_endpoint_x = 0.0; - - //forumula -> Z = b1APFEndPoint_z+((0.5*elementLengt)*Cos(globRotationAngle)) - //forumula -> X = b1APFEndPoint_z+((0.5*elementLengt)*Sin(globRotationAngle)) - - //------------------------------------------------------------------------------------ - //Geometry extracted from version 0 VPC drawings shown at the FF preliminary - //design review in February 2024 -- CAD model not available as of April 1st, 2024 - //------------------------------------------------------------------------------------ - - //------------------------------------------------------------------------------------ - //primary pipe after B1APF, before neutral exit window + transition to smaller pipe - //rectangular cross-section!!!!! - //------------------------------------------------------------------------------------ - - - beampipe_dimensions.push_back({ - .length = 7615.486 * dd4hep::mm, //from VPC drawings, in mm - .innerXRadius = 275.0 * dd4hep::mm, - .innerYRadius = 175.0 * dd4hep::mm, - .rotationAngle = globRotationAngle - }); - - beampipe_dimensions[0].outerXRadius = beampipe_dimensions[0].innerXRadius + pipeThickness; - beampipe_dimensions[0].outerYRadius = beampipe_dimensions[0].innerYRadius + pipeThickness; - beampipe_dimensions[0].xCenter = -1*(b1APFEndPoint_x+((0.5*beampipe_dimensions[0].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[0].yCenter = 0.0; - beampipe_dimensions[0].zCenter = (b1APFEndPoint_z+((0.5*beampipe_dimensions[0].length)*TMath::Cos(-globRotationAngle))); - - tmp_endpoint_z = beampipe_dimensions[0].zCenter+((0.5*beampipe_dimensions[0].length)*TMath::Cos(-globRotationAngle)); - tmp_endpoint_x = -1*beampipe_dimensions[0].xCenter+((0.5*beampipe_dimensions[0].length)*TMath::Sin(-globRotationAngle)); - - double windowRadius = 110.0 * dd4hep::mm; - - - //------------------------------------------------------------------------------------ - //first small pipe section, between primary vessel and RP station 1 - //rectangular cross-section!!!!! - //------------------------------------------------------------------------------------ - - beampipe_dimensions.push_back({ - .length = 2780.273 * dd4hep::mm, // from VPC drawings - .innerXRadius = 150.0 * dd4hep::mm, - .innerYRadius = 30.0 * dd4hep::mm, - .rotationAngle = globRotationAngle - }); - - beampipe_dimensions[1].outerXRadius = beampipe_dimensions[1].innerXRadius + pipeThickness; - beampipe_dimensions[1].outerYRadius = beampipe_dimensions[1].innerYRadius + pipeThickness; - beampipe_dimensions[1].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[1].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[1].yCenter = 0.0; - beampipe_dimensions[1].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[1].length)*TMath::Cos(-globRotationAngle)); - - tmp_endpoint_z = beampipe_dimensions[1].zCenter+((0.5*beampipe_dimensions[1].length)*TMath::Cos(-globRotationAngle)); - tmp_endpoint_x = -1*beampipe_dimensions[1].xCenter+((0.5*beampipe_dimensions[1].length)*TMath::Sin(-globRotationAngle)); - - //------------------------------------------------------------------------------------ - //First roman pots scattering chamber - //------------------------------------------------------------------------------------ - - beampipe_dimensions.push_back({ - .length = 200 * dd4hep::mm, // from VPC drawings - .innerXRadius = 200.0 * dd4hep::mm, - .innerYRadius = 125.0 * dd4hep::mm, - .rotationAngle = globRotationAngle - }); - - beampipe_dimensions[2].outerXRadius = beampipe_dimensions[2].innerXRadius + pipeThickness; - beampipe_dimensions[2].outerYRadius = beampipe_dimensions[2].innerYRadius + pipeThickness; - beampipe_dimensions[2].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[2].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[2].yCenter = 0.0; - beampipe_dimensions[2].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[2].length)*TMath::Cos(-globRotationAngle)); - - tmp_endpoint_z = beampipe_dimensions[2].zCenter+((0.5*beampipe_dimensions[2].length)*TMath::Cos(-globRotationAngle)); - tmp_endpoint_x = -1*beampipe_dimensions[2].xCenter+((0.5*beampipe_dimensions[2].length)*TMath::Sin(-globRotationAngle)); - - //------------------------------------------------------------------------------------ - //pipe between RP 1 and RP 2 stations - //rectangular cross-section!!!!! - //------------------------------------------------------------------------------------ - - - beampipe_dimensions.push_back({ - .length = 1500.0 * dd4hep::mm, // from VPC drawings - .innerXRadius = 150.0 * dd4hep::mm, - .innerYRadius = 30.0 * dd4hep::mm, - .rotationAngle = globRotationAngle - }); - - beampipe_dimensions[3].outerXRadius = beampipe_dimensions[3].innerXRadius + pipeThickness; - beampipe_dimensions[3].outerYRadius = beampipe_dimensions[3].innerYRadius + pipeThickness; - beampipe_dimensions[3].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[3].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[3].yCenter = 0.0; - beampipe_dimensions[3].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[3].length)*TMath::Cos(-globRotationAngle)); - - tmp_endpoint_z = beampipe_dimensions[3].zCenter+((0.5*beampipe_dimensions[3].length)*TMath::Cos(-globRotationAngle)); - tmp_endpoint_x = -1*beampipe_dimensions[3].xCenter+((0.5*beampipe_dimensions[3].length)*TMath::Sin(-globRotationAngle)); - - //------------------------------------------------------------------------------------ - //second roman pots scattering chamber - //------------------------------------------------------------------------------------ - - - beampipe_dimensions.push_back({ - .length = 200 * dd4hep::mm, // from VPC drawings - .innerXRadius = 200.0 * dd4hep::mm, - .innerYRadius = 125.0 * dd4hep::mm, - .rotationAngle = globRotationAngle - }); - - beampipe_dimensions[4].outerXRadius = beampipe_dimensions[4].innerXRadius + pipeThickness; - beampipe_dimensions[4].outerYRadius = beampipe_dimensions[4].innerYRadius + pipeThickness; - beampipe_dimensions[4].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[4].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[4].yCenter = 0.0; - beampipe_dimensions[4].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[4].length)*TMath::Cos(-globRotationAngle)); - - tmp_endpoint_z = beampipe_dimensions[4].zCenter+((0.5*beampipe_dimensions[4].length)*TMath::Cos(-globRotationAngle)); - tmp_endpoint_x = -1*beampipe_dimensions[4].xCenter+((0.5*beampipe_dimensions[4].length)*TMath::Sin(-globRotationAngle)); - - //------------------------------------------------------------------------------------ - // Pipe from second RP chamber to taper - //------------------------------------------------------------------------------------ - - - beampipe_dimensions.push_back({ - .length = 100.0 * dd4hep::mm, // from VPC drawings - .innerXRadius = 150.0 * dd4hep::mm, - .innerYRadius = 30.0 * dd4hep::mm, - .rotationAngle = globRotationAngle - }); - - beampipe_dimensions[5].outerXRadius = beampipe_dimensions[5].innerXRadius + pipeThickness; - beampipe_dimensions[5].outerYRadius = beampipe_dimensions[5].innerYRadius + pipeThickness; - beampipe_dimensions[5].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[5].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[5].yCenter = 0.0; - beampipe_dimensions[5].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[5].length)*TMath::Cos(-globRotationAngle)); - - tmp_endpoint_z = beampipe_dimensions[5].zCenter+((0.5*beampipe_dimensions[5].length)*TMath::Cos(-globRotationAngle)); - tmp_endpoint_x = -1*beampipe_dimensions[5].xCenter+((0.5*beampipe_dimensions[5].length)*TMath::Sin(-globRotationAngle)); - - //------------------------------------------------------------------------------------ - // taper near ZDC - //------------------------------------------------------------------------------------ - - - beampipe_dimensions.push_back({ - .length = 599.692 * dd4hep::mm, // from VPC drawings - .innerXRadius = 150.0 * dd4hep::mm, - .innerYRadius = 30.0 * dd4hep::mm, - .rotationAngle = globRotationAngle - - }); - - beampipe_dimensions[6].outerXRadius = beampipe_dimensions[6].innerXRadius + pipeThickness; - beampipe_dimensions[6].outerYRadius = beampipe_dimensions[6].innerYRadius + pipeThickness; - beampipe_dimensions[6].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[6].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[6].yCenter = 0.0; - beampipe_dimensions[6].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[6].length)*TMath::Cos(-globRotationAngle)); - - tmp_endpoint_z = beampipe_dimensions[6].zCenter+((0.5*beampipe_dimensions[6].length)*TMath::Cos(-globRotationAngle)); - tmp_endpoint_x = -1*beampipe_dimensions[6].xCenter+((0.5*beampipe_dimensions[6].length)*TMath::Sin(-globRotationAngle)); - - //------------------------------------------------------------------------------------ - // pipe connecting taper to B2PF magnet, just past ZDC - //------------------------------------------------------------------------------------ - - //numbers here are not really correct for the full taper, just for the opening - - beampipe_dimensions.push_back({ - .length = 3000.0 * dd4hep::mm, // from VPC drawings - .innerXRadius = 35.0 * dd4hep::mm, - .innerYRadius = 0.0, - .rotationAngle = globRotationAngle - }); - - beampipe_dimensions[7].outerXRadius = beampipe_dimensions[7].innerXRadius + pipeThickness; - beampipe_dimensions[7].outerYRadius = beampipe_dimensions[7].innerYRadius + pipeThickness; //NOT USED HERE - beampipe_dimensions[7].xCenter = -1*(tmp_endpoint_x+((0.5*beampipe_dimensions[7].length)*TMath::Sin(-globRotationAngle))); - beampipe_dimensions[7].yCenter = 0.0; - beampipe_dimensions[7].zCenter = tmp_endpoint_z+((0.5*beampipe_dimensions[7].length)*TMath::Cos(-globRotationAngle)); - - - //------------------------------------------ - //begin building main volumes here - //------------------------------------------ - - //------------------------------------------------------------------- - - int pieceIdx = 0; //Larger, rectangular pipe transporting proton and neutral envelopes (neutral exit window and transfer to smaller proton line at the end) - - Box pipeAfterB1APF_outer(beampipe_dimensions[pieceIdx].outerXRadius, beampipe_dimensions[pieceIdx].outerYRadius, beampipe_dimensions[pieceIdx].length/2); - Box pipeAfterB1APF_inner(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, (beampipe_dimensions[pieceIdx].length)/2); - Box pipeAfterB1APF_firstEndCap(beampipe_dimensions[pieceIdx].outerXRadius, beampipe_dimensions[pieceIdx].outerYRadius, 5.0/2.0); - Tube neutral_exit_window_cutout(0.0, windowRadius, 1.0); // 1.0cm thick - //FIXME: proton transfer window is done by hand right now - not a nicer way to do it until we get the CAD drawing - Box protonTransferWindow(155.0 * dd4hep::mm, beampipe_dimensions[1].outerYRadius, (5.0/2)); - - SubtractionSolid tmpAfterB1APF(pipeAfterB1APF_outer, pipeAfterB1APF_inner); //This gets rid of the inner portion of the pipe, but leaves the endcaps - tmpAfterB1APF = SubtractionSolid(tmpAfterB1APF, pipeAfterB1APF_firstEndCap, Position(0.0, 0.0, (-beampipe_dimensions[pieceIdx].length)/2)); - tmpAfterB1APF = SubtractionSolid(tmpAfterB1APF, protonTransferWindow, Position((-120.0 * dd4hep::mm), 0.0, (beampipe_dimensions[pieceIdx].length)/2 )); - tmpAfterB1APF = SubtractionSolid(tmpAfterB1APF, neutral_exit_window_cutout, Position(160.0 * dd4hep::mm, 0.0, 0.5*beampipe_dimensions[pieceIdx].length)); - - Volume v_pipeAfterB1APF(Form("v_pipeAfterB1APF_%d", pieceIdx), tmpAfterB1APF, m_SS); - sdet.setAttributes(det, v_pipeAfterB1APF, x_det.regionStr(), x_det.limitsStr(), vis_name); - - auto pv_pipe_0 = assembly.placeVolume(v_pipeAfterB1APF, Transform3D(RotationY(crossingAngle), Position(beampipe_dimensions[pieceIdx].xCenter + 4.0, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); // 2353.06094))); - pv_pipe_0.addPhysVolID("sector", 1); - DetElement pipe_de_0(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); - pipe_de_0.setPlacement(pv_pipe_0); - - //-------------------------------------------------------------------- - - double lengthDelta = 0.0; //over-length value to remove end-pieces for hollow rectangular pipes - - // 1 -- small pipe connecting big pipe to RP station 1 - // 2 -- roman pots scattering chamber 1 - // 3 -- small pipe connecting RP1 and RP2 - // 4 -- roman pots scattering chamber 2 - // 5 -- small pipe connecting RP2 to ZDC taper - - lengthDelta = 5.0; //for small beam pipes to remove endcaps - - for(int idx = 1; idx < 6; idx++){ //loop for the easier pieces to simplify - - if(idx == 2 || idx == 4){ continue;} - - Box outer(beampipe_dimensions[idx].outerXRadius, beampipe_dimensions[idx].outerYRadius, beampipe_dimensions[idx].length/2); - Box inner(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, (beampipe_dimensions[idx].length+lengthDelta)/2); - - SubtractionSolid hollow_pipe(outer, inner); - - Volume v_hollow_pipe(Form("v_pipe_%d", idx), hollow_pipe, m_SS); - sdet.setAttributes(det, v_hollow_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); - - auto pv_final = assembly.placeVolume(v_hollow_pipe, Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, beampipe_dimensions[idx].zCenter))); - pv_final.addPhysVolID("sector", 1); - DetElement final_de(sdet, Form("sector_pipe_%d_de", idx), 1); - final_de.setPlacement(pv_final); - +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) { + + using namespace ROOT::Math; + xml_det_t x_det = e; + string det_name = x_det.nameStr(); + DetElement sdet(det_name, x_det.id()); + Assembly assembly(det_name + "_assembly"); + Material m_Al = det.material("Aluminum"); + Material m_Be = det.material("Beryllium"); + Material m_SS = det.material("StainlessSteel"); + Material m_vac = det.material("Vacuum"); + string vis_name = x_det.visStr(); + + PlacedVolume pv_assembly; + + double b0_hadron_tube_inner_r = 2.9 * dd4hep::cm; + double b0_hadron_tube_outer_r = 3.1 * dd4hep::cm; + double b0_hadron_tube_length = 120.0 * dd4hep::cm; + + double pipeThickness = 5.0 * dd4hep::mm; + + struct beampipe_dimensions_t { + Double_t length = 0.0; + Double_t innerXRadius = 0.0; + Double_t innerYRadius = 0.0; + Double_t outerXRadius = 0.0; + Double_t outerYRadius = 0.0; + Double_t xCenter = 0.0; + Double_t yCenter = 0.0; + Double_t zCenter = 0.0; + Double_t rotationAngle = 0.0; + }; + + std::vector<beampipe_dimensions_t> beampipe_dimensions; + + double globRotationAngle = + -0.0454486856; //This is the angle of the proton orbit from the end of B1APF to the beginning of B2PF + double crossingAngle = -0.025; //relevant for the neutral cone + + double b1APFEndPoint_z = + 22062.3828 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm + double b1APFEndPoint_x = 654.3372 * dd4hep::mm; //location of proton orbit at b1APF exit -- in mm + + double tmp_endpoint_z = 0.0; + double tmp_endpoint_x = 0.0; + + //forumula -> Z = b1APFEndPoint_z+((0.5*elementLengt)*Cos(globRotationAngle)) + //forumula -> X = b1APFEndPoint_z+((0.5*elementLengt)*Sin(globRotationAngle)) + + //------------------------------------------------------------------------------------ + //Geometry extracted from version 0 VPC drawings shown at the FF preliminary + //design review in February 2024 -- CAD model not available as of April 1st, 2024 + //------------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------------ + //primary pipe after B1APF, before neutral exit window + transition to smaller pipe + //rectangular cross-section!!!!! + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({.length = 7615.486 * dd4hep::mm, //from VPC drawings, in mm + .innerXRadius = 275.0 * dd4hep::mm, + .innerYRadius = 175.0 * dd4hep::mm, + .rotationAngle = globRotationAngle}); + + beampipe_dimensions[0].outerXRadius = beampipe_dimensions[0].innerXRadius + pipeThickness; + beampipe_dimensions[0].outerYRadius = beampipe_dimensions[0].innerYRadius + pipeThickness; + beampipe_dimensions[0].xCenter = + -1 * + (b1APFEndPoint_x + ((0.5 * beampipe_dimensions[0].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[0].yCenter = 0.0; + beampipe_dimensions[0].zCenter = + (b1APFEndPoint_z + ((0.5 * beampipe_dimensions[0].length) * TMath::Cos(-globRotationAngle))); + + tmp_endpoint_z = beampipe_dimensions[0].zCenter + + ((0.5 * beampipe_dimensions[0].length) * TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1 * beampipe_dimensions[0].xCenter + + ((0.5 * beampipe_dimensions[0].length) * TMath::Sin(-globRotationAngle)); + + double windowRadius = 110.0 * dd4hep::mm; + + //------------------------------------------------------------------------------------ + //first small pipe section, between primary vessel and RP station 1 + //rectangular cross-section!!!!! + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({.length = 2780.273 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle}); + + beampipe_dimensions[1].outerXRadius = beampipe_dimensions[1].innerXRadius + pipeThickness; + beampipe_dimensions[1].outerYRadius = beampipe_dimensions[1].innerYRadius + pipeThickness; + beampipe_dimensions[1].xCenter = + -1 * + (tmp_endpoint_x + ((0.5 * beampipe_dimensions[1].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[1].yCenter = 0.0; + beampipe_dimensions[1].zCenter = + tmp_endpoint_z + ((0.5 * beampipe_dimensions[1].length) * TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[1].zCenter + + ((0.5 * beampipe_dimensions[1].length) * TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1 * beampipe_dimensions[1].xCenter + + ((0.5 * beampipe_dimensions[1].length) * TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + //First roman pots scattering chamber + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({.length = 200 * dd4hep::mm, // from VPC drawings + .innerXRadius = 200.0 * dd4hep::mm, + .innerYRadius = 125.0 * dd4hep::mm, + .rotationAngle = globRotationAngle}); + + beampipe_dimensions[2].outerXRadius = beampipe_dimensions[2].innerXRadius + pipeThickness; + beampipe_dimensions[2].outerYRadius = beampipe_dimensions[2].innerYRadius + pipeThickness; + beampipe_dimensions[2].xCenter = + -1 * + (tmp_endpoint_x + ((0.5 * beampipe_dimensions[2].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[2].yCenter = 0.0; + beampipe_dimensions[2].zCenter = + tmp_endpoint_z + ((0.5 * beampipe_dimensions[2].length) * TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[2].zCenter + + ((0.5 * beampipe_dimensions[2].length) * TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1 * beampipe_dimensions[2].xCenter + + ((0.5 * beampipe_dimensions[2].length) * TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + //pipe between RP 1 and RP 2 stations + //rectangular cross-section!!!!! + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({.length = 1500.0 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle}); + + beampipe_dimensions[3].outerXRadius = beampipe_dimensions[3].innerXRadius + pipeThickness; + beampipe_dimensions[3].outerYRadius = beampipe_dimensions[3].innerYRadius + pipeThickness; + beampipe_dimensions[3].xCenter = + -1 * + (tmp_endpoint_x + ((0.5 * beampipe_dimensions[3].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[3].yCenter = 0.0; + beampipe_dimensions[3].zCenter = + tmp_endpoint_z + ((0.5 * beampipe_dimensions[3].length) * TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[3].zCenter + + ((0.5 * beampipe_dimensions[3].length) * TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1 * beampipe_dimensions[3].xCenter + + ((0.5 * beampipe_dimensions[3].length) * TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + //second roman pots scattering chamber + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({.length = 200 * dd4hep::mm, // from VPC drawings + .innerXRadius = 200.0 * dd4hep::mm, + .innerYRadius = 125.0 * dd4hep::mm, + .rotationAngle = globRotationAngle}); + + beampipe_dimensions[4].outerXRadius = beampipe_dimensions[4].innerXRadius + pipeThickness; + beampipe_dimensions[4].outerYRadius = beampipe_dimensions[4].innerYRadius + pipeThickness; + beampipe_dimensions[4].xCenter = + -1 * + (tmp_endpoint_x + ((0.5 * beampipe_dimensions[4].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[4].yCenter = 0.0; + beampipe_dimensions[4].zCenter = + tmp_endpoint_z + ((0.5 * beampipe_dimensions[4].length) * TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[4].zCenter + + ((0.5 * beampipe_dimensions[4].length) * TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1 * beampipe_dimensions[4].xCenter + + ((0.5 * beampipe_dimensions[4].length) * TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + // Pipe from second RP chamber to taper + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({.length = 100.0 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle}); + + beampipe_dimensions[5].outerXRadius = beampipe_dimensions[5].innerXRadius + pipeThickness; + beampipe_dimensions[5].outerYRadius = beampipe_dimensions[5].innerYRadius + pipeThickness; + beampipe_dimensions[5].xCenter = + -1 * + (tmp_endpoint_x + ((0.5 * beampipe_dimensions[5].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[5].yCenter = 0.0; + beampipe_dimensions[5].zCenter = + tmp_endpoint_z + ((0.5 * beampipe_dimensions[5].length) * TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[5].zCenter + + ((0.5 * beampipe_dimensions[5].length) * TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1 * beampipe_dimensions[5].xCenter + + ((0.5 * beampipe_dimensions[5].length) * TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + // taper near ZDC + //------------------------------------------------------------------------------------ + + beampipe_dimensions.push_back({.length = 599.692 * dd4hep::mm, // from VPC drawings + .innerXRadius = 150.0 * dd4hep::mm, + .innerYRadius = 30.0 * dd4hep::mm, + .rotationAngle = globRotationAngle + + }); + + beampipe_dimensions[6].outerXRadius = beampipe_dimensions[6].innerXRadius + pipeThickness; + beampipe_dimensions[6].outerYRadius = beampipe_dimensions[6].innerYRadius + pipeThickness; + beampipe_dimensions[6].xCenter = + -1 * + (tmp_endpoint_x + ((0.5 * beampipe_dimensions[6].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[6].yCenter = 0.0; + beampipe_dimensions[6].zCenter = + tmp_endpoint_z + ((0.5 * beampipe_dimensions[6].length) * TMath::Cos(-globRotationAngle)); + + tmp_endpoint_z = beampipe_dimensions[6].zCenter + + ((0.5 * beampipe_dimensions[6].length) * TMath::Cos(-globRotationAngle)); + tmp_endpoint_x = -1 * beampipe_dimensions[6].xCenter + + ((0.5 * beampipe_dimensions[6].length) * TMath::Sin(-globRotationAngle)); + + //------------------------------------------------------------------------------------ + // pipe connecting taper to B2PF magnet, just past ZDC + //------------------------------------------------------------------------------------ + + //numbers here are not really correct for the full taper, just for the opening + + beampipe_dimensions.push_back({.length = 3000.0 * dd4hep::mm, // from VPC drawings + .innerXRadius = 35.0 * dd4hep::mm, + .innerYRadius = 0.0, + .rotationAngle = globRotationAngle}); + + beampipe_dimensions[7].outerXRadius = beampipe_dimensions[7].innerXRadius + pipeThickness; + beampipe_dimensions[7].outerYRadius = + beampipe_dimensions[7].innerYRadius + pipeThickness; //NOT USED HERE + beampipe_dimensions[7].xCenter = + -1 * + (tmp_endpoint_x + ((0.5 * beampipe_dimensions[7].length) * TMath::Sin(-globRotationAngle))); + beampipe_dimensions[7].yCenter = 0.0; + beampipe_dimensions[7].zCenter = + tmp_endpoint_z + ((0.5 * beampipe_dimensions[7].length) * TMath::Cos(-globRotationAngle)); + + //------------------------------------------ + //begin building main volumes here + //------------------------------------------ + + //------------------------------------------------------------------- + + int pieceIdx = + 0; //Larger, rectangular pipe transporting proton and neutral envelopes (neutral exit window and transfer to smaller proton line at the end) + + Box pipeAfterB1APF_outer(beampipe_dimensions[pieceIdx].outerXRadius, + beampipe_dimensions[pieceIdx].outerYRadius, + beampipe_dimensions[pieceIdx].length / 2); + Box pipeAfterB1APF_inner(beampipe_dimensions[pieceIdx].innerXRadius, + beampipe_dimensions[pieceIdx].innerYRadius, + (beampipe_dimensions[pieceIdx].length) / 2); + Box pipeAfterB1APF_firstEndCap(beampipe_dimensions[pieceIdx].outerXRadius, + beampipe_dimensions[pieceIdx].outerYRadius, 5.0 / 2.0); + Tube neutral_exit_window_cutout(0.0, windowRadius, 1.0); // 1.0cm thick + //FIXME: proton transfer window is done by hand right now - not a nicer way to do it until we get the CAD drawing + Box protonTransferWindow(155.0 * dd4hep::mm, beampipe_dimensions[1].outerYRadius, (5.0 / 2)); + + SubtractionSolid tmpAfterB1APF( + pipeAfterB1APF_outer, + pipeAfterB1APF_inner); //This gets rid of the inner portion of the pipe, but leaves the endcaps + tmpAfterB1APF = SubtractionSolid(tmpAfterB1APF, pipeAfterB1APF_firstEndCap, + Position(0.0, 0.0, (-beampipe_dimensions[pieceIdx].length) / 2)); + tmpAfterB1APF = SubtractionSolid( + tmpAfterB1APF, protonTransferWindow, + Position((-120.0 * dd4hep::mm), 0.0, (beampipe_dimensions[pieceIdx].length) / 2)); + tmpAfterB1APF = SubtractionSolid( + tmpAfterB1APF, neutral_exit_window_cutout, + Position(160.0 * dd4hep::mm, 0.0, 0.5 * beampipe_dimensions[pieceIdx].length)); + + Volume v_pipeAfterB1APF(Form("v_pipeAfterB1APF_%d", pieceIdx), tmpAfterB1APF, m_SS); + sdet.setAttributes(det, v_pipeAfterB1APF, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_0 = assembly.placeVolume( + v_pipeAfterB1APF, + Transform3D(RotationY(crossingAngle), + Position(beampipe_dimensions[pieceIdx].xCenter + 4.0, + beampipe_dimensions[pieceIdx].yCenter, + beampipe_dimensions[pieceIdx].zCenter))); // 2353.06094))); + pv_pipe_0.addPhysVolID("sector", 1); + DetElement pipe_de_0(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_0.setPlacement(pv_pipe_0); + + //-------------------------------------------------------------------- + + double lengthDelta = 0.0; //over-length value to remove end-pieces for hollow rectangular pipes + + // 1 -- small pipe connecting big pipe to RP station 1 + // 2 -- roman pots scattering chamber 1 + // 3 -- small pipe connecting RP1 and RP2 + // 4 -- roman pots scattering chamber 2 + // 5 -- small pipe connecting RP2 to ZDC taper + + lengthDelta = 5.0; //for small beam pipes to remove endcaps + + for (int idx = 1; idx < 6; idx++) { //loop for the easier pieces to simplify + + if (idx == 2 || idx == 4) { + continue; } - lengthDelta = 0.0; //not needed for scattering chambers - - for(int idx = 1; idx < 6; idx++){ //loop for the easier pieces to simplify + Box outer(beampipe_dimensions[idx].outerXRadius, beampipe_dimensions[idx].outerYRadius, + beampipe_dimensions[idx].length / 2); + Box inner(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, + (beampipe_dimensions[idx].length + lengthDelta) / 2); - if(idx == 1 || idx == 3 || idx == 5){ continue;} + SubtractionSolid hollow_pipe(outer, inner); - Box outer(beampipe_dimensions[idx].outerXRadius, beampipe_dimensions[idx].outerYRadius, beampipe_dimensions[idx].length/2); - Box inner(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, (beampipe_dimensions[idx].length+lengthDelta)/2); - Box RP_subtract_outer(beampipe_dimensions[1].outerXRadius, beampipe_dimensions[1].outerYRadius, (beampipe_dimensions[2].length+5.0)/2); + Volume v_hollow_pipe(Form("v_pipe_%d", idx), hollow_pipe, m_SS); + sdet.setAttributes(det, v_hollow_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); - SubtractionSolid hollow_pipe(outer, inner); - hollow_pipe = SubtractionSolid(hollow_pipe, RP_subtract_outer); + auto pv_final = assembly.placeVolume( + v_hollow_pipe, + Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), + Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, + beampipe_dimensions[idx].zCenter))); + pv_final.addPhysVolID("sector", 1); + DetElement final_de(sdet, Form("sector_pipe_%d_de", idx), 1); + final_de.setPlacement(pv_final); + } - Volume v_hollow_pipe(Form("v_pipe_%d", idx), hollow_pipe, m_SS); - sdet.setAttributes(det, v_hollow_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); + lengthDelta = 0.0; //not needed for scattering chambers - auto pv_final = assembly.placeVolume(v_hollow_pipe, Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, beampipe_dimensions[idx].zCenter))); - pv_final.addPhysVolID("sector", 1); - DetElement final_de(sdet, Form("sector_pipe_%d_de", idx), 1); - final_de.setPlacement(pv_final); + for (int idx = 1; idx < 6; idx++) { //loop for the easier pieces to simplify + if (idx == 1 || idx == 3 || idx == 5) { + continue; } - //---------------------------------------------------------------- + Box outer(beampipe_dimensions[idx].outerXRadius, beampipe_dimensions[idx].outerYRadius, + beampipe_dimensions[idx].length / 2); + Box inner(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, + (beampipe_dimensions[idx].length + lengthDelta) / 2); + Box RP_subtract_outer(beampipe_dimensions[1].outerXRadius, beampipe_dimensions[1].outerYRadius, + (beampipe_dimensions[2].length + 5.0) / 2); - pieceIdx = 6; + SubtractionSolid hollow_pipe(outer, inner); + hollow_pipe = SubtractionSolid(hollow_pipe, RP_subtract_outer); - Double_t trpVertices[16]; - Double_t trpVerticesInner[16]; - //(x0, y0, x1, y1, ... , x7, y7) - //opening side - larger size - trpVertices[0] = -beampipe_dimensions[6].outerXRadius; - trpVertices[1] = -beampipe_dimensions[6].outerYRadius; + Volume v_hollow_pipe(Form("v_pipe_%d", idx), hollow_pipe, m_SS); + sdet.setAttributes(det, v_hollow_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); - trpVertices[2] = -beampipe_dimensions[6].outerXRadius; - trpVertices[3] = beampipe_dimensions[6].outerYRadius; + auto pv_final = assembly.placeVolume( + v_hollow_pipe, + Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), + Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, + beampipe_dimensions[idx].zCenter))); + pv_final.addPhysVolID("sector", 1); + DetElement final_de(sdet, Form("sector_pipe_%d_de", idx), 1); + final_de.setPlacement(pv_final); + } - trpVertices[4] = beampipe_dimensions[6].outerXRadius; - trpVertices[5] = beampipe_dimensions[6].outerYRadius; + //---------------------------------------------------------------- - trpVertices[6] = beampipe_dimensions[6].outerXRadius; - trpVertices[7] = -beampipe_dimensions[6].outerYRadius; + pieceIdx = 6; - //exiting side - smaller size + Double_t trpVertices[16]; + Double_t trpVerticesInner[16]; + //(x0, y0, x1, y1, ... , x7, y7) + //opening side - larger size + trpVertices[0] = -beampipe_dimensions[6].outerXRadius; + trpVertices[1] = -beampipe_dimensions[6].outerYRadius; - trpVertices[8] = -beampipe_dimensions[6].outerYRadius; - trpVertices[9] = -beampipe_dimensions[6].outerYRadius; + trpVertices[2] = -beampipe_dimensions[6].outerXRadius; + trpVertices[3] = beampipe_dimensions[6].outerYRadius; - trpVertices[10] = -beampipe_dimensions[6].outerYRadius; - trpVertices[11] = beampipe_dimensions[6].outerYRadius; + trpVertices[4] = beampipe_dimensions[6].outerXRadius; + trpVertices[5] = beampipe_dimensions[6].outerYRadius; - trpVertices[12] = beampipe_dimensions[6].outerYRadius; - trpVertices[13] = beampipe_dimensions[6].outerYRadius; - - trpVertices[14] = beampipe_dimensions[6].outerYRadius; - trpVertices[15] = -beampipe_dimensions[6].outerYRadius; - - for(int i = 0; i < 16; i++){ - - if(trpVertices[i] > 0.0){trpVerticesInner[i] = trpVertices[i]-(pipeThickness);} - if(trpVertices[i] < 0.0){trpVerticesInner[i] = trpVertices[i]+(pipeThickness);} - - } + trpVertices[6] = beampipe_dimensions[6].outerXRadius; + trpVertices[7] = -beampipe_dimensions[6].outerYRadius; - EightPointSolid taper_outer((0.5*beampipe_dimensions[pieceIdx].length), trpVertices); - EightPointSolid taper_inner((0.5*beampipe_dimensions[pieceIdx].length), trpVerticesInner); + //exiting side - smaller size - Box taper_entrance(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, (0.5*(pipeThickness + 5.0))); - Box taper_exit(beampipe_dimensions[pieceIdx].innerYRadius, beampipe_dimensions[pieceIdx].innerYRadius, (0.5*(pipeThickness + 5.0))); - SubtractionSolid hollowTaper(taper_outer, taper_inner); - hollowTaper = SubtractionSolid(hollowTaper, taper_entrance, Position(0.0, 0.0, (-0.5*beampipe_dimensions[pieceIdx].length))); - hollowTaper = SubtractionSolid(hollowTaper, taper_exit, Position(0.0, 0.0, (0.5*beampipe_dimensions[pieceIdx].length))); + trpVertices[8] = -beampipe_dimensions[6].outerYRadius; + trpVertices[9] = -beampipe_dimensions[6].outerYRadius; - Volume v_taper(Form("v_taper_%d", pieceIdx), hollowTaper, m_SS); - sdet.setAttributes(det, v_taper, x_det.regionStr(), x_det.limitsStr(), vis_name); + trpVertices[10] = -beampipe_dimensions[6].outerYRadius; + trpVertices[11] = beampipe_dimensions[6].outerYRadius; - auto pv_pipe_6 = assembly.placeVolume(v_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position(beampipe_dimensions[pieceIdx].xCenter, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); - pv_pipe_6.addPhysVolID("sector", 1); - DetElement pipe_de_6(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); - pipe_de_6.setPlacement(pv_pipe_6); + trpVertices[12] = beampipe_dimensions[6].outerYRadius; + trpVertices[13] = beampipe_dimensions[6].outerYRadius; - //--------------------------------------------------------------- + trpVertices[14] = beampipe_dimensions[6].outerYRadius; + trpVertices[15] = -beampipe_dimensions[6].outerYRadius; - pieceIdx = 7; //pipe between taper and B2PF - - Tube pipe_after_taper(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].outerXRadius, beampipe_dimensions[pieceIdx].length/2); - - Volume v_pipe_7(Form("v_pipe_7_%d", pieceIdx), pipe_after_taper, m_SS); - sdet.setAttributes(det, v_pipe_7, x_det.regionStr(), x_det.limitsStr(), vis_name); - - auto pv_pipe_7 = assembly.placeVolume(v_pipe_7, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position(beampipe_dimensions[pieceIdx].xCenter, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); // 2353.06094))); - pv_pipe_7.addPhysVolID("sector", 1); - DetElement pipe_de_7(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); - pipe_de_7.setPlacement(pv_pipe_7); - - - //-------------------------------------------------------------- - // This is the beam tube in the B0 magnet for the hadron beam - // doesn't use the slope information calculated before - it stands alone - - pieceIdx = 8; - - Tube b0_hadron_tube(b0_hadron_tube_inner_r, b0_hadron_tube_outer_r, b0_hadron_tube_length / 2.0); - Volume v_b0_hadron_tube("v_b0_hadron_tube", b0_hadron_tube, m_Be); - sdet.setAttributes(det, v_b0_hadron_tube, x_det.regionStr(), x_det.limitsStr(), vis_name); - - auto pv_pipe_8 = assembly.placeVolume(v_b0_hadron_tube, Transform3D(RotationY(crossingAngle), Position(-16.5, 0.0, 640.0))); // 2353.06094))); - pv_pipe_8.addPhysVolID("sector", 1); - DetElement pipe_de_8(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); - pipe_de_8.setPlacement(pv_pipe_6); - - //---------------------------------------------------------------- - - pieceIdx = 9; //neutral exit window - - Box pipeAfterB1APF_LARGE((beampipe_dimensions[0].outerXRadius+5.0), (beampipe_dimensions[0].outerYRadius+5.0), (beampipe_dimensions[0].length+5.0)/2); - Tube neutral_exit_window(0.0, windowRadius, 1.0); // 1.0cm thick - - IntersectionSolid finalWindow(pipeAfterB1APF_outer, neutral_exit_window, Position(160.0 * dd4hep::mm, 0.0, 0.5*beampipe_dimensions[0].length)); - - Volume v_neutral_exit_window("v_neutral_exit_window", finalWindow, m_Al); - sdet.setAttributes(det, v_neutral_exit_window, x_det.regionStr(), x_det.limitsStr(), "AnlRed"); - - auto pv_pipe_9 = assembly.placeVolume(v_neutral_exit_window, Transform3D(RotationY(crossingAngle), Position( beampipe_dimensions[0].xCenter + 4.0, 0.0, beampipe_dimensions[0].zCenter))); - pv_pipe_9.addPhysVolID("sector", 1); - DetElement pipe_de_9(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); - pipe_de_9.setPlacement(pv_pipe_9); - - //----------------------------------------------------------------- - // Build vacuum volumes here - //----------------------------------------------------------------- - - pieceIdx = 0; - - Box vacuum_main_pipe(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, (beampipe_dimensions[pieceIdx].length-2.0)/2); - Box cutout_for_OMD_station(beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].innerYRadius, 2.0); - - SubtractionSolid final_vacuum_main_pipe(vacuum_main_pipe, cutout_for_OMD_station, Position(0.0, 0.0, (2251.0 - beampipe_dimensions[pieceIdx].zCenter))); - final_vacuum_main_pipe = SubtractionSolid(final_vacuum_main_pipe, cutout_for_OMD_station, Position(0.0, 0.0, (2451.0 - beampipe_dimensions[pieceIdx].zCenter))); - - Volume v_vacuum_main_pipe("v_vacuum_main_pipe", final_vacuum_main_pipe, m_vac); - sdet.setAttributes(det, v_vacuum_main_pipe, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); - - auto pv_vacuum_0 = assembly.placeVolume(v_vacuum_main_pipe, Transform3D(RotationY(crossingAngle), Position( beampipe_dimensions[pieceIdx].xCenter + 4.0, 0.0, beampipe_dimensions[pieceIdx].zCenter))); - pv_vacuum_0.addPhysVolID("sector", 1); - DetElement vacuum_de_0(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); - vacuum_de_0.setPlacement(pv_vacuum_0); - - //------------------------------------------------------------------ - - for(int idx = 1; idx < 6; idx++){ //loop for the easier pieces to simplify - - if(idx == 2 || idx == 4){ continue;} //FIXME: don't fill RP chambers with vacuum yet - still an issue with RP geometry - - Box inner_vacuum(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, (beampipe_dimensions[idx].length)/2); - - Volume v_inner_vacuum(Form("v_vacuum_%d", idx), inner_vacuum, m_vac); - sdet.setAttributes(det, v_inner_vacuum, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); - - auto pv_final = assembly.placeVolume(v_inner_vacuum, Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, beampipe_dimensions[idx].zCenter))); - pv_final.addPhysVolID("sector", 1); - DetElement final_de(sdet, Form("sector_FF_vacuum_%d_de", idx), 1); - final_de.setPlacement(pv_final); + for (int i = 0; i < 16; i++) { + if (trpVertices[i] > 0.0) { + trpVerticesInner[i] = trpVertices[i] - (pipeThickness); } - - //------------------------------------------------------------------ - - pieceIdx = 6; - - EightPointSolid vacuum_taper((0.5*beampipe_dimensions[pieceIdx].length), trpVerticesInner); - - Volume v_vacuum_taper("v_vacuum_taper", vacuum_taper, m_vac); - sdet.setAttributes(det, v_vacuum_taper, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); - - auto pv_vacuum_6 = assembly.placeVolume(v_vacuum_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position( beampipe_dimensions[pieceIdx].xCenter, 0.0, beampipe_dimensions[pieceIdx].zCenter))); - pv_vacuum_6.addPhysVolID("sector", 1); - DetElement vacuum_de_6(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); - vacuum_de_6.setPlacement(pv_vacuum_6); - - //------------------------------------------------------------------- - - pieceIdx = 7; //vacuum between taper and B2PF - - Tube vacuum_pipe_after_taper(0.0, beampipe_dimensions[pieceIdx].innerXRadius, beampipe_dimensions[pieceIdx].length/2); - - Volume v_vacuum_pipe_after_taper("v_vacuum_pipe_after_taper", vacuum_pipe_after_taper, m_vac); - sdet.setAttributes(det, v_vacuum_pipe_after_taper, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); - - auto pv_vacuum_7 = assembly.placeVolume(v_vacuum_pipe_after_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), Position(beampipe_dimensions[pieceIdx].xCenter, beampipe_dimensions[pieceIdx].yCenter, beampipe_dimensions[pieceIdx].zCenter))); - pv_vacuum_7.addPhysVolID("sector", 1); - DetElement vacuum_de_7(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); - vacuum_de_7.setPlacement(pv_vacuum_7); - - //------------------------------------------------------------------- - - pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly); - pv_assembly.addPhysVolID("system", x_det.id()).addPhysVolID("barrel", 1); - sdet.setPlacement(pv_assembly); - assembly->GetShape()->ComputeBBox(); - return sdet; + if (trpVertices[i] < 0.0) { + trpVerticesInner[i] = trpVertices[i] + (pipeThickness); + } + } + + EightPointSolid taper_outer((0.5 * beampipe_dimensions[pieceIdx].length), trpVertices); + EightPointSolid taper_inner((0.5 * beampipe_dimensions[pieceIdx].length), trpVerticesInner); + + Box taper_entrance(beampipe_dimensions[pieceIdx].innerXRadius, + beampipe_dimensions[pieceIdx].innerYRadius, (0.5 * (pipeThickness + 5.0))); + Box taper_exit(beampipe_dimensions[pieceIdx].innerYRadius, + beampipe_dimensions[pieceIdx].innerYRadius, (0.5 * (pipeThickness + 5.0))); + SubtractionSolid hollowTaper(taper_outer, taper_inner); + hollowTaper = SubtractionSolid(hollowTaper, taper_entrance, + Position(0.0, 0.0, (-0.5 * beampipe_dimensions[pieceIdx].length))); + hollowTaper = SubtractionSolid(hollowTaper, taper_exit, + Position(0.0, 0.0, (0.5 * beampipe_dimensions[pieceIdx].length))); + + Volume v_taper(Form("v_taper_%d", pieceIdx), hollowTaper, m_SS); + sdet.setAttributes(det, v_taper, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_6 = assembly.placeVolume( + v_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), + Position(beampipe_dimensions[pieceIdx].xCenter, + beampipe_dimensions[pieceIdx].yCenter, + beampipe_dimensions[pieceIdx].zCenter))); + pv_pipe_6.addPhysVolID("sector", 1); + DetElement pipe_de_6(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_6.setPlacement(pv_pipe_6); + + //--------------------------------------------------------------- + + pieceIdx = 7; //pipe between taper and B2PF + + Tube pipe_after_taper(beampipe_dimensions[pieceIdx].innerXRadius, + beampipe_dimensions[pieceIdx].outerXRadius, + beampipe_dimensions[pieceIdx].length / 2); + + Volume v_pipe_7(Form("v_pipe_7_%d", pieceIdx), pipe_after_taper, m_SS); + sdet.setAttributes(det, v_pipe_7, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_7 = assembly.placeVolume( + v_pipe_7, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), + Position(beampipe_dimensions[pieceIdx].xCenter, + beampipe_dimensions[pieceIdx].yCenter, + beampipe_dimensions[pieceIdx].zCenter))); // 2353.06094))); + pv_pipe_7.addPhysVolID("sector", 1); + DetElement pipe_de_7(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_7.setPlacement(pv_pipe_7); + + //-------------------------------------------------------------- + // This is the beam tube in the B0 magnet for the hadron beam + // doesn't use the slope information calculated before - it stands alone + + pieceIdx = 8; + + Tube b0_hadron_tube(b0_hadron_tube_inner_r, b0_hadron_tube_outer_r, b0_hadron_tube_length / 2.0); + Volume v_b0_hadron_tube("v_b0_hadron_tube", b0_hadron_tube, m_Be); + sdet.setAttributes(det, v_b0_hadron_tube, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe_8 = assembly.placeVolume( + v_b0_hadron_tube, + Transform3D(RotationY(crossingAngle), Position(-16.5, 0.0, 640.0))); // 2353.06094))); + pv_pipe_8.addPhysVolID("sector", 1); + DetElement pipe_de_8(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_8.setPlacement(pv_pipe_6); + + //---------------------------------------------------------------- + + pieceIdx = 9; //neutral exit window + + Box pipeAfterB1APF_LARGE((beampipe_dimensions[0].outerXRadius + 5.0), + (beampipe_dimensions[0].outerYRadius + 5.0), + (beampipe_dimensions[0].length + 5.0) / 2); + Tube neutral_exit_window(0.0, windowRadius, 1.0); // 1.0cm thick + + IntersectionSolid finalWindow( + pipeAfterB1APF_outer, neutral_exit_window, + Position(160.0 * dd4hep::mm, 0.0, 0.5 * beampipe_dimensions[0].length)); + + Volume v_neutral_exit_window("v_neutral_exit_window", finalWindow, m_Al); + sdet.setAttributes(det, v_neutral_exit_window, x_det.regionStr(), x_det.limitsStr(), "AnlRed"); + + auto pv_pipe_9 = assembly.placeVolume( + v_neutral_exit_window, + Transform3D(RotationY(crossingAngle), Position(beampipe_dimensions[0].xCenter + 4.0, 0.0, + beampipe_dimensions[0].zCenter))); + pv_pipe_9.addPhysVolID("sector", 1); + DetElement pipe_de_9(sdet, Form("sector_pipe_%d_de", pieceIdx), 1); + pipe_de_9.setPlacement(pv_pipe_9); + + //----------------------------------------------------------------- + // Build vacuum volumes here + //----------------------------------------------------------------- + + pieceIdx = 0; + + Box vacuum_main_pipe(beampipe_dimensions[pieceIdx].innerXRadius, + beampipe_dimensions[pieceIdx].innerYRadius, + (beampipe_dimensions[pieceIdx].length - 2.0) / 2); + Box cutout_for_OMD_station(beampipe_dimensions[pieceIdx].innerXRadius, + beampipe_dimensions[pieceIdx].innerYRadius, 2.0); + + SubtractionSolid final_vacuum_main_pipe( + vacuum_main_pipe, cutout_for_OMD_station, + Position(0.0, 0.0, (2251.0 - beampipe_dimensions[pieceIdx].zCenter))); + final_vacuum_main_pipe = + SubtractionSolid(final_vacuum_main_pipe, cutout_for_OMD_station, + Position(0.0, 0.0, (2451.0 - beampipe_dimensions[pieceIdx].zCenter))); + + Volume v_vacuum_main_pipe("v_vacuum_main_pipe", final_vacuum_main_pipe, m_vac); + sdet.setAttributes(det, v_vacuum_main_pipe, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_vacuum_0 = assembly.placeVolume( + v_vacuum_main_pipe, + Transform3D(RotationY(crossingAngle), Position(beampipe_dimensions[pieceIdx].xCenter + 4.0, + 0.0, beampipe_dimensions[pieceIdx].zCenter))); + pv_vacuum_0.addPhysVolID("sector", 1); + DetElement vacuum_de_0(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); + vacuum_de_0.setPlacement(pv_vacuum_0); + + //------------------------------------------------------------------ + + for (int idx = 1; idx < 6; idx++) { //loop for the easier pieces to simplify + + if (idx == 2 || idx == 4) { + continue; + } //FIXME: don't fill RP chambers with vacuum yet - still an issue with RP geometry + + Box inner_vacuum(beampipe_dimensions[idx].innerXRadius, beampipe_dimensions[idx].innerYRadius, + (beampipe_dimensions[idx].length) / 2); + + Volume v_inner_vacuum(Form("v_vacuum_%d", idx), inner_vacuum, m_vac); + sdet.setAttributes(det, v_inner_vacuum, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_final = assembly.placeVolume( + v_inner_vacuum, + Transform3D(RotationY(beampipe_dimensions[idx].rotationAngle), + Position(beampipe_dimensions[idx].xCenter, beampipe_dimensions[idx].yCenter, + beampipe_dimensions[idx].zCenter))); + pv_final.addPhysVolID("sector", 1); + DetElement final_de(sdet, Form("sector_FF_vacuum_%d_de", idx), 1); + final_de.setPlacement(pv_final); + } + + //------------------------------------------------------------------ + + pieceIdx = 6; + + EightPointSolid vacuum_taper((0.5 * beampipe_dimensions[pieceIdx].length), trpVerticesInner); + + Volume v_vacuum_taper("v_vacuum_taper", vacuum_taper, m_vac); + sdet.setAttributes(det, v_vacuum_taper, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_vacuum_6 = assembly.placeVolume( + v_vacuum_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), + Position(beampipe_dimensions[pieceIdx].xCenter, 0.0, + beampipe_dimensions[pieceIdx].zCenter))); + pv_vacuum_6.addPhysVolID("sector", 1); + DetElement vacuum_de_6(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); + vacuum_de_6.setPlacement(pv_vacuum_6); + + //------------------------------------------------------------------- + + pieceIdx = 7; //vacuum between taper and B2PF + + Tube vacuum_pipe_after_taper(0.0, beampipe_dimensions[pieceIdx].innerXRadius, + beampipe_dimensions[pieceIdx].length / 2); + + Volume v_vacuum_pipe_after_taper("v_vacuum_pipe_after_taper", vacuum_pipe_after_taper, m_vac); + sdet.setAttributes(det, v_vacuum_pipe_after_taper, x_det.regionStr(), x_det.limitsStr(), + "AnlBlue"); + + auto pv_vacuum_7 = assembly.placeVolume( + v_vacuum_pipe_after_taper, Transform3D(RotationY(beampipe_dimensions[pieceIdx].rotationAngle), + Position(beampipe_dimensions[pieceIdx].xCenter, + beampipe_dimensions[pieceIdx].yCenter, + beampipe_dimensions[pieceIdx].zCenter))); + pv_vacuum_7.addPhysVolID("sector", 1); + DetElement vacuum_de_7(sdet, Form("sector_FF_vacuum_%d_de", pieceIdx), 1); + vacuum_de_7.setPlacement(pv_vacuum_7); + + //------------------------------------------------------------------- + + pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly); + pv_assembly.addPhysVolID("system", x_det.id()).addPhysVolID("barrel", 1); + sdet.setPlacement(pv_assembly); + assembly->GetShape()->ComputeBBox(); + return sdet; } DECLARE_DETELEMENT(forwardBeamPipeBrazil, create_detector) diff --git a/src/hadronDownstreamBeamPipe.cpp b/src/hadronDownstreamBeamPipe.cpp index adabee854..a14b995e0 100644 --- a/src/hadronDownstreamBeamPipe.cpp +++ b/src/hadronDownstreamBeamPipe.cpp @@ -31,21 +31,20 @@ using namespace dd4hep; * \endcode * */ -static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) -{ +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) { using namespace ROOT::Math; - xml_det_t x_det = e; - string det_name = x_det.nameStr(); + xml_det_t x_det = e; + string det_name = x_det.nameStr(); // Material air = det.air(); DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); + Assembly assembly(det_name + "_assembly"); // Material m_Cu = det.material("Copper"); // Material m_Al = det.material("Aluminum"); - Material m_Be = det.material("Beryllium"); - Material m_SS = det.material("StainlessSteel"); - Material m_vac = det.material("Vacuum"); - string vis_name = x_det.visStr(); + Material m_Be = det.material("Beryllium"); + Material m_SS = det.material("StainlessSteel"); + Material m_vac = det.material("Vacuum"); + string vis_name = x_det.visStr(); PlacedVolume pv_assembly; @@ -54,12 +53,10 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * //int numPipePieces = 4; //number of individual pipe sections - double b0_hadron_tube_inner_r = 2.9; // cm double b0_hadron_tube_outer_r = 3.1; // cm double b0_hadron_tube_length = 120.0; // cm - double drift_hadron_section_1_inner_r = 20.0; double drift_hadron_section_1_outer_r = 20.2; @@ -81,23 +78,22 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * //Calculatate full drift region from line formula for proton orbit - //(z, x) + //(z, x) //double orbit_start[2] = {22.0623828, -0.6543372}; //meters! //double orbit_end[2] = {38.5445361, -1.4039456}; //meters! - //22.07774534 + //22.07774534 double orbit_start[2] = {22.07774534, -0.650777226}; //meters - double orbit_end[2] = {38.54362489, -1.436245325}; //meters + double orbit_end[2] = {38.54362489, -1.436245325}; //meters //calculate straight line formula x = slope*z + intercept - double slope = (orbit_end[1]-orbit_start[1])/(orbit_end[0]-orbit_start[0]); - double intercept = orbit_start[1]-(slope*orbit_start[0]); - + double slope = (orbit_end[1] - orbit_start[1]) / (orbit_end[0] - orbit_start[0]); + double intercept = orbit_start[1] - (slope * orbit_start[0]); // This is the beam tube in the B0 magnet for the hadron beam // doesn't use the slope information calculated before - it stands alone - Tube b0_hadron_tube(b0_hadron_tube_inner_r, b0_hadron_tube_outer_r, b0_hadron_tube_length / 2.0); + Tube b0_hadron_tube(b0_hadron_tube_inner_r, b0_hadron_tube_outer_r, b0_hadron_tube_length / 2.0); Volume v_b0_hadron_tube("v_b0_hadron_tube", b0_hadron_tube, m_Be); sdet.setAttributes(det, v_b0_hadron_tube, x_det.regionStr(), x_det.limitsStr(), vis_name); @@ -105,70 +101,73 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * // build drift beam pipe here //---------------------------------- - double z_start_pipe[3] = {orbit_start[0], 30.000, 31.500 }; - double z_end_pipe[3] = {30.000, 31.500, 40.000 }; - - - for(int iSection = 0; iSection < 3; iSection++){ - - double z_endpoint = z_end_pipe[iSection]; //meters - double x_endpoint = (slope*z_endpoint) + intercept; - double x_startpoint = (slope*z_start_pipe[iSection]) + intercept; - - double length = sqrt(pow(z_endpoint - z_start_pipe[iSection],2) + pow(x_endpoint - x_startpoint,2)); - double z_center = (0.5*length + z_start_pipe[iSection])*cos(slope); - double x_center = (slope*z_center) + intercept; - - double entrance_r_inner = 0.0; //drift_hadron_section_1_inner_r; - double exit_radius_inner = 0.0; - double entrance_r_outer = 0.0; //drift_hadron_section_1_inner_r; - double exit_radius_outer = 0.0; - - if(iSection < 1){ - entrance_r_inner = drift_hadron_section_1_inner_r; - exit_radius_inner = drift_hadron_section_1_inner_r; - entrance_r_outer = drift_hadron_section_1_outer_r; - exit_radius_outer = drift_hadron_section_1_outer_r; - length = length - 0.04; - } - if(iSection == 1){ - entrance_r_inner = drift_hadron_section_3_inner_r_ent; - exit_radius_inner = drift_hadron_section_3_inner_r_ex; - entrance_r_outer = drift_hadron_section_3_outer_r_ent; - exit_radius_outer = drift_hadron_section_3_outer_r_ex; - drift_hadron_section_3_x = x_center; - drift_hadron_section_3_z = z_center; - drift_hadron_section_3_length = length - 0.02; - //old numbers commented out for reference - A. Jentsch - //length = length - 0.02; - //x_center = -99.25250431/100.0; - //z_center = 2924.185347/100.0; - //length = drift_hadron_section_3_length/100.0; - } - if(iSection == 2){ - entrance_r_inner = drift_hadron_section_4_inner_r; - exit_radius_inner = drift_hadron_section_4_inner_r; - entrance_r_outer = drift_hadron_section_4_outer_r; - exit_radius_outer = drift_hadron_section_4_outer_r; - drift_hadron_section_4_x = x_center; - drift_hadron_section_4_z = z_center; - drift_hadron_section_4_length = length - 0.02; - length = length - 0.02; - //old numbers commented out for reference - A. Jentsch - // x_center = -123.076799/100.0; - // z_center = 3423.617428/100.0; - //length = drift_hadron_section_4_length/100.0; - } - - Cone drift_pipe((length*100.0) / 2.0, entrance_r_inner, entrance_r_outer, exit_radius_inner, exit_radius_outer); - - Volume v_pipe(Form("v_drift_tube_pipe_%d", iSection), drift_pipe, m_SS); - sdet.setAttributes(det, v_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); - - auto pv_pipe = assembly.placeVolume(v_pipe, Transform3D(RotationY(slope), Position(100.0*x_center, 0.0, 100.0*z_center))); // 2353.06094))); - pv_pipe.addPhysVolID("sector", 1); - DetElement pipe_de(sdet, Form("sector_pipe_%d_de", iSection), 1); - pipe_de.setPlacement(pv_pipe); + double z_start_pipe[3] = {orbit_start[0], 30.000, 31.500}; + double z_end_pipe[3] = {30.000, 31.500, 40.000}; + + for (int iSection = 0; iSection < 3; iSection++) { + + double z_endpoint = z_end_pipe[iSection]; //meters + double x_endpoint = (slope * z_endpoint) + intercept; + double x_startpoint = (slope * z_start_pipe[iSection]) + intercept; + + double length = + sqrt(pow(z_endpoint - z_start_pipe[iSection], 2) + pow(x_endpoint - x_startpoint, 2)); + double z_center = (0.5 * length + z_start_pipe[iSection]) * cos(slope); + double x_center = (slope * z_center) + intercept; + + double entrance_r_inner = 0.0; //drift_hadron_section_1_inner_r; + double exit_radius_inner = 0.0; + double entrance_r_outer = 0.0; //drift_hadron_section_1_inner_r; + double exit_radius_outer = 0.0; + + if (iSection < 1) { + entrance_r_inner = drift_hadron_section_1_inner_r; + exit_radius_inner = drift_hadron_section_1_inner_r; + entrance_r_outer = drift_hadron_section_1_outer_r; + exit_radius_outer = drift_hadron_section_1_outer_r; + length = length - 0.04; + } + if (iSection == 1) { + entrance_r_inner = drift_hadron_section_3_inner_r_ent; + exit_radius_inner = drift_hadron_section_3_inner_r_ex; + entrance_r_outer = drift_hadron_section_3_outer_r_ent; + exit_radius_outer = drift_hadron_section_3_outer_r_ex; + drift_hadron_section_3_x = x_center; + drift_hadron_section_3_z = z_center; + drift_hadron_section_3_length = length - 0.02; + //old numbers commented out for reference - A. Jentsch + //length = length - 0.02; + //x_center = -99.25250431/100.0; + //z_center = 2924.185347/100.0; + //length = drift_hadron_section_3_length/100.0; + } + if (iSection == 2) { + entrance_r_inner = drift_hadron_section_4_inner_r; + exit_radius_inner = drift_hadron_section_4_inner_r; + entrance_r_outer = drift_hadron_section_4_outer_r; + exit_radius_outer = drift_hadron_section_4_outer_r; + drift_hadron_section_4_x = x_center; + drift_hadron_section_4_z = z_center; + drift_hadron_section_4_length = length - 0.02; + length = length - 0.02; + //old numbers commented out for reference - A. Jentsch + // x_center = -123.076799/100.0; + // z_center = 3423.617428/100.0; + //length = drift_hadron_section_4_length/100.0; + } + + Cone drift_pipe((length * 100.0) / 2.0, entrance_r_inner, entrance_r_outer, exit_radius_inner, + exit_radius_outer); + + Volume v_pipe(Form("v_drift_tube_pipe_%d", iSection), drift_pipe, m_SS); + sdet.setAttributes(det, v_pipe, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv_pipe = assembly.placeVolume( + v_pipe, Transform3D(RotationY(slope), + Position(100.0 * x_center, 0.0, 100.0 * z_center))); // 2353.06094))); + pv_pipe.addPhysVolID("sector", 1); + DetElement pipe_de(sdet, Form("sector_pipe_%d_de", iSection), 1); + pipe_de.setPlacement(pv_pipe); } //------------------------------ @@ -176,54 +175,57 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * //------------------------------ //last two entries are dummy numbers for now - double z_start_points[7] = {orbit_start[0]+0.03, 22.590, 24.590, 26.055, 28.055 , 20.0, 20.0 }; - double z_endpoints_array[7] = {22.499, 24.499, 25.980, 27.980, z_start_pipe[1] , 25.0, 25.0 }; - - - for(int iVac = 0; iVac < 7; iVac++){ - - double z_endpoint = z_endpoints_array[iVac]; //meters - double x_endpoint = (slope*z_endpoint) + intercept; - double x_startpoint = (slope*z_start_points[iVac]) + intercept; - - double length = sqrt(pow(z_endpoint - z_start_points[iVac],2) + pow(x_endpoint - x_startpoint,2)); - double z_center = (0.5*length + z_start_points[iVac])*cos(slope); - double x_center = (slope*z_center) + intercept; - - double entrance_r_inner = 0.0; //drift_hadron_section_1_inner_r; - double exit_radius_inner = 0.0; - - if(iVac < 5){ - entrance_r_inner = drift_hadron_section_1_inner_r; - exit_radius_inner = drift_hadron_section_1_inner_r; - } - if(iVac == 5){ - entrance_r_inner = drift_hadron_section_1_inner_r; - exit_radius_inner = drift_hadron_section_3_inner_r_ex; - x_center = drift_hadron_section_3_x;//-99.25250431/100.0; - z_center = drift_hadron_section_3_z;//2924.185347/100.0; - length = drift_hadron_section_3_length - 0.02; ///100.0; - } - if(iVac == 6){ - entrance_r_inner = drift_hadron_section_4_inner_r; - exit_radius_inner = drift_hadron_section_4_inner_r; - //x_center = -123.076799/100.0; - //z_center = 3423.617428/100.0; - //length = drift_hadron_section_4_length/100.0; - x_center = drift_hadron_section_4_x; - z_center = drift_hadron_section_4_z; - length = drift_hadron_section_4_length; - } - - Cone drift_vacuum((length*100.0) / 2.0, 0.0, entrance_r_inner-0.5, 0.0, exit_radius_inner-0.5); - - Volume v_vacuum(Form("v_drift_tube_vacuum_%d", iVac), drift_vacuum, m_vac); - sdet.setAttributes(det, v_vacuum, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); - - auto pv_vacuum = assembly.placeVolume(v_vacuum, Transform3D(RotationY(slope), Position(100.0*x_center, 0.0, 100.0*z_center))); // 2353.06094))); - pv_vacuum.addPhysVolID("sector", 1); - DetElement vacuum_de(sdet, Form("sector_vac_%d_de", iVac), 1); - vacuum_de.setPlacement(pv_vacuum); + double z_start_points[7] = {orbit_start[0] + 0.03, 22.590, 24.590, 26.055, 28.055, 20.0, 20.0}; + double z_endpoints_array[7] = {22.499, 24.499, 25.980, 27.980, z_start_pipe[1], 25.0, 25.0}; + + for (int iVac = 0; iVac < 7; iVac++) { + + double z_endpoint = z_endpoints_array[iVac]; //meters + double x_endpoint = (slope * z_endpoint) + intercept; + double x_startpoint = (slope * z_start_points[iVac]) + intercept; + + double length = + sqrt(pow(z_endpoint - z_start_points[iVac], 2) + pow(x_endpoint - x_startpoint, 2)); + double z_center = (0.5 * length + z_start_points[iVac]) * cos(slope); + double x_center = (slope * z_center) + intercept; + + double entrance_r_inner = 0.0; //drift_hadron_section_1_inner_r; + double exit_radius_inner = 0.0; + + if (iVac < 5) { + entrance_r_inner = drift_hadron_section_1_inner_r; + exit_radius_inner = drift_hadron_section_1_inner_r; + } + if (iVac == 5) { + entrance_r_inner = drift_hadron_section_1_inner_r; + exit_radius_inner = drift_hadron_section_3_inner_r_ex; + x_center = drift_hadron_section_3_x; //-99.25250431/100.0; + z_center = drift_hadron_section_3_z; //2924.185347/100.0; + length = drift_hadron_section_3_length - 0.02; ///100.0; + } + if (iVac == 6) { + entrance_r_inner = drift_hadron_section_4_inner_r; + exit_radius_inner = drift_hadron_section_4_inner_r; + //x_center = -123.076799/100.0; + //z_center = 3423.617428/100.0; + //length = drift_hadron_section_4_length/100.0; + x_center = drift_hadron_section_4_x; + z_center = drift_hadron_section_4_z; + length = drift_hadron_section_4_length; + } + + Cone drift_vacuum((length * 100.0) / 2.0, 0.0, entrance_r_inner - 0.5, 0.0, + exit_radius_inner - 0.5); + + Volume v_vacuum(Form("v_drift_tube_vacuum_%d", iVac), drift_vacuum, m_vac); + sdet.setAttributes(det, v_vacuum, x_det.regionStr(), x_det.limitsStr(), "AnlBlue"); + + auto pv_vacuum = assembly.placeVolume( + v_vacuum, Transform3D(RotationY(slope), + Position(100.0 * x_center, 0.0, 100.0 * z_center))); // 2353.06094))); + pv_vacuum.addPhysVolID("sector", 1); + DetElement vacuum_de(sdet, Form("sector_vac_%d_de", iVac), 1); + vacuum_de.setPlacement(pv_vacuum); } // Transform3D posAndRot(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z())); diff --git a/src/magnetVacuumFF.cpp b/src/magnetVacuumFF.cpp index 46328c297..eb462fcea 100644 --- a/src/magnetVacuumFF.cpp +++ b/src/magnetVacuumFF.cpp @@ -1,7 +1,6 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2023 Alex Jentsch - #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" #include <XML/Helper.h> @@ -27,252 +26,260 @@ using namespace dd4hep; static double getRotatedZ(double z, double x, double angle); static double getRotatedX(double z, double x, double angle); -static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) -{ - - xml_det_t x_det = e; - string det_name = x_det.nameStr(); - DetElement sdet(det_name, x_det.id()); - Assembly assembly(det_name + "_assembly"); - Material m_Vac = det.material("Vacuum"); - string vis_name = x_det.visStr(); - - PlacedVolume pv_assembly; - - //---------------------------------------------- - // Starting point is only the magnet centers, - // lengths, rotations, and radii --> - // everything else calculated internally to - // make it easier to update later. - //---------------------------------------------- - - bool makeIP_B0pfVacuum = true; //This is for the special gap location between IP and b0pf - - //information for actual FF magnets, with magnet centers as reference - vector <double> radii_magnet; - vector <double> lengths_magnet; - vector <double> rotation_magnet; - vector <double> x_elem_magnet; - vector <double> y_elem_magnet; - vector <double> z_elem_magnet; - - //calculated entrance/exit points of FF magnet - vector <double> x_beg; - vector <double> z_beg; - vector <double> x_end; - vector <double> z_end; - - //calculated center of gap regions between magnets, rotation, and length - vector <double> angle_elem_gap; - vector <double> z_gap; - vector <double> x_gap; - vector <double> length_gap; - - //storage elements for CutTube geometry element used for gaps - vector <double> inRadius; - vector <double> outRadius; - vector <double> nxLow; - vector <double> nyLow; - vector <double> nzLow; - vector <double> nxHigh; - vector <double> nyHigh; - vector <double> nzHigh; - vector <double> phi_initial; - vector <double> phi_final; - - for(xml_coll_t c(x_det,_U(element)); c; ++c){ - - xml_dim_t pos = c.child(_U(placement)); - double pos_x = pos.x(); - double pos_y = pos.y(); - double pos_z = pos.z(); - double pos_theta = pos.attr<double>(_U(theta)); - xml_dim_t dims = c.child(_U(dimensions)); //dimensions(); - double dim_z = dims.z(); - xml_dim_t apperture = c.child(_Unicode(apperture)); - double app_r = apperture.r(); - - radii_magnet.push_back(app_r); // cm - lengths_magnet.push_back(dim_z); //cm - rotation_magnet.push_back(pos_theta); // radians - x_elem_magnet.push_back(pos_x*dd4hep::cm); - y_elem_magnet.push_back(pos_y*dd4hep::cm); - z_elem_magnet.push_back(pos_z*dd4hep::cm); - - } - - int numMagnets = radii_magnet.size(); //number of actual FF magnets between IP and FF detectors - int numGaps = numMagnets - 1; //number of gaps between magnets (excluding the IP to B0pf transition -- special case) - - //------------------------------------------- - // override numbers for the first element --> - // doesn't use the actual B0pf geometry!!! - // -->it's based on the B0 beam pipe - // this needs to be fixed later to read-in - // that beam pipe geometry - //------------------------------------------- - - radii_magnet[0] = 2.9; // cm - lengths_magnet[0] = 120.0; // cm - rotation_magnet[0] = -0.025; // radians - x_elem_magnet[0] = -16.5; // cm - y_elem_magnet[0] = 0.0; // cm - z_elem_magnet[0] = 640.0; // cm - - //------------------------------------------- - //calculate entrance/exit points of magnets - //------------------------------------------- - - for(int i = 0; i < numMagnets; i++){ - - // need to use the common coordinate system --> - // use x = z, and y = x to make things easier - - z_beg.push_back(getRotatedZ(-0.5*lengths_magnet[i], 0.0, rotation_magnet[i]) + z_elem_magnet[i]); - z_end.push_back(getRotatedZ( 0.5*lengths_magnet[i], 0.0, rotation_magnet[i]) + z_elem_magnet[i]); - x_beg.push_back(getRotatedX(-0.5*lengths_magnet[i], 0.0, rotation_magnet[i]) + x_elem_magnet[i]); - x_end.push_back(getRotatedX( 0.5*lengths_magnet[i], 0.0, rotation_magnet[i]) + x_elem_magnet[i]); - - } - - //------------------------------------------ - // this part is a bit ugly for now - - // it's to make the vacuum volume between the - // end of the IP beam pipe and the beginning of - // beginning of the B0pf magnet - // - // -->the volume will be calculated at the end - //------------------------------------------- - - double endOfCentralBeamPipe_z = 445.580*dd4hep::cm; //extracted from central_beampipe.xml, line 64 - double diameterReduce = 11.0*dd4hep::cm; //size reduction to avoid overlap with electron pipe - double vacuumDiameterEntrance = 25.792*dd4hep::cm - diameterReduce; //extracted from central_beampipe.xml, line 64 - double vacuumDiameterExit = 17.4*dd4hep::cm; //15mrad @ entrance to magnet to not overlap electron magnet - double crossingAngle = -0.025; //radians - double endOfCentralBeamPipe_x = endOfCentralBeamPipe_z*crossingAngle; - - //----------------------------------------------- - //calculate gap region center, length, and angle - //----------------------------------------------- - - for(int i = 1; i < numMagnets; i++){ - - angle_elem_gap.push_back((x_beg[i] - x_end[i-1])/(z_beg[i] - z_end[i-1])); - length_gap.push_back(sqrt(pow(z_beg[i] - z_end[i-1], 2) + pow(x_beg[i] - x_end[i-1], 2))); - z_gap.push_back(z_end[i-1] + 0.5*length_gap[i-1]*cos(angle_elem_gap[i-1])); - x_gap.push_back(x_end[i-1] + 0.5*length_gap[i-1]*sin(angle_elem_gap[i-1])); - - } - - //----------------------------------------------- - // fill CutTube storage elements - //----------------------------------------------- - - for(int gapIdx = 0; gapIdx < numGaps; gapIdx++){ - - inRadius.push_back(0.0); - outRadius.push_back(radii_magnet[gapIdx+1]); - phi_initial.push_back(0.0); - phi_final.push_back(2*M_PI); - nxLow.push_back(-(length_gap[gapIdx]/2.0)*sin(rotation_magnet[gapIdx]-angle_elem_gap[gapIdx])); - nyLow.push_back(0.0); - nzLow.push_back(-(length_gap[gapIdx]/2.0)*cos(rotation_magnet[gapIdx]-angle_elem_gap[gapIdx])); - nxHigh.push_back((length_gap[gapIdx]/2.0)*sin(rotation_magnet[gapIdx+1]-angle_elem_gap[gapIdx])); - nyHigh.push_back(0.0); - nzHigh.push_back((length_gap[gapIdx]/2.0)*cos(rotation_magnet[gapIdx+1]-angle_elem_gap[gapIdx])); - - } - - //----------------------- - // inside magnets - //----------------------- - - for(int pieceIdx = 0; pieceIdx < numMagnets; pieceIdx++){ - - std::string piece_name = Form("MagnetVacuum%d", pieceIdx); - - Tube magnetPiece(piece_name, 0.0, radii_magnet[pieceIdx], lengths_magnet[pieceIdx]/2); - Volume vpiece(piece_name, magnetPiece, m_Vac); - sdet.setAttributes(det, vpiece, x_det.regionStr(), x_det.limitsStr(), vis_name); - - auto pv = assembly.placeVolume(vpiece, Transform3D(RotationY(rotation_magnet[pieceIdx]), - Position(x_elem_magnet[pieceIdx], y_elem_magnet[pieceIdx], z_elem_magnet[pieceIdx]))); - pv.addPhysVolID("sector", 1); - - DetElement de(sdet, Form("sector%d_de", pieceIdx), 1); - de.setPlacement(pv); - - } - - //-------------------------- - //between magnets - //-------------------------- +static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens */) { + + xml_det_t x_det = e; + string det_name = x_det.nameStr(); + DetElement sdet(det_name, x_det.id()); + Assembly assembly(det_name + "_assembly"); + Material m_Vac = det.material("Vacuum"); + string vis_name = x_det.visStr(); + + PlacedVolume pv_assembly; + + //---------------------------------------------- + // Starting point is only the magnet centers, + // lengths, rotations, and radii --> + // everything else calculated internally to + // make it easier to update later. + //---------------------------------------------- + + bool makeIP_B0pfVacuum = true; //This is for the special gap location between IP and b0pf + + //information for actual FF magnets, with magnet centers as reference + vector<double> radii_magnet; + vector<double> lengths_magnet; + vector<double> rotation_magnet; + vector<double> x_elem_magnet; + vector<double> y_elem_magnet; + vector<double> z_elem_magnet; + + //calculated entrance/exit points of FF magnet + vector<double> x_beg; + vector<double> z_beg; + vector<double> x_end; + vector<double> z_end; + + //calculated center of gap regions between magnets, rotation, and length + vector<double> angle_elem_gap; + vector<double> z_gap; + vector<double> x_gap; + vector<double> length_gap; + + //storage elements for CutTube geometry element used for gaps + vector<double> inRadius; + vector<double> outRadius; + vector<double> nxLow; + vector<double> nyLow; + vector<double> nzLow; + vector<double> nxHigh; + vector<double> nyHigh; + vector<double> nzHigh; + vector<double> phi_initial; + vector<double> phi_final; + + for (xml_coll_t c(x_det, _U(element)); c; ++c) { + + xml_dim_t pos = c.child(_U(placement)); + double pos_x = pos.x(); + double pos_y = pos.y(); + double pos_z = pos.z(); + double pos_theta = pos.attr<double>(_U(theta)); + xml_dim_t dims = c.child(_U(dimensions)); //dimensions(); + double dim_z = dims.z(); + xml_dim_t apperture = c.child(_Unicode(apperture)); + double app_r = apperture.r(); + + radii_magnet.push_back(app_r); // cm + lengths_magnet.push_back(dim_z); //cm + rotation_magnet.push_back(pos_theta); // radians + x_elem_magnet.push_back(pos_x * dd4hep::cm); + y_elem_magnet.push_back(pos_y * dd4hep::cm); + z_elem_magnet.push_back(pos_z * dd4hep::cm); + } + + int numMagnets = radii_magnet.size(); //number of actual FF magnets between IP and FF detectors + int numGaps = + numMagnets - + 1; //number of gaps between magnets (excluding the IP to B0pf transition -- special case) + + //------------------------------------------- + // override numbers for the first element --> + // doesn't use the actual B0pf geometry!!! + // -->it's based on the B0 beam pipe + // this needs to be fixed later to read-in + // that beam pipe geometry + //------------------------------------------- + + radii_magnet[0] = 2.9; // cm + lengths_magnet[0] = 120.0; // cm + rotation_magnet[0] = -0.025; // radians + x_elem_magnet[0] = -16.5; // cm + y_elem_magnet[0] = 0.0; // cm + z_elem_magnet[0] = 640.0; // cm + + //------------------------------------------- + //calculate entrance/exit points of magnets + //------------------------------------------- + + for (int i = 0; i < numMagnets; i++) { + + // need to use the common coordinate system --> + // use x = z, and y = x to make things easier + + z_beg.push_back(getRotatedZ(-0.5 * lengths_magnet[i], 0.0, rotation_magnet[i]) + + z_elem_magnet[i]); + z_end.push_back(getRotatedZ(0.5 * lengths_magnet[i], 0.0, rotation_magnet[i]) + + z_elem_magnet[i]); + x_beg.push_back(getRotatedX(-0.5 * lengths_magnet[i], 0.0, rotation_magnet[i]) + + x_elem_magnet[i]); + x_end.push_back(getRotatedX(0.5 * lengths_magnet[i], 0.0, rotation_magnet[i]) + + x_elem_magnet[i]); + } + + //------------------------------------------ + // this part is a bit ugly for now - + // it's to make the vacuum volume between the + // end of the IP beam pipe and the beginning of + // beginning of the B0pf magnet + // + // -->the volume will be calculated at the end + //------------------------------------------- + + double endOfCentralBeamPipe_z = + 445.580 * dd4hep::cm; //extracted from central_beampipe.xml, line 64 + double diameterReduce = 11.0 * dd4hep::cm; //size reduction to avoid overlap with electron pipe + double vacuumDiameterEntrance = + 25.792 * dd4hep::cm - diameterReduce; //extracted from central_beampipe.xml, line 64 + double vacuumDiameterExit = + 17.4 * dd4hep::cm; //15mrad @ entrance to magnet to not overlap electron magnet + double crossingAngle = -0.025; //radians + double endOfCentralBeamPipe_x = endOfCentralBeamPipe_z * crossingAngle; + + //----------------------------------------------- + //calculate gap region center, length, and angle + //----------------------------------------------- + + for (int i = 1; i < numMagnets; i++) { + + angle_elem_gap.push_back((x_beg[i] - x_end[i - 1]) / (z_beg[i] - z_end[i - 1])); + length_gap.push_back(sqrt(pow(z_beg[i] - z_end[i - 1], 2) + pow(x_beg[i] - x_end[i - 1], 2))); + z_gap.push_back(z_end[i - 1] + 0.5 * length_gap[i - 1] * cos(angle_elem_gap[i - 1])); + x_gap.push_back(x_end[i - 1] + 0.5 * length_gap[i - 1] * sin(angle_elem_gap[i - 1])); + } + + //----------------------------------------------- + // fill CutTube storage elements + //----------------------------------------------- + + for (int gapIdx = 0; gapIdx < numGaps; gapIdx++) { + + inRadius.push_back(0.0); + outRadius.push_back(radii_magnet[gapIdx + 1]); + phi_initial.push_back(0.0); + phi_final.push_back(2 * M_PI); + nxLow.push_back(-(length_gap[gapIdx] / 2.0) * + sin(rotation_magnet[gapIdx] - angle_elem_gap[gapIdx])); + nyLow.push_back(0.0); + nzLow.push_back(-(length_gap[gapIdx] / 2.0) * + cos(rotation_magnet[gapIdx] - angle_elem_gap[gapIdx])); + nxHigh.push_back((length_gap[gapIdx] / 2.0) * + sin(rotation_magnet[gapIdx + 1] - angle_elem_gap[gapIdx])); + nyHigh.push_back(0.0); + nzHigh.push_back((length_gap[gapIdx] / 2.0) * + cos(rotation_magnet[gapIdx + 1] - angle_elem_gap[gapIdx])); + } + + //----------------------- + // inside magnets + //----------------------- + + for (int pieceIdx = 0; pieceIdx < numMagnets; pieceIdx++) { + + std::string piece_name = Form("MagnetVacuum%d", pieceIdx); + + Tube magnetPiece(piece_name, 0.0, radii_magnet[pieceIdx], lengths_magnet[pieceIdx] / 2); + Volume vpiece(piece_name, magnetPiece, m_Vac); + sdet.setAttributes(det, vpiece, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv = assembly.placeVolume( + vpiece, Transform3D(RotationY(rotation_magnet[pieceIdx]), + Position(x_elem_magnet[pieceIdx], y_elem_magnet[pieceIdx], + z_elem_magnet[pieceIdx]))); + pv.addPhysVolID("sector", 1); + + DetElement de(sdet, Form("sector%d_de", pieceIdx), 1); + de.setPlacement(pv); + } + + //-------------------------- + //between magnets + //-------------------------- + + for (int pieceIdx = numMagnets; pieceIdx < numGaps + numMagnets; pieceIdx++) { + + int correctIdx = pieceIdx - numMagnets; + + std::string piece_name = Form("GapVacuum%d", correctIdx); + + CutTube gapPiece(piece_name, inRadius[correctIdx], outRadius[correctIdx], + length_gap[correctIdx] / 2, phi_initial[correctIdx], phi_final[correctIdx], + nxLow[correctIdx], nyLow[correctIdx], nzLow[correctIdx], nxHigh[correctIdx], + nyHigh[correctIdx], nzHigh[correctIdx]); + + Volume vpiece(piece_name, gapPiece, m_Vac); + sdet.setAttributes(det, vpiece, x_det.regionStr(), x_det.limitsStr(), vis_name); + + auto pv = assembly.placeVolume( + vpiece, Transform3D(RotationY(angle_elem_gap[correctIdx]), + Position(x_gap[correctIdx], 0.0, z_gap[correctIdx]))); + pv.addPhysVolID("sector", 1); + + DetElement de(sdet, Form("sector%d_de", pieceIdx), 1); + de.setPlacement(pv); + } + + //-------------------------------------------------------------- + //make and place vacuum volume to connect IP beam pipe to B0pf + //-------------------------------------------------------------- + + if (makeIP_B0pfVacuum) { + + double specialGapLength = sqrt(pow(z_beg[0] - endOfCentralBeamPipe_z, 2) + + pow(x_beg[0] - endOfCentralBeamPipe_x, 2)) - + 0.1; + double specialGap_z = 0.5 * specialGapLength * cos(crossingAngle) + endOfCentralBeamPipe_z; + double specialGap_x = 0.5 * specialGapLength * sin(crossingAngle) + endOfCentralBeamPipe_x; - for(int pieceIdx = numMagnets; pieceIdx < numGaps + numMagnets; pieceIdx++){ + std::string piece_name = Form("GapVacuum%d", numGaps + numMagnets); - int correctIdx = pieceIdx-numMagnets; + Cone specialGap(piece_name, specialGapLength / 2, 0.0, vacuumDiameterEntrance / 2, 0.0, + vacuumDiameterExit / 2); - std::string piece_name = Form("GapVacuum%d", correctIdx); + Volume specialGap_v(piece_name, specialGap, m_Vac); + sdet.setAttributes(det, specialGap_v, x_det.regionStr(), x_det.limitsStr(), vis_name); - CutTube gapPiece(piece_name, inRadius[correctIdx], outRadius[correctIdx], length_gap[correctIdx]/2, phi_initial[correctIdx], phi_final[correctIdx], - nxLow[correctIdx], nyLow[correctIdx], nzLow[correctIdx], nxHigh[correctIdx], nyHigh[correctIdx], nzHigh[correctIdx]); + auto pv = + assembly.placeVolume(specialGap_v, Transform3D(RotationY(crossingAngle), + Position(specialGap_x, 0.0, specialGap_z))); + pv.addPhysVolID("sector", 1); - Volume vpiece(piece_name, gapPiece, m_Vac); - sdet.setAttributes(det, vpiece, x_det.regionStr(), x_det.limitsStr(), vis_name); + DetElement de(sdet, Form("sector%d_de", numGaps + numMagnets), 1); + de.setPlacement(pv); + } - auto pv = assembly.placeVolume(vpiece, Transform3D(RotationY(angle_elem_gap[correctIdx]), - Position(x_gap[correctIdx], 0.0, z_gap[correctIdx]))); - pv.addPhysVolID("sector", 1); + //---------------------------------------------------- - DetElement de(sdet, Form("sector%d_de", pieceIdx), 1); - de.setPlacement(pv); + pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly); + pv_assembly.addPhysVolID("system", x_det.id()).addPhysVolID("barrel", 1); + sdet.setPlacement(pv_assembly); + assembly->GetShape()->ComputeBBox(); - - } - - //-------------------------------------------------------------- - //make and place vacuum volume to connect IP beam pipe to B0pf - //-------------------------------------------------------------- - - if(makeIP_B0pfVacuum){ - - double specialGapLength = sqrt(pow(z_beg[0] - endOfCentralBeamPipe_z, 2) + pow(x_beg[0] - endOfCentralBeamPipe_x, 2)) - 0.1; - double specialGap_z = 0.5*specialGapLength*cos(crossingAngle) + endOfCentralBeamPipe_z; - double specialGap_x = 0.5*specialGapLength*sin(crossingAngle) + endOfCentralBeamPipe_x; - - std::string piece_name = Form("GapVacuum%d", numGaps + numMagnets); - - Cone specialGap(piece_name, specialGapLength/2, 0.0, vacuumDiameterEntrance/2, 0.0, vacuumDiameterExit/2 ); - - Volume specialGap_v(piece_name, specialGap, m_Vac); - sdet.setAttributes(det, specialGap_v, x_det.regionStr(), x_det.limitsStr(), vis_name); - - auto pv = assembly.placeVolume(specialGap_v, Transform3D(RotationY(crossingAngle), Position(specialGap_x, 0.0, specialGap_z))); - pv.addPhysVolID("sector", 1); - - DetElement de(sdet, Form("sector%d_de", numGaps + numMagnets), 1); - de.setPlacement(pv); - - } - - //---------------------------------------------------- - - pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly); - pv_assembly.addPhysVolID("system", x_det.id()).addPhysVolID("barrel", 1); - sdet.setPlacement(pv_assembly); - assembly->GetShape()->ComputeBBox(); - - return sdet; + return sdet; } -double getRotatedZ(double z, double x, double angle){ +double getRotatedZ(double z, double x, double angle) { return z * cos(angle) - x * sin(angle); } - return z*cos(angle) - x*sin(angle); -} - -double getRotatedX(double z, double x, double angle){ - - return z*sin(angle) + x*cos(angle); -} +double getRotatedX(double z, double x, double angle) { return z * sin(angle) + x * cos(angle); } DECLARE_DETELEMENT(magnetElementInnerVacuum, create_detector) From 9800f7256ba9fb8d584fb8562475bd82bd741d60 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Tue, 16 Apr 2024 09:23:13 -0500 Subject: [PATCH 075/113] feat: add clang-format to .git-blame-ignore-revs (#709) ### Briefly, what does this PR introduce? This PR adds the clang-format commit to git blame ignore revs. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..75c7c5838 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +2ffa142d0bd7055cfbfd9ab7838f5e0b7f6c551c # feat(ci): change pre-commit clang-format to run in ci From 9d0191565b58b8eb9cb02aab65c848029c30cfd2 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Tue, 16 Apr 2024 14:43:01 -0500 Subject: [PATCH 076/113] fix: export all configs to STEP, use `part --level 1 HcalBarrel` (#702) ### Briefly, what does this PR introduce? Due to limitations in npdet_to_step, we disabled the HcalBarrel when exporting to STEP. With npsim 1.4.0, the issue with the HcalBarrel was [resolved](https://github.com/eic/npsim/pull/23). This PR re-enables the HcalBarrel in npdet_to_step conversion, and it simplifies the logic to export all detector configs (for consistency and predictability). TODO: - [x] restart CI pipeline when eic-shell nightly rolls out with npsim-1.4.0 ### What kind of change does this PR introduce? - [x] Bug fix (issue: HcalBarrel disabled in convert-to-step) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- .github/workflows/linux-eic-shell.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 52f32c9fa..449d03beb 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -287,9 +287,9 @@ jobs: runs-on: ubuntu-latest needs: - build + - list-detector-configs strategy: - matrix: - detector_config: [epic_craterlake_no_bhcal, epic_craterlake_tracking_only, epic_dirc_only, epic_drich_only, epic_imaging_only, epic_ip6, epic_lfhcal_with_insert] + matrix: ${{fromJson(needs.list-detector-configs.outputs.configs_json)}} steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 @@ -309,6 +309,7 @@ jobs: declare -A detectors while read d ; do detectors[$d]='-l 3' ; done <<< $(npdet_to_step list $DETECTOR_PATH/${{matrix.detector_config}}.xml | sed '/world/d;s/.*(vol: \(.*\)).*/\1/g') # Then tweak the levels (default is 1) + detectors[HcalBarrel]='-l 1' detectors[LFHCAL]='-l 2' detectors[OuterBarrelMPGDSubAssembly]='-l 4' # Export to one STEP file From 1997384ba4f2df864cb5ebf0024f23ff90351660 Mon Sep 17 00:00:00 2001 From: Chandradoy Chatterjee <chandradoy.chatterjee@ts.infn.it> Date: Tue, 23 Apr 2024 02:47:52 +0200 Subject: [PATCH 077/113] dRICH Extrusion Box azimuthal span 42 degrees (#712) ### Briefly, what does this PR introduce? The PR changes the azimuthal span of the extrusion box for the dRICH sensor from 48 degrees to 42 degrees. This will allow to have 18 degrees allowance for the services. ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [X ] Changes have been communicated to collaborators Marco Contalbrig has been updated about the changes. ### Does this PR introduce breaking changes? What changes might users need to make to their code? ### Does this PR change default behavior? --- compact/pid/drich.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/pid/drich.xml b/compact/pid/drich.xml index 7dc0e5b05..5e8b027d4 100644 --- a/compact/pid/drich.xml +++ b/compact/pid/drich.xml @@ -24,7 +24,7 @@ <constant name="DRICH_sensorbox_length" value="50.0*cm"/> <!-- z-length of the extrusion --> <constant name="DRICH_sensorbox_rmin" value="DRICH_rmax1 + 2*cm"/> <!-- lower radial limit of the extrusion --> <constant name="DRICH_sensorbox_rmax" value="DRICH_rmax2 + 5*cm"/> <!-- upper radial limit of the extrusion --> -<constant name="DRICH_sensorbox_dphi" value="48*degree"/> <!-- azimuthal width of the extrusion --> +<constant name="DRICH_sensorbox_dphi" value="42*degree"/> <!-- azimuthal width of the extrusion --> <!-- aerogel+filter geometry --> <constant name="DRICH_aerogel_thickness" value="4.0*cm"/> <!-- aerogel thickness --> <constant name="DRICH_airgap_thickness" value="0.01*mm"/> <!-- air gap between aerogel and filter --> @@ -328,7 +328,7 @@ photodetector unit (PDU) assembly diagram: matrix of SiPMs with services radius="110.0*cm" /> <sphericalpatch - phiw="30*degree" + phiw="18*degree" rmin="111.0*cm" rmax="179.0*cm" zmin="DRICH_snout_length + 4.0*cm" From 10fcb48e9d3a7ca048d94f2b4c76927e53a6891f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 20:25:58 -0400 Subject: [PATCH 078/113] [pre-commit.ci] pre-commit autoupdate (#714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <!--pre-commit.ci start--> updates: - [github.com/pre-commit/mirrors-clang-format: v18.1.3 → v18.1.4](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.3...v18.1.4) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 812231abd..236d6ff38 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.3 + rev: v18.1.4 hooks: - id: clang-format - repo: https://github.com/Lucas-C/pre-commit-hooks From 823e91f79650879b1bb39ff29bde50af10b73d34 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Thu, 25 Apr 2024 20:26:25 -0400 Subject: [PATCH 079/113] calibrations.xml: add hpdirc_positive.lut (#711) Adds hpDIRC LUT to support https://github.com/eic/EICrecon/pull/1365 I pick @nathanwbrei 's fork over https://github.com/rdom/fastpid since the file got a minor update ```diff diff --git a/hpdirc_positive.lut b/hpdirc_positive.lut index a0c5841..ac5b96d 100644 --- a/hpdirc_positive.lut +++ b/hpdirc_positive.lut @@ -1,3 +1,21 @@ +# PDG code of the particle (e 11, pi 211, K 321, p 2212) +11 211 321 2212 + +# Charge (-1,1) +1 + +# Momentum [GeV/c] +0.20 10.2 0.2 + +# Polar angle [deg] +25.0 161.0 1.0 + +# Azimuthal angle [deg] +0.0 30.5 0.5 + +# Outputs columns are P[e], P[pi], P[K], P[p] +# We ignore muons for now + 11 1 0.20 25.00 0.00 0.0000 0.0000 0.0000 0.0000 11 1 0.20 25.00 0.50 0.0000 0.0000 0.0000 0.0000 11 1 0.20 25.00 1.00 0.0000 0.0000 0.0000 0.0000 ``` --- compact/calibrations.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compact/calibrations.xml b/compact/calibrations.xml index 07ba8aa2f..250d0709a 100644 --- a/compact/calibrations.xml +++ b/compact/calibrations.xml @@ -9,6 +9,11 @@ <arg value="file:calibrations/onnx/identity_gemm_w1x1_b1.onnx"/> <arg value="url:https://github.com/eic/epic-data/raw/27ef75b2b6108b5e72d3ab891f32aeeb3770c7bd/onnx/identity_gemm_w1x1_b1.onnx"/> </plugin> + <plugin name="epic_FileLoader"> + <arg value="cache:$DETECTOR_PATH:/opt/detector"/> + <arg value="file:calibrations/hpdirc_positive.lut"/> + <arg value="url:https://raw.githubusercontent.com/nathanwbrei/fastpid/66acf386f368d8fe95cbf157407492e92344ee7f/hpdirc_positive.lut"/> + </plugin> </plugins> </lccdd> From 81162e06dd01fe52f0d874a940c37d58293bd437 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Sun, 28 Apr 2024 19:17:08 -0500 Subject: [PATCH 080/113] fix: update tracker support and services cones per project CAD info (#661) ### Briefly, what does this PR introduce? This PR adds the outer support/services cone and places the cones and barrels in their actual intended positions. I'm marking this as a bugfix since the placement was completely wrong (with tracks in some regions going through two support cylinders...). TODO: - [x] #663 - [x] #673 - this is not really a dependency, but if the radius of that system increases, we want to figure it out before putting in the services - [x] #668 - [x] #683 - [x] #684 ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @sly2j ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, it adds the project's estimate of the equivalent aluminum thickness of the services. --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/pid/drich.xml | 2 +- compact/tracking/definitions_craterlake.xml | 5 +- .../tracking/support_service_craterlake.xml | 651 +++++++++++++++--- src/BarrelCalorimeterScFi_geo.cpp | 2 +- src/SupportServiceMaterial_geo.cpp | 64 +- 5 files changed, 638 insertions(+), 86 deletions(-) diff --git a/compact/pid/drich.xml b/compact/pid/drich.xml index 5e8b027d4..cde823bfa 100644 --- a/compact/pid/drich.xml +++ b/compact/pid/drich.xml @@ -22,7 +22,7 @@ <constant name="DRICH_rmax2" value="ForwardPIDRegion_rmax"/> <!-- cylinder radius --> <!-- sensor boxes: extrusions of the tank, to hold the sensors and their services --> <constant name="DRICH_sensorbox_length" value="50.0*cm"/> <!-- z-length of the extrusion --> -<constant name="DRICH_sensorbox_rmin" value="DRICH_rmax1 + 2*cm"/> <!-- lower radial limit of the extrusion --> +<constant name="DRICH_sensorbox_rmin" value="108*cm"/> <!-- lower radial limit of the extrusion --> <constant name="DRICH_sensorbox_rmax" value="DRICH_rmax2 + 5*cm"/> <!-- upper radial limit of the extrusion --> <constant name="DRICH_sensorbox_dphi" value="42*degree"/> <!-- azimuthal width of the extrusion --> <!-- aerogel+filter geometry --> diff --git a/compact/tracking/definitions_craterlake.xml b/compact/tracking/definitions_craterlake.xml index e0403f9c6..ce5bc835e 100644 --- a/compact/tracking/definitions_craterlake.xml +++ b/compact/tracking/definitions_craterlake.xml @@ -56,8 +56,9 @@ <constant name="ForwardTOF_zmin" value="ForwardTOFRegion_zmin + ForwardTOFRegion_length - ForwardTOF_length - 1*cm"/> <comment> Service/Support setup </comment> - <constant name="TrackerSupportCyl_rmin1" value="TrackerEndcapDisk_rmax + 0.2*cm"/> - <constant name="TrackerSupportCyl_rmin2" value="InnerMPGDBarrel_rmin - 1.2*cm"/> + <constant name="TrackerSupportCyl_rmin1" value="TrackerEndcapDisk_rmax + 2*cm"/> <comment> Ref: Services Material Budget 24.03.04..stp -- 450.00 mm </comment> + <constant name="TrackerSupportCylEndcapN_rmin2" value="BackwardPIDRegion_rmax + 4.5*cm"/> <comment> Ref: Services Material Budget 24.03.13.stp -- 670.00 mm, nudged 5 mm </comment> + <constant name="TrackerSupportCylEndcapP_rmin2" value="ForwardTOFRegion_maxR + 2*cm"/> <comment> Ref: Services Material Budget 24.03.04..stp -- 520.00 mm </comment> <comment> These may belong in definitions.xml </comment> <constant name="InnerTrackerEndcapP_zmax" value="CentralTrackingRegionP_zmax"/> <constant name="InnerTrackerEndcapN_zmax" value="CentralTrackingRegionN_zmax"/> diff --git a/compact/tracking/support_service_craterlake.xml b/compact/tracking/support_service_craterlake.xml index 55ba62bff..9deca9f98 100644 --- a/compact/tracking/support_service_craterlake.xml +++ b/compact/tracking/support_service_craterlake.xml @@ -7,6 +7,26 @@ See https://indico.bnl.gov/event/19854/#1-updated-epic-tracking-config Silicon tracker: the same effective thickness parameters from previous versions, routing changed MPGD: estimated by M. Posik + ┌───── + B + │ + / + A + / + │ + │ + ─2C─2B─2A─\ Outer Support Cone /─2A─2B─2C─2D─2E─┘ + Ecal pfRICH \ / + \ / + \─1C──1B──1A─\ Inner Support /─1A────1B─────1C────/ Outer Support Cone + \ Cones / + \ / + \ / + │ │ + │ │ + N (-) └ ┘ (+) P + ──·──·──·──·──·────·──·──·──·──·── x ──·──·──·──·──·──·──·──·──·────·──·──·──·──·──·── z + </comment> <define> @@ -24,34 +44,33 @@ <comment> Inner tracker service/support cones, symmetric </comment> <constant name="InnerSupportConeCF_thickness" value="2.0*mm" /> <comment> Effective Aluminum for services for now </comment> - <constant name="InnerSupportConeAlP_thickness" value="2.0*mm" /> - <constant name="InnerSupportConeAlN_thickness" value="1.5*mm" /> - <constant name="InnerSupportConeP_thickness" value="InnerSupportConeAlP_thickness + InnerSupportConeCF_thickness" /> - <constant name="InnerSupportConeN_thickness" value="InnerSupportConeAlN_thickness + InnerSupportConeCF_thickness" /> - <constant name="InnerSupportCone_zmin" value="VertexSupportRing_zmax+2*um" /> + <constant name="InnerSupportConePAl_thickness" value="4.9*mm - 0.5*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp - 0.5*mm to avoid overlap with OuterSiBarrel </comment> + <constant name="InnerSupportConeNAl_thickness" value="4.4*mm - 0.5*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp - 0.5*mm to avoid overlap with OuterSiBarrel </comment> + <constant name="InnerSupportConeP_thickness" value="InnerSupportConePAl_thickness + InnerSupportConeCF_thickness" /> + <constant name="InnerSupportConeN_thickness" value="InnerSupportConeNAl_thickness + InnerSupportConeCF_thickness" /> + <constant name="InnerSupportCone_zmin" value="VertexSupportRing_zmax" /> <constant name="InnerSupportCone_rmin1" value="InnerSupportCone_zmin/tan(TrackerPrimaryAngle)" /> - <constant name="InnerSupportCone_rmin2" value="InnerMPGDBarrel_rmin-2*cm" /> + <constant name="InnerSupportCone_rmin2" value="TrackerSupportCyl_rmin1" /> <constant name="InnerSupportCone_zmax" value="InnerSupportCone_rmin2/tan(TrackerPrimaryAngle)" /> <constant name="InnerSupportCone_z" value="0.5*(InnerSupportCone_zmax + InnerSupportCone_zmin)" /> <constant name="InnerSupportCone_length" value="InnerSupportCone_zmax - InnerSupportCone_zmin" /> - <comment> Tracker disk support barrels. 1: inner, 2: outer. All z parameters are unsigned - TBD: second cones to connect two barrels - </comment> + + <comment> Tracker disk support barrels. 1: inner, 2: outer. All z parameters are unsigned </comment> <comment> 1: Inner barrel for Si disk, 3 slices each ends (Negative CBA, Positive ABC) </comment> <constant name="TrackerSupportCylCF_thickness1" value="InnerSupportConeCF_thickness" /> <comment> Positive </comment> - <constant name="TrackerSupportCylEndcapP_zmin1A" value="TrackerEndcapPDisk1_zmin + 1*cm" /> + <constant name="TrackerSupportCylEndcapP_zmin1A" value="InnerSupportCone_zmax" /> <constant name="TrackerSupportCylEndcapP_zmin1B" value="TrackerEndcapPDisk2_zmin" /> <constant name="TrackerSupportCylEndcapP_zmin1C" value="TrackerEndcapPDisk3_zmin" /> <constant name="TrackerSupportCylEndcapP_zmax1A" value="TrackerEndcapPDisk2_zmin" /> <constant name="TrackerSupportCylEndcapP_zmax1B" value="TrackerEndcapPDisk3_zmin" /> - <constant name="TrackerSupportCylEndcapP_zmax1C" value="InnerMPGDBarrel_zmax+1*cm" /> <comment> 136cm </comment> + <constant name="TrackerSupportCylEndcapP_zmax1C" value="129.7*cm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> <constant name="TrackerSupportCylEndcapP_z1A" value="0.5*(TrackerSupportCylEndcapP_zmin1A + TrackerSupportCylEndcapP_zmax1A)" /> <constant name="TrackerSupportCylEndcapP_z1B" value="0.5*(TrackerSupportCylEndcapP_zmin1B + TrackerSupportCylEndcapP_zmax1B)" /> @@ -61,21 +80,21 @@ <constant name="TrackerSupportCylEndcapP_length1B" value="TrackerSupportCylEndcapP_zmax1B - TrackerSupportCylEndcapP_zmin1B" /> <constant name="TrackerSupportCylEndcapP_length1C" value="TrackerSupportCylEndcapP_zmax1C - TrackerSupportCylEndcapP_zmin1C" /> - <constant name="TrackerSupportCylAlP_thickness1A" value="0.11*mm" /> - <constant name="TrackerSupportCylAlP_thickness1B" value="1.31*mm" /> - <constant name="TrackerSupportCylAlP_thickness1C" value="2.62*mm" /> - <constant name="TrackerSupportCylP_thickness1A" value="TrackerSupportCylAlP_thickness1A + TrackerSupportCylCF_thickness1" /> - <constant name="TrackerSupportCylP_thickness1B" value="TrackerSupportCylAlP_thickness1B + TrackerSupportCylCF_thickness1" /> - <constant name="TrackerSupportCylP_thickness1C" value="TrackerSupportCylAlP_thickness1C + TrackerSupportCylCF_thickness1" /> + <constant name="TrackerSupportCylAlP_thickness1A" value="5.0*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlP_thickness1B" value="5.0*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlP_thickness1C" value="5.0*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylP_thickness1A" value="TrackerSupportCylAlP_thickness1A + TrackerSupportCylCF_thickness1" /> + <constant name="TrackerSupportCylP_thickness1B" value="TrackerSupportCylAlP_thickness1B + TrackerSupportCylCF_thickness1" /> + <constant name="TrackerSupportCylP_thickness1C" value="TrackerSupportCylAlP_thickness1C + TrackerSupportCylCF_thickness1" /> <comment> Negative </comment> - <constant name="TrackerSupportCylEndcapN_zmin1A" value="TrackerEndcapNDisk1_zmin + 1*cm" /> + <constant name="TrackerSupportCylEndcapN_zmin1A" value="InnerSupportCone_zmax" /> <constant name="TrackerSupportCylEndcapN_zmin1B" value="TrackerEndcapNDisk2_zmin" /> <constant name="TrackerSupportCylEndcapN_zmin1C" value="TrackerEndcapNDisk3_zmin" /> <constant name="TrackerSupportCylEndcapN_zmax1A" value="TrackerEndcapNDisk2_zmin" /> <constant name="TrackerSupportCylEndcapN_zmax1B" value="TrackerEndcapNDisk3_zmin" /> - <constant name="TrackerSupportCylEndcapN_zmax1C" value="InnerMPGDBarrel_zmin+1*cm" /> <comment> 106cm </comment> + <constant name="TrackerSupportCylEndcapN_zmax1C" value="101.0*cm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> <constant name="TrackerSupportCylEndcapN_z1A" value="0.5*(TrackerSupportCylEndcapN_zmin1A + TrackerSupportCylEndcapN_zmax1A)" /> <constant name="TrackerSupportCylEndcapN_z1B" value="0.5*(TrackerSupportCylEndcapN_zmin1B + TrackerSupportCylEndcapN_zmax1B)" /> @@ -85,12 +104,43 @@ <constant name="TrackerSupportCylEndcapN_length1B" value="TrackerSupportCylEndcapN_zmax1B - TrackerSupportCylEndcapN_zmin1B" /> <constant name="TrackerSupportCylEndcapN_length1C" value="TrackerSupportCylEndcapN_zmax1C - TrackerSupportCylEndcapN_zmin1C" /> - <constant name="TrackerSupportCylAlN_thickness1A" value="0.01*mm" /> <comment> place holder to avoid zero thickness error </comment> - <constant name="TrackerSupportCylAlN_thickness1B" value="1.13*mm" /> - <constant name="TrackerSupportCylAlN_thickness1C" value="2.25*mm" /> - <constant name="TrackerSupportCylN_thickness1A" value="TrackerSupportCylAlN_thickness1A + TrackerSupportCylCF_thickness1" /> - <constant name="TrackerSupportCylN_thickness1B" value="TrackerSupportCylAlN_thickness1B + TrackerSupportCylCF_thickness1" /> - <constant name="TrackerSupportCylN_thickness1C" value="TrackerSupportCylAlN_thickness1C + TrackerSupportCylCF_thickness1" /> + <constant name="TrackerSupportCylAlN_thickness1A" value="5.0*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlN_thickness1B" value="5.0*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlN_thickness1C" value="5.0*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylN_thickness1A" value="TrackerSupportCylAlN_thickness1A + TrackerSupportCylCF_thickness1" /> + <constant name="TrackerSupportCylN_thickness1B" value="TrackerSupportCylAlN_thickness1B + TrackerSupportCylCF_thickness1" /> + <constant name="TrackerSupportCylN_thickness1C" value="TrackerSupportCylAlN_thickness1C + TrackerSupportCylCF_thickness1" /> + + + <comment> Outer tracker service/support cones, asymmetric </comment> + <constant name="OuterSupportConeCF_thickness" value="2.0*mm" /> + <comment> Effective Aluminum for services for now </comment> + <constant name="OuterSupportConePAl_thickness" value="10.3*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="OuterSupportConeNAl_thickness" value="10.3*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="OuterSupportConeP_thickness" value="OuterSupportConePAl_thickness + OuterSupportConeCF_thickness" /> + <constant name="OuterSupportConeN_thickness" value="OuterSupportConeNAl_thickness + OuterSupportConeCF_thickness" /> + + <comment> Negative outer tracker service/support cone </comment> + <constant name="OuterSupportConeN_zmin" value="TrackerSupportCylEndcapN_zmax1C" /> + <constant name="OuterSupportConeN_rmin1" value="TrackerSupportCyl_rmin1" /> + <constant name="OuterSupportConeN_tan" value="OuterSupportConeN_rmin1/OuterSupportConeN_zmin" /> + + <constant name="OuterSupportConeN_rmin2" value="TrackerSupportCylEndcapN_rmin2" /> + <constant name="OuterSupportConeN_zmax" value="125.0*cm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + + <constant name="OuterSupportConeN_z" value="0.5*(OuterSupportConeN_zmax + OuterSupportConeN_zmin)" /> + <constant name="OuterSupportConeN_length" value="OuterSupportConeN_zmax - OuterSupportConeN_zmin" /> + + <comment> Positive outer tracker service/support cone </comment> + <constant name="OuterSupportConeP_zmin" value="TrackerSupportCylEndcapP_zmax1C" /> + <constant name="OuterSupportConeP_rmin1" value="TrackerSupportCyl_rmin1" /> + <constant name="OuterSupportConeP_tan" value="OuterSupportConeP_rmin1/OuterSupportConeP_zmin" /> + + <constant name="OuterSupportConeP_rmin2" value="TrackerSupportCylEndcapP_rmin2" /> + <constant name="OuterSupportConeP_zmax" value="OuterSupportConeP_rmin2/OuterSupportConeP_tan" /> + + <constant name="OuterSupportConeP_z" value="0.5*(OuterSupportConeP_zmax + OuterSupportConeP_zmin)" /> + <constant name="OuterSupportConeP_length" value="OuterSupportConeP_zmax - OuterSupportConeP_zmin" /> <comment> 2. Outer barrel for Si barrel cables (guided out projectively) and MPGD (inner+disks). </comment> @@ -98,17 +148,17 @@ <comment> Positive </comment> - <constant name="TrackerSupportCylEndcapP_zmin2A" value="InnerSupportCone_zmax" /> <comment> ~48.75cm </comment> - <constant name="TrackerSupportCylEndcapP_zmin2B" value="53.75*cm" /> - <constant name="TrackerSupportCylEndcapP_zmin2C" value="135*cm" /> - <constant name="TrackerSupportCylEndcapP_zmin2D" value="148*cm" /> - <constant name="TrackerSupportCylEndcapP_zmin2E" value="161*cm" /> + <constant name="TrackerSupportCylEndcapP_zmin2A" value="OuterSupportConeP_zmax" /> + <constant name="TrackerSupportCylEndcapP_zmin2B" value="max(53.75*cm, TrackerSupportCylEndcapP_zmin2A + 1*mm)" /> + <constant name="TrackerSupportCylEndcapP_zmin2C" value="max(135*cm, TrackerSupportCylEndcapP_zmin2B + 1*mm)" /> + <constant name="TrackerSupportCylEndcapP_zmin2D" value="max(148*cm, TrackerSupportCylEndcapP_zmin2C + 1*mm)" /> + <constant name="TrackerSupportCylEndcapP_zmin2E" value="max(161*cm, TrackerSupportCylEndcapP_zmin2D + 1*mm)" /> <constant name="TrackerSupportCylEndcapP_zmax2A" value="TrackerSupportCylEndcapP_zmin2B" /> <constant name="TrackerSupportCylEndcapP_zmax2B" value="TrackerSupportCylEndcapP_zmin2C" /> <constant name="TrackerSupportCylEndcapP_zmax2C" value="TrackerSupportCylEndcapP_zmin2D" /> <constant name="TrackerSupportCylEndcapP_zmax2D" value="TrackerSupportCylEndcapP_zmin2E" /> - <constant name="TrackerSupportCylEndcapP_zmax2E" value="InnerTrackerEndcapP_zmax" /> <comment> 180cm. Should be ~174cm </comment> + <constant name="TrackerSupportCylEndcapP_zmax2E" value="EcalBarrelForward_zmax" /> <constant name="TrackerSupportCylEndcapP_z2A" value="0.5*(TrackerSupportCylEndcapP_zmin2A + TrackerSupportCylEndcapP_zmax2A)" /> <constant name="TrackerSupportCylEndcapP_z2B" value="0.5*(TrackerSupportCylEndcapP_zmin2B + TrackerSupportCylEndcapP_zmax2B)" /> @@ -122,32 +172,48 @@ <constant name="TrackerSupportCylEndcapP_length2D" value="TrackerSupportCylEndcapP_zmax2D - TrackerSupportCylEndcapP_zmin2D" /> <constant name="TrackerSupportCylEndcapP_length2E" value="TrackerSupportCylEndcapP_zmax2E - TrackerSupportCylEndcapP_zmin2E" /> - <comment> cables from Si tracker to outer barrels </comment> - <constant name="TrackerSupportCylAlP_thickness2SiCone" value="3.10*mm" /> <comment> cables from the Si cone </comment> - <constant name="TrackerSupportCylAlP_thickness2SiDisk" value="3.04*mm" /> <comment> cables from the Si disks </comment> - - <comment> cables from MPGD</comment> - <constant name="TrackerSupportCylAlP_thickness2A" value="1.66*mm" /> - <constant name="TrackerSupportCylAlP_thickness2B" value="3.12*mm" /> - <constant name="TrackerSupportCylAlP_thickness2C" value="4.68*mm" /> - <constant name="TrackerSupportCylAlP_thickness2D" value="5.99*mm" /> - <constant name="TrackerSupportCylAlP_thickness2E" value="7.30*mm" /> + <comment> + <comment> grounds-up thickness determination </comment> + <comment> cables from Si tracker to outer barrels </comment> + <constant name="TrackerSupportCylAlP_thickness2SiCone" value="3.10*mm" /> <comment> cables from the Si cone </comment> + <constant name="TrackerSupportCylAlP_thickness2SiDisk" value="3.04*mm" /> <comment> cables from the Si disks </comment> + + <comment> cables from MPGD</comment> + <constant name="TrackerSupportCylAlP_thickness2A" value="1.66*mm" /> + <constant name="TrackerSupportCylAlP_thickness2B" value="3.12*mm" /> + <constant name="TrackerSupportCylAlP_thickness2C" value="4.68*mm" /> + <constant name="TrackerSupportCylAlP_thickness2D" value="5.99*mm" /> + <constant name="TrackerSupportCylAlP_thickness2E" value="7.30*mm" /> + + <comment> total</comment> + <constant name="TrackerSupportCylP_thickness2A" value="TrackerSupportCylAlP_thickness2A + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone" /> + <constant name="TrackerSupportCylP_thickness2B" value="TrackerSupportCylAlP_thickness2B + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> + <constant name="TrackerSupportCylP_thickness2C" value="TrackerSupportCylAlP_thickness2C + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> + <constant name="TrackerSupportCylP_thickness2D" value="TrackerSupportCylAlP_thickness2D + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> + <constant name="TrackerSupportCylP_thickness2E" value="TrackerSupportCylAlP_thickness2E + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> + </comment> - <comment> total</comment> - <constant name="TrackerSupportCylP_thickness2A" value="TrackerSupportCylAlP_thickness2A + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone" /> - <constant name="TrackerSupportCylP_thickness2B" value="TrackerSupportCylAlP_thickness2B + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> - <constant name="TrackerSupportCylP_thickness2C" value="TrackerSupportCylAlP_thickness2C + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> - <constant name="TrackerSupportCylP_thickness2D" value="TrackerSupportCylAlP_thickness2D + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> - <constant name="TrackerSupportCylP_thickness2E" value="TrackerSupportCylAlP_thickness2E + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlP_thickness2SiCone+TrackerSupportCylAlP_thickness2SiDisk" /> + <comment> effective thickness </comment> + <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlP_thickness2A" value="10.3*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlP_thickness2B" value="10.3*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlP_thickness2C" value="10.3*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlP_thickness2D" value="10.3*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlP_thickness2E" value="10.3*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylP_thickness2A" value="TrackerSupportCylAlP_thickness2A + TrackerSupportCylCF_thickness2" /> + <constant name="TrackerSupportCylP_thickness2B" value="TrackerSupportCylAlP_thickness2B + TrackerSupportCylCF_thickness2" /> + <constant name="TrackerSupportCylP_thickness2C" value="TrackerSupportCylAlP_thickness2C + TrackerSupportCylCF_thickness2" /> + <constant name="TrackerSupportCylP_thickness2D" value="TrackerSupportCylAlP_thickness2D + TrackerSupportCylCF_thickness2" /> + <constant name="TrackerSupportCylP_thickness2E" value="TrackerSupportCylAlP_thickness2E + TrackerSupportCylCF_thickness2" /> <comment> Negative </comment> - <constant name="TrackerSupportCylEndcapN_zmin2A" value="InnerSupportCone_zmax" /> <comment> ~ 48.75cm </comment> - <constant name="TrackerSupportCylEndcapN_zmin2B" value="105*cm" /> - <constant name="TrackerSupportCylEndcapN_zmin2C" value="110*cm" /> + <constant name="TrackerSupportCylEndcapN_zmin2A" value="OuterSupportConeN_zmax" /> + <constant name="TrackerSupportCylEndcapN_zmin2B" value="max(105*cm, TrackerSupportCylEndcapN_zmin2A + 1*mm)" /> + <constant name="TrackerSupportCylEndcapN_zmin2C" value="max(110*cm, TrackerSupportCylEndcapN_zmin2B + 1*mm)" /> <constant name="TrackerSupportCylEndcapN_zmax2A" value="TrackerSupportCylEndcapN_zmin2B" /> <constant name="TrackerSupportCylEndcapN_zmax2B" value="TrackerSupportCylEndcapN_zmin2C" /> - <constant name="TrackerSupportCylEndcapN_zmax2C" value="InnerTrackerEndcapN_zmax" /> <comment> 123.6cm. Should be 120cm </comment> + <constant name="TrackerSupportCylEndcapN_zmax2C" value="280*cm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> <constant name="TrackerSupportCylEndcapN_z2A" value="0.5*(TrackerSupportCylEndcapN_zmin2A + TrackerSupportCylEndcapN_zmax2A)" /> <constant name="TrackerSupportCylEndcapN_z2B" value="0.5*(TrackerSupportCylEndcapN_zmin2B + TrackerSupportCylEndcapN_zmax2B)" /> @@ -157,24 +223,98 @@ <constant name="TrackerSupportCylEndcapN_length2B" value="TrackerSupportCylEndcapN_zmax2B - TrackerSupportCylEndcapN_zmin2B" /> <constant name="TrackerSupportCylEndcapN_length2C" value="TrackerSupportCylEndcapN_zmax2C - TrackerSupportCylEndcapN_zmin2C" /> - <comment> cables from Si tracker to outer barrels </comment> - <constant name="TrackerSupportCylAlN_thickness2SiCone" value="3.71*mm" /> - <constant name="TrackerSupportCylAlN_thickness2SiDisk" value="3.04*mm" /> - <comment> cables from MPGD </comment> - <constant name="TrackerSupportCylAlN_thickness2A" value="1.56*mm" /> - <constant name="TrackerSupportCylAlN_thickness2B" value="3.12*mm" /> - <constant name="TrackerSupportCylAlN_thickness2C" value="4.43*mm" /> - <constant name="TrackerSupportCylN_thickness2A" value="TrackerSupportCylAlN_thickness2A + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlN_thickness2SiCone" /> - <constant name="TrackerSupportCylN_thickness2B" value="TrackerSupportCylAlN_thickness2B + TrackerSupportCylCF_thickness2 + TrackerSupportCylAlN_thickness2SiCone+TrackerSupportCylAlN_thickness2SiDisk" /> - <constant name="TrackerSupportCylN_thickness2C" value="TrackerSupportCylAlN_thickness2C + TrackerSupportCylCF_thickness2 + TrackerSupportCylAlN_thickness2SiCone+TrackerSupportCylAlN_thickness2SiDisk" /> - - <comment> Inner detector support cylinder </comment> - <constant name="InnerDetectorBarrelSupportCylCF_thickness" value="1.0*cm" /> - <constant name="InnerDetectorBarrelSupportCylCF_zmin1" value="MPGDOuterBarrelModule_zmin1" /> - <constant name="InnerDetectorBarrelSupportCylCF_zmin2" value="MPGDOuterBarrelModule_zmin2" /> - <constant name="InnerDetectorBarrelSupportCylCF_length" value="InnerDetectorBarrelSupportCylCF_zmin1 + InnerDetectorBarrelSupportCylCF_zmin2" /> - <constant name="InnerDetectorBarrelSupportCylCF_offset" value="(InnerDetectorBarrelSupportCylCF_zmin2 - InnerDetectorBarrelSupportCylCF_zmin1)/2.0"/> - <constant name="InnerDetectorBarrelSupportCylCF_rmin" value="MPGDOuterBarrelModule_rmin - InnerDetectorBarrelSupportCylCF_thickness - 2*mm" /> + <comment> + <comment> grounds-up thickness determination </comment> + <comment> cables from Si tracker to outer barrels </comment> + <constant name="TrackerSupportCylAlN_thickness2SiCone" value="3.71*mm" /> + <constant name="TrackerSupportCylAlN_thickness2SiDisk" value="3.04*mm" /> + <comment> cables from MPGD </comment> + <constant name="TrackerSupportCylAlN_thickness2A" value="1.56*mm" /> + <constant name="TrackerSupportCylAlN_thickness2B" value="3.12*mm" /> + <constant name="TrackerSupportCylAlN_thickness2C" value="4.43*mm" /> + <constant name="TrackerSupportCylN_thickness2A" value="TrackerSupportCylAlN_thickness2A + TrackerSupportCylCF_thickness2+ TrackerSupportCylAlN_thickness2SiCone" /> + <constant name="TrackerSupportCylN_thickness2B" value="TrackerSupportCylAlN_thickness2B + TrackerSupportCylCF_thickness2 + TrackerSupportCylAlN_thickness2SiCone+TrackerSupportCylAlN_thickness2SiDisk" /> + <constant name="TrackerSupportCylN_thickness2C" value="TrackerSupportCylAlN_thickness2C + TrackerSupportCylCF_thickness2 + TrackerSupportCylAlN_thickness2SiCone+TrackerSupportCylAlN_thickness2SiDisk" /> + </comment> + + <comment> effective thickness </comment> + <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlN_thickness2A" value="8.2*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlN_thickness2B" value="8.2*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylAlN_thickness2C" value="8.2*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportCylN_thickness2A" value="TrackerSupportCylAlN_thickness2A + TrackerSupportCylCF_thickness2" /> + <constant name="TrackerSupportCylN_thickness2B" value="TrackerSupportCylAlN_thickness2A + TrackerSupportCylCF_thickness2" /> + <constant name="TrackerSupportCylN_thickness2C" value="TrackerSupportCylAlN_thickness2A + TrackerSupportCylCF_thickness2" /> + + <comment> 3. Positive endcap disk routing for services. </comment> + <constant name="TrackerSupportDiskEndcapCF_thickness" value="2.0*mm" /> + <constant name="TrackerSupportDiskEndcapPAl_thickness" value="0.5 * (10.3*mm + 34.0*mm)" /> <comment> Average of inner and outer thickness </comment> + <constant name="TrackerSupportDiskEndcapP_thickness" value="TrackerSupportDiskEndcapCF_thickness+TrackerSupportDiskEndcapPAl_thickness" /> + <constant name="TrackerSupportDiskEndcapP_zmin" value="TrackerSupportCylEndcapP_zmax2E" /> + <constant name="TrackerSupportDiskEndcapP_zmax" value="TrackerSupportDiskEndcapP_zmin + TrackerSupportDiskEndcapP_thickness" /> + <constant name="TrackerSupportDiskEndcapP_rmin" value="TrackerSupportCylEndcapP_rmin2" /> + <constant name="TrackerSupportDiskEndcapP_rmax" value="920.6*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportDiskEndcapP_z" value="0.5*(TrackerSupportDiskEndcapP_zmin + TrackerSupportDiskEndcapP_zmax)" /> + + <comment> 4. Segments between DRICH readout boxes. </comment> + + <comment> Blind cone segments that do not continue into DRICH readout boxes </comment> + <constant name="TrackerSupportDRICHBlindConeSegmentCF_thickness" value="2.0*mm" /> + <constant name="TrackerSupportDRICHBlindConeSegmentAl_thickness" value="0.5 * (30.6*mm + 86.7*mm)" /> <comment> Average of inner and outer thickness </comment> + <constant name="TrackerSupportDRICHBlindConeSegment_thickness" value="TrackerSupportDRICHBlindConeSegmentCF_thickness + TrackerSupportDRICHBlindConeSegmentAl_thickness" /> + <constant name="TrackerSupportDRICHBlindConeSegment_deltaphi" value="60*deg - 18*deg" /> + <constant name="TrackerSupportDRICHBlindConeSegment_zmin" value="TrackerSupportDiskEndcapP_zmax" /> + <constant name="TrackerSupportDRICHBlindConeSegment_zmax" value="214.0*cm" /> + <constant name="TrackerSupportDRICHBlindConeSegment_rmin" value="TrackerSupportDiskEndcapP_rmax" /> + <constant name="TrackerSupportDRICHBlindConeSegment_rmin1" value="TrackerSupportDiskEndcapP_rmax" /> + <constant name="TrackerSupportDRICHBlindConeSegment_rmin2" value="108.0*cm" /> <comment> Modified from 110*cm to DRICH_sensorbox_rmin = 108*cm </comment> + <constant name="TrackerSupportDRICHBlindConeSegment_rmax" value="TrackerSupportDRICHBlindConeSegment_rmin2" /> + <constant name="TrackerSupportDRICHBlindConeSegment_z" value="0.5*(TrackerSupportDRICHBlindConeSegment_zmax + TrackerSupportDRICHBlindConeSegment_zmin)" /> + <constant name="TrackerSupportDRICHBlindConeSegment_length" value="TrackerSupportDRICHBlindConeSegment_zmax - TrackerSupportDRICHBlindConeSegment_zmin" /> + + <comment> Cone segments "A" that continue between the DRICH readout boxes </comment> + <constant name="TrackerSupportDRICHConeSegmentACF_thickness" value="TrackerSupportDRICHBlindConeSegmentCF_thickness" /> + <constant name="TrackerSupportDRICHConeSegmentAAl_thickness" value="TrackerSupportDRICHBlindConeSegmentAl_thickness" /> + <constant name="TrackerSupportDRICHConeSegmentA_thickness" value="TrackerSupportDRICHConeSegmentACF_thickness+TrackerSupportDRICHConeSegmentAAl_thickness" /> + <constant name="TrackerSupportDRICHConeSegmentA_deltaphi" value="18*deg" /> + <constant name="TrackerSupportDRICHConeSegmentA_zmin" value="TrackerSupportDiskEndcapP_zmax" /> + <constant name="TrackerSupportDRICHConeSegmentA_zmax" value="216.8*cm" /> + <constant name="TrackerSupportDRICHConeSegmentA_rmin1" value="TrackerSupportDiskEndcapP_rmax" /> + <constant name="TrackerSupportDRICHConeSegmentA_rmin2" value="113.2*cm" /> + <constant name="TrackerSupportDRICHConeSegmentA_rmax" value="TrackerSupportDRICHConeSegmentA_rmin2" /> + <constant name="TrackerSupportDRICHConeSegmentA_z" value="0.5*(TrackerSupportDRICHConeSegmentA_zmax + TrackerSupportDRICHConeSegmentA_zmin)" /> + <constant name="TrackerSupportDRICHConeSegmentA_length" value="TrackerSupportDRICHConeSegmentA_zmax - TrackerSupportDRICHConeSegmentA_zmin" /> + + <comment> Cone segments "B" that go between the DRICH readout boxes </comment> + <constant name="TrackerSupportDRICHConeSegmentBCF_thickness" value="2.0*mm" /> + <constant name="TrackerSupportDRICHConeSegmentBAl_thickness" value="104.7*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportDRICHConeSegmentB_thickness" value="TrackerSupportDRICHConeSegmentBCF_thickness + TrackerSupportDRICHConeSegmentBAl_thickness" /> + <constant name="TrackerSupportDRICHConeSegmentB_deltaphi" value="18*deg" /> + <constant name="TrackerSupportDRICHConeSegmentB_zmin" value="2070.3*mm" /> + <constant name="TrackerSupportDRICHConeSegmentB_zmax" value="2310.2*mm" /> + <constant name="TrackerSupportDRICHConeSegmentB_rmin" value="TrackerSupportDRICHConeSegmentA_rmax" /> + <constant name="TrackerSupportDRICHConeSegmentB_rmin1" value="634.1*mm" /> + <constant name="TrackerSupportDRICHConeSegmentB_rmin2" value="1800.0*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportDRICHConeSegmentB_rmax" value="1868.6*mm" /> + <constant name="TrackerSupportDRICHConeSegmentB_z" value="0.5*(TrackerSupportDRICHConeSegmentB_zmax + TrackerSupportDRICHConeSegmentB_zmin)" /> + <constant name="TrackerSupportDRICHConeSegmentB_length" value="TrackerSupportDRICHConeSegmentB_zmax - TrackerSupportDRICHConeSegmentB_zmin" /> + + <constant name="TrackerSupportDRICHCylSegmentAl_thickness" value="68.6*mm" /> <comment> Ref: Services Material Budget 24.03.13.stp </comment> + <constant name="TrackerSupportDRICHCylSegment_thickness" value="TrackerSupportDRICHCylSegmentAl_thickness" /> + <constant name="TrackerSupportDRICHCylSegment_deltaphi" value="18*deg" /> + <constant name="TrackerSupportDRICHCylSegment_zmin" value="2310.2*mm" /> + <constant name="TrackerSupportDRICHCylSegment_zmax" value="2972.6*mm" /> + <constant name="TrackerSupportDRICHCylSegment_rmin" value="1800.0*mm" /> + <constant name="TrackerSupportDRICHCylSegment_z" value="0.5*(TrackerSupportDRICHCylSegment_zmax + TrackerSupportDRICHCylSegment_zmin)" /> + <constant name="TrackerSupportDRICHCylSegment_length" value="TrackerSupportDRICHCylSegment_zmax - TrackerSupportDRICHCylSegment_zmin" /> + + <comment> Inner detector support cylinder </comment> + <constant name="InnerDetectorBarrelSupportCylCF_thickness" value="1.0*cm" /> + <constant name="InnerDetectorBarrelSupportCylCF_zmin1" value="DIRCBackward_zmax" /> + <constant name="InnerDetectorBarrelSupportCylCF_zmin2" value="DIRCForward_zmax" /> + <constant name="InnerDetectorBarrelSupportCylCF_length" value="InnerDetectorBarrelSupportCylCF_zmin1 + InnerDetectorBarrelSupportCylCF_zmin2" /> + <constant name="InnerDetectorBarrelSupportCylCF_offset" value="(InnerDetectorBarrelSupportCylCF_zmin2 - InnerDetectorBarrelSupportCylCF_zmin1)/2.0"/> + <constant name="InnerDetectorBarrelSupportCylCF_rmin" value="MPGDOuterBarrelModule_rmin - InnerDetectorBarrelSupportCylCF_thickness - 2*mm" /> </define> @@ -211,10 +351,11 @@ vis="TrackerSupportVis" rmin1="InnerSupportCone_rmin2" rmin2="InnerSupportCone_rmin1" + rmax="TrackerSupportCyl_rmin1+TrackerSupportCylN_thickness1A" length="InnerSupportCone_length" thickness="InnerSupportConeN_thickness"> <position x="0*cm" y="0*cm" z="-InnerSupportCone_z" /> - <component material="Aluminum" thickness="InnerSupportConeAlN_thickness" name="Services" vis="TrackerServiceVis" /> + <component material="Aluminum" thickness="InnerSupportConeNAl_thickness" name="Services" vis="TrackerServiceVis" /> <component material="CarbonFiber" thickness="InnerSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> </support> <support type="Cone" @@ -222,10 +363,11 @@ vis="TrackerSupportVis" rmin1="InnerSupportCone_rmin1" rmin2="InnerSupportCone_rmin2" + rmax="TrackerSupportCyl_rmin1+TrackerSupportCylP_thickness1A" length="InnerSupportCone_length" thickness="InnerSupportConeP_thickness"> <position x="0*cm" y="0*cm" z="InnerSupportCone_z" /> - <component material="Aluminum" thickness="InnerSupportConeAlP_thickness" name="Services" vis="TrackerServiceVis" /> + <component material="Aluminum" thickness="InnerSupportConePAl_thickness" name="Services" vis="TrackerServiceVis" /> <component material="CarbonFiber" thickness="InnerSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> </support> @@ -290,11 +432,34 @@ <component material="CarbonFiber" thickness="TrackerSupportCylCF_thickness1" name="Support" vis="TrackerSupportVis"/> </support> + <support type="Cone" + name="OuterSupportConeEndcapN" + vis="TrackerSupportVis" + rmin1="OuterSupportConeN_rmin2" + rmin2="OuterSupportConeN_rmin1" + length="OuterSupportConeN_length" + thickness="OuterSupportConeN_thickness"> + <position x="0*cm" y="0*cm" z="-OuterSupportConeN_z" /> + <component material="Aluminum" thickness="OuterSupportConeNAl_thickness" name="Services" vis="TrackerServiceVis" /> + <component material="CarbonFiber" thickness="OuterSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> + </support> + <support type="Cone" + name="OuterSupportConeEndcapP" + vis="TrackerSupportVis" + rmin1="OuterSupportConeP_rmin1" + rmin2="OuterSupportConeP_rmin2" + length="OuterSupportConeP_length" + thickness="OuterSupportConeP_thickness"> + <position x="0*cm" y="0*cm" z="OuterSupportConeP_z" /> + <component material="Aluminum" thickness="OuterSupportConePAl_thickness" name="Services" vis="TrackerServiceVis" /> + <component material="CarbonFiber" thickness="OuterSupportConeCF_thickness" name="Support" vis="TrackerSupportVis"/> + </support> + <comment> outer barrel </comment> <support type="Cylinder" name="TrackerSupportCylEndcapN2A" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapN_rmin2" length="TrackerSupportCylEndcapN_length2A" thickness="TrackerSupportCylN_thickness2A"> <position x="0*cm" y="0*cm" z="-TrackerSupportCylEndcapN_z2A" /> @@ -304,7 +469,7 @@ <support type="Cylinder" name="TrackerSupportCylEndcapN2B" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapN_rmin2" length="TrackerSupportCylEndcapN_length2B" thickness="TrackerSupportCylN_thickness2B"> <position x="0*cm" y="0*cm" z="-TrackerSupportCylEndcapN_z2B" /> @@ -314,7 +479,7 @@ <support type="Cylinder" name="TrackerSupportCylEndcapN2C" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapN_rmin2" length="TrackerSupportCylEndcapN_length2C" thickness="TrackerSupportCylN_thickness2C"> <position x="0*cm" y="0*cm" z="-TrackerSupportCylEndcapN_z2C" /> @@ -325,7 +490,7 @@ <support type="Cylinder" name="TrackerSupportCylEndcapP2A" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapP_rmin2" length="TrackerSupportCylEndcapP_length2A" thickness="TrackerSupportCylP_thickness2A"> <position x="0*cm" y="0*cm" z="TrackerSupportCylEndcapP_z2A" /> @@ -335,7 +500,7 @@ <support type="Cylinder" name="TrackerSupportCylEndcapP2B" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapP_rmin2" length="TrackerSupportCylEndcapP_length2B" thickness="TrackerSupportCylP_thickness2B"> <position x="0*cm" y="0*cm" z="TrackerSupportCylEndcapP_z2B" /> @@ -345,7 +510,7 @@ <support type="Cylinder" name="TrackerSupportCylEndcapP2C" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapP_rmin2" length="TrackerSupportCylEndcapP_length2C" thickness="TrackerSupportCylP_thickness2C"> <position x="0*cm" y="0*cm" z="TrackerSupportCylEndcapP_z2C" /> @@ -355,7 +520,7 @@ <support type="Cylinder" name="TrackerSupportCylEndcapP2D" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapP_rmin2" length="TrackerSupportCylEndcapP_length2D" thickness="TrackerSupportCylP_thickness2D"> <position x="0*cm" y="0*cm" z="TrackerSupportCylEndcapP_z2D" /> @@ -365,7 +530,7 @@ <support type="Cylinder" name="TrackerSupportCylEndcapP2E" vis="TrackerSupportVis" - rmin="TrackerSupportCyl_rmin2" + rmin="TrackerSupportCylEndcapP_rmin2" length="TrackerSupportCylEndcapP_length2E" thickness="TrackerSupportCylP_thickness2E"> <position x="0*cm" y="0*cm" z="TrackerSupportCylEndcapP_z2E" /> @@ -373,6 +538,333 @@ <component material="CarbonFiber" thickness="TrackerSupportCylCF_thickness2" name="Support" vis="TrackerSupportVis"/> </support> + <support type="Disk" + name="TrackerSupportDiskEndcapP" + vis="TrackerSupportVis" + rmin="TrackerSupportDiskEndcapP_rmin" + rmax="TrackerSupportDiskEndcapP_rmax" + thickness="TrackerSupportDiskEndcapP_thickness"> + <position x="0*cm" y="0*cm" z="TrackerSupportDiskEndcapP_z" /> + <component material="Aluminum" thickness="TrackerSupportDiskEndcapPAl_thickness" name="Services" vis="TrackerServiceVis" /> + <component material="CarbonFiber" thickness="TrackerSupportDiskEndcapCF_thickness" name="Support" vis="TrackerSupportVis"/> + </support> + + <comment> Service routings in front of DRICH </comment> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentA_1" + vis="TrackerSupportVis" + rmax="TrackerSupportDRICHConeSegmentA_rmax" + rmin1="TrackerSupportDRICHConeSegmentA_rmin1" + rmin2="TrackerSupportDRICHConeSegmentA_rmin2" + length="TrackerSupportDRICHConeSegmentA_length" + thickness="TrackerSupportDRICHConeSegmentA_thickness" + phimin="0*deg-0.5*TrackerSupportDRICHConeSegmentA_deltaphi" + phimax="0*deg+0.5*TrackerSupportDRICHConeSegmentA_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentA_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentAAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentB_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHConeSegmentB_rmin" + rmax="TrackerSupportDRICHConeSegmentB_rmax" + rmin1="TrackerSupportDRICHConeSegmentB_rmin1" + rmin2="TrackerSupportDRICHConeSegmentB_rmin2" + length="TrackerSupportDRICHConeSegmentB_length" + thickness="TrackerSupportDRICHConeSegmentB_thickness" + phimin="0*deg-0.5*TrackerSupportDRICHConeSegmentB_deltaphi" + phimax="0*deg+0.5*TrackerSupportDRICHConeSegmentB_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentB_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentBAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHBlindConeSegment_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHBlindConeSegment_rmin" + rmax="TrackerSupportDRICHBlindConeSegment_rmax" + rmin1="TrackerSupportDRICHBlindConeSegment_rmin1" + rmin2="TrackerSupportDRICHBlindConeSegment_rmin2" + length="TrackerSupportDRICHBlindConeSegment_length" + thickness="TrackerSupportDRICHBlindConeSegment_thickness" + phimin="30*deg-0.5*TrackerSupportDRICHBlindConeSegment_deltaphi" + phimax="30*deg+0.5*TrackerSupportDRICHBlindConeSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHBlindConeSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHBlindConeSegmentAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentA_1" + vis="TrackerSupportVis" + rmax="TrackerSupportDRICHConeSegmentA_rmax" + rmin1="TrackerSupportDRICHConeSegmentA_rmin1" + rmin2="TrackerSupportDRICHConeSegmentA_rmin2" + length="TrackerSupportDRICHConeSegmentA_length" + thickness="TrackerSupportDRICHConeSegmentA_thickness" + phimin="60*deg-0.5*TrackerSupportDRICHConeSegmentA_deltaphi" + phimax="60*deg+0.5*TrackerSupportDRICHConeSegmentA_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentA_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentAAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentB_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHConeSegmentB_rmin" + rmax="TrackerSupportDRICHConeSegmentB_rmax" + rmin1="TrackerSupportDRICHConeSegmentB_rmin1" + rmin2="TrackerSupportDRICHConeSegmentB_rmin2" + length="TrackerSupportDRICHConeSegmentB_length" + thickness="TrackerSupportDRICHConeSegmentB_thickness" + phimin="60*deg-0.5*TrackerSupportDRICHConeSegmentB_deltaphi" + phimax="60*deg+0.5*TrackerSupportDRICHConeSegmentB_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentB_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentBAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHBlindConeSegment_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHBlindConeSegment_rmin" + rmax="TrackerSupportDRICHBlindConeSegment_rmax" + rmin1="TrackerSupportDRICHBlindConeSegment_rmin1" + rmin2="TrackerSupportDRICHBlindConeSegment_rmin2" + length="TrackerSupportDRICHBlindConeSegment_length" + thickness="TrackerSupportDRICHBlindConeSegment_thickness" + phimin="90*deg-0.5*TrackerSupportDRICHBlindConeSegment_deltaphi" + phimax="90*deg+0.5*TrackerSupportDRICHBlindConeSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHBlindConeSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHBlindConeSegmentAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentA_1" + vis="TrackerSupportVis" + rmax="TrackerSupportDRICHConeSegmentA_rmax" + rmin1="TrackerSupportDRICHConeSegmentA_rmin1" + rmin2="TrackerSupportDRICHConeSegmentA_rmin2" + length="TrackerSupportDRICHConeSegmentA_length" + thickness="TrackerSupportDRICHConeSegmentA_thickness" + phimin="120*deg-0.5*TrackerSupportDRICHConeSegmentA_deltaphi" + phimax="120*deg+0.5*TrackerSupportDRICHConeSegmentA_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentA_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentAAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentB_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHConeSegmentB_rmin" + rmax="TrackerSupportDRICHConeSegmentB_rmax" + rmin1="TrackerSupportDRICHConeSegmentB_rmin1" + rmin2="TrackerSupportDRICHConeSegmentB_rmin2" + length="TrackerSupportDRICHConeSegmentB_length" + thickness="TrackerSupportDRICHConeSegmentB_thickness" + phimin="120*deg-0.5*TrackerSupportDRICHConeSegmentB_deltaphi" + phimax="120*deg+0.5*TrackerSupportDRICHConeSegmentB_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentB_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentBAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHBlindConeSegment_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHBlindConeSegment_rmin" + rmax="TrackerSupportDRICHBlindConeSegment_rmax" + rmin1="TrackerSupportDRICHBlindConeSegment_rmin1" + rmin2="TrackerSupportDRICHBlindConeSegment_rmin2" + length="TrackerSupportDRICHBlindConeSegment_length" + thickness="TrackerSupportDRICHBlindConeSegment_thickness" + phimin="150*deg-0.5*TrackerSupportDRICHBlindConeSegment_deltaphi" + phimax="150*deg+0.5*TrackerSupportDRICHBlindConeSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHBlindConeSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHBlindConeSegmentAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentA_1" + vis="TrackerSupportVis" + rmax="TrackerSupportDRICHConeSegmentA_rmax" + rmin1="TrackerSupportDRICHConeSegmentA_rmin1" + rmin2="TrackerSupportDRICHConeSegmentA_rmin2" + length="TrackerSupportDRICHConeSegmentA_length" + thickness="TrackerSupportDRICHConeSegmentA_thickness" + phimin="180*deg-0.5*TrackerSupportDRICHConeSegmentA_deltaphi" + phimax="180*deg+0.5*TrackerSupportDRICHConeSegmentA_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentA_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentAAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentB_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHConeSegmentB_rmin" + rmax="TrackerSupportDRICHConeSegmentB_rmax" + rmin1="TrackerSupportDRICHConeSegmentB_rmin1" + rmin2="TrackerSupportDRICHConeSegmentB_rmin2" + length="TrackerSupportDRICHConeSegmentB_length" + thickness="TrackerSupportDRICHConeSegmentB_thickness" + phimin="180*deg-0.5*TrackerSupportDRICHConeSegmentB_deltaphi" + phimax="180*deg+0.5*TrackerSupportDRICHConeSegmentB_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentB_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentBAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHBlindConeSegment_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHBlindConeSegment_rmin" + rmax="TrackerSupportDRICHBlindConeSegment_rmax" + rmin1="TrackerSupportDRICHBlindConeSegment_rmin1" + rmin2="TrackerSupportDRICHBlindConeSegment_rmin2" + length="TrackerSupportDRICHBlindConeSegment_length" + thickness="TrackerSupportDRICHBlindConeSegment_thickness" + phimin="210*deg-0.5*TrackerSupportDRICHBlindConeSegment_deltaphi" + phimax="210*deg+0.5*TrackerSupportDRICHBlindConeSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHBlindConeSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHBlindConeSegmentAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentA_1" + vis="TrackerSupportVis" + rmax="TrackerSupportDRICHConeSegmentA_rmax" + rmin1="TrackerSupportDRICHConeSegmentA_rmin1" + rmin2="TrackerSupportDRICHConeSegmentA_rmin2" + length="TrackerSupportDRICHConeSegmentA_length" + thickness="TrackerSupportDRICHConeSegmentA_thickness" + phimin="240*deg-0.5*TrackerSupportDRICHConeSegmentA_deltaphi" + phimax="240*deg+0.5*TrackerSupportDRICHConeSegmentA_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentA_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentAAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentB_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHConeSegmentB_rmin" + rmax="TrackerSupportDRICHConeSegmentB_rmax" + rmin1="TrackerSupportDRICHConeSegmentB_rmin1" + rmin2="TrackerSupportDRICHConeSegmentB_rmin2" + length="TrackerSupportDRICHConeSegmentB_length" + thickness="TrackerSupportDRICHConeSegmentB_thickness" + phimin="240*deg-0.5*TrackerSupportDRICHConeSegmentB_deltaphi" + phimax="240*deg+0.5*TrackerSupportDRICHConeSegmentB_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentB_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentBAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHBlindConeSegment_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHBlindConeSegment_rmin" + rmax="TrackerSupportDRICHBlindConeSegment_rmax" + rmin1="TrackerSupportDRICHBlindConeSegment_rmin1" + rmin2="TrackerSupportDRICHBlindConeSegment_rmin2" + length="TrackerSupportDRICHBlindConeSegment_length" + thickness="TrackerSupportDRICHBlindConeSegment_thickness" + phimin="270*deg-0.5*TrackerSupportDRICHBlindConeSegment_deltaphi" + phimax="270*deg+0.5*TrackerSupportDRICHBlindConeSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHBlindConeSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHBlindConeSegmentAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentA_1" + vis="TrackerSupportVis" + rmax="TrackerSupportDRICHConeSegmentA_rmax" + rmin1="TrackerSupportDRICHConeSegmentA_rmin1" + rmin2="TrackerSupportDRICHConeSegmentA_rmin2" + length="TrackerSupportDRICHConeSegmentA_length" + thickness="TrackerSupportDRICHConeSegmentA_thickness" + phimin="300*deg-0.5*TrackerSupportDRICHConeSegmentA_deltaphi" + phimax="300*deg+0.5*TrackerSupportDRICHConeSegmentA_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentA_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentAAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHConeSegmentB_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHConeSegmentB_rmin" + rmax="TrackerSupportDRICHConeSegmentB_rmax" + rmin1="TrackerSupportDRICHConeSegmentB_rmin1" + rmin2="TrackerSupportDRICHConeSegmentB_rmin2" + length="TrackerSupportDRICHConeSegmentB_length" + thickness="TrackerSupportDRICHConeSegmentB_thickness" + phimin="300*deg-0.5*TrackerSupportDRICHConeSegmentB_deltaphi" + phimax="300*deg+0.5*TrackerSupportDRICHConeSegmentB_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHConeSegmentB_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHConeSegmentBAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + <support type="Cone" + name="TrackerSupportDRICHBlindConeSegment_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHBlindConeSegment_rmin" + rmax="TrackerSupportDRICHBlindConeSegment_rmax" + rmin1="TrackerSupportDRICHBlindConeSegment_rmin1" + rmin2="TrackerSupportDRICHBlindConeSegment_rmin2" + length="TrackerSupportDRICHBlindConeSegment_length" + thickness="TrackerSupportDRICHBlindConeSegment_thickness" + phimin="330*deg-0.5*TrackerSupportDRICHBlindConeSegment_deltaphi" + phimax="330*deg+0.5*TrackerSupportDRICHBlindConeSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHBlindConeSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHBlindConeSegmentAl_thickness" name="Services" vis="TrackerServiceVis" /> + </support> + + <comment> Service routings outside DRICH </comment> + <support type="Cylinder" + name="TrackerSupportDRICHCylSegment_1" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHCylSegment_rmin" + length="TrackerSupportDRICHCylSegment_length" + thickness="TrackerSupportDRICHCylSegment_thickness" + phimin="0*deg-0.5*TrackerSupportDRICHCylSegment_deltaphi" + phimax="0*deg+0.5*TrackerSupportDRICHCylSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHCylSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHCylSegmentAl_thickness" name="Services" vis="TrackerSupportVis"/> + </support> + <support type="Cylinder" + name="TrackerSupportDRICHCylSegment_2" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHCylSegment_rmin" + length="TrackerSupportDRICHCylSegment_length" + thickness="TrackerSupportDRICHCylSegment_thickness" + phimin="60*deg-0.5*TrackerSupportDRICHCylSegment_deltaphi" + phimax="60*deg+0.5*TrackerSupportDRICHCylSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHCylSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHCylSegmentAl_thickness" name="Services" vis="TrackerSupportVis"/> + </support> + <support type="Cylinder" + name="TrackerSupportDRICHCylSegment_3" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHCylSegment_rmin" + length="TrackerSupportDRICHCylSegment_length" + thickness="TrackerSupportDRICHCylSegment_thickness" + phimin="120*deg-0.5*TrackerSupportDRICHCylSegment_deltaphi" + phimax="120*deg+0.5*TrackerSupportDRICHCylSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHCylSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHCylSegmentAl_thickness" name="Services" vis="TrackerSupportVis"/> + </support> + <support type="Cylinder" + name="TrackerSupportDRICHCylSegment_4" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHCylSegment_rmin" + length="TrackerSupportDRICHCylSegment_length" + thickness="TrackerSupportDRICHCylSegment_thickness" + phimin="180*deg-0.5*TrackerSupportDRICHCylSegment_deltaphi" + phimax="180*deg+0.5*TrackerSupportDRICHCylSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHCylSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHCylSegmentAl_thickness" name="Services" vis="TrackerSupportVis"/> + </support> + <support type="Cylinder" + name="TrackerSupportDRICHCylSegment_5" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHCylSegment_rmin" + length="TrackerSupportDRICHCylSegment_length" + thickness="TrackerSupportDRICHCylSegment_thickness" + phimin="240*deg-0.5*TrackerSupportDRICHCylSegment_deltaphi" + phimax="240*deg+0.5*TrackerSupportDRICHCylSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHCylSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHCylSegmentAl_thickness" name="Services" vis="TrackerSupportVis"/> + </support> + <support type="Cylinder" + name="TrackerSupportDRICHCylSegment_6" + vis="TrackerSupportVis" + rmin="TrackerSupportDRICHCylSegment_rmin" + length="TrackerSupportDRICHCylSegment_length" + thickness="TrackerSupportDRICHCylSegment_thickness" + phimin="300*deg-0.5*TrackerSupportDRICHCylSegment_deltaphi" + phimax="300*deg+0.5*TrackerSupportDRICHCylSegment_deltaphi"> + <position x="0*cm" y="0*cm" z="TrackerSupportDRICHCylSegment_z" /> + <component material="Aluminum" thickness="TrackerSupportDRICHCylSegmentAl_thickness" name="Services" vis="TrackerSupportVis"/> + </support> + <comment> Inner detector support barrel </comment> <support type="Cylinder" name="InnerDetectorBarrelSupportCyl" @@ -383,6 +875,7 @@ <position x="0*cm" y="0*cm" z="InnerDetectorBarrelSupportCylCF_offset" /> <component material="CarbonFiber" thickness="InnerDetectorBarrelSupportCylCF_thickness" name="Support" vis="TrackerSupportVis"/> </support> + </detector> </detectors> </lccdd> diff --git a/src/BarrelCalorimeterScFi_geo.cpp b/src/BarrelCalorimeterScFi_geo.cpp index e0a2fa468..9c6c337a5 100644 --- a/src/BarrelCalorimeterScFi_geo.cpp +++ b/src/BarrelCalorimeterScFi_geo.cpp @@ -237,7 +237,7 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, int lay struct Fiber { Point pos; bool assigned = false; - Fiber(const Point& p) : pos(p){}; + Fiber(const Point& p) : pos(p) {}; }; std::vector<Fiber> fibers(f_pos.begin(), f_pos.end()); diff --git a/src/SupportServiceMaterial_geo.cpp b/src/SupportServiceMaterial_geo.cpp index c476f888c..2bab39730 100644 --- a/src/SupportServiceMaterial_geo.cpp +++ b/src/SupportServiceMaterial_geo.cpp @@ -44,15 +44,23 @@ std::pair<Volume, Transform3D> build_shape(const Detector& descr, const xml_det_ const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); const double length = getAttrOrDefault(x_child, _U(length), x_support.length()); const double rmin = getAttrOrDefault(x_child, _U(rmin), x_support.rmin()) + offset; - solid = Tube(rmin, rmin + thickness, length / 2); + const double phimin = getAttrOrDefault( + x_child, _Unicode(phimin), getAttrOrDefault(x_support, _Unicode(phimin), 0.0 * deg)); + const double phimax = getAttrOrDefault( + x_child, _Unicode(phimax), getAttrOrDefault(x_support, _Unicode(phimax), 360.0 * deg)); + solid = Tube(rmin, rmin + thickness, length / 2, phimin, phimax); } // A disk is a cylinder, constructed differently else if (type == "Disk") { const double thickness = getAttrOrDefault(x_child, _U(thickness), x_support.thickness()); const double rmin = getAttrOrDefault(x_child, _U(rmin), x_support.rmin()); const double rmax = getAttrOrDefault(x_child, _U(rmax), x_support.rmax()); + const double phimin = getAttrOrDefault( + x_child, _Unicode(phimin), getAttrOrDefault(x_support, _Unicode(phimin), 0.0 * deg)); + const double phimax = getAttrOrDefault( + x_child, _Unicode(phimax), getAttrOrDefault(x_support, _Unicode(phimax), 360.0 * deg)); pos3D = pos3D + Position(0, 0, -x_support.thickness() / 2 + thickness / 2 + offset); - solid = Tube(rmin, rmax, thickness / 2); + solid = Tube(rmin, rmax, thickness / 2, phimin, phimax); } else if (type == "Cone") { const double base_rmin1 = getAttrOrDefault(x_child, _U(rmin1), x_support.rmin1()); const double base_rmin2 = getAttrOrDefault(x_child, _U(rmin2), x_support.rmin2()); @@ -68,7 +76,57 @@ std::pair<Volume, Transform3D> build_shape(const Detector& descr, const xml_det_ const double rmin2 = base_rmin2 + transverse_offset; const double rmax1 = rmin1 + transverse_thickness; const double rmax2 = rmin2 + transverse_thickness; - solid = Cone(length / 2, rmin1, rmax1, rmin2, rmax2); + // Allow for optional hard rmin/rmax cutoffs + const double rmin = getAttrOrDefault( + x_child, _U(rmin), getAttrOrDefault(x_support, _Unicode(rmin), min(rmin1, rmin2))); + const double rmax = getAttrOrDefault( + x_child, _U(rmax), getAttrOrDefault(x_support, _Unicode(rmax), max(rmax1, rmax2))); + if (rmin > min(rmax1, rmax2)) { + printout(ERROR, x_det.nameStr(), + "%s: rmin (%f mm) must be smaller than the smallest rmax (%f %f mm)", + x_support.nameStr().c_str(), rmin / mm, rmax1 / mm, rmax2 / mm); + std::exit(1); + } + if (rmax < max(base_rmin1, base_rmin2)) { + printout(ERROR, x_det.nameStr(), + "%s: rmax (%f mm) must be larger than the largest rmin (%f %f mm)", + x_support.nameStr().c_str(), rmax / mm, base_rmin1 / mm, base_rmin2 / mm); + std::exit(1); + } + const double zmin = -length / 2 + length * (rmin - rmin1) / (rmin2 - rmin1); + const double zmax = -length / 2 + length * (rmax - rmax1) / (rmax2 - rmax1); + const auto rmin_at = [&](const double z) { + return rmin1 + (z + length / 2) * (rmin2 - rmin1) / length; + }; + const auto rmax_at = [&](const double z) { + return rmax1 + (z + length / 2) * (rmax2 - rmax1) / length; + }; + // Allow for optional phimin/phimax + const double phimin = getAttrOrDefault<double>( + x_child, _Unicode(phimin), getAttrOrDefault(x_support, _Unicode(phimin), 0.0 * deg)); + const double phimax = getAttrOrDefault<double>( + x_child, _Unicode(phimax), getAttrOrDefault(x_support, _Unicode(phimax), 360.0 * deg)); + const double deltaphi = phimax - phimin; + const double epsilon{TGeoShape::Tolerance()}; + if (fabs(zmin) >= length / 2 - epsilon && fabs(zmax) >= length / 2 - epsilon) { + if (fabs(phimax - phimin - 360 * deg) < epsilon) { + solid = Cone(length / 2, rmin1, rmax1, rmin2, rmax2); + } else { + solid = ConeSegment(length / 2, rmin1, rmax1, rmin2, rmax2, phimin, phimax); + } + } else { + std::vector<double> v_rmin{max(rmin1, rmin), max(rmin2, rmin)}, + v_rmax{min(rmax1, rmax), min(rmax2, rmax)}, v_z{-length / 2, +length / 2}; + for (const auto& z : + (zmin < zmax ? std::vector<double>{zmin, zmax} : std::vector<double>{zmax, zmin})) { + if (-length / 2 + epsilon < z && z < -epsilon + length / 2) { + v_rmin.insert(std::prev(v_rmin.end()), std::max(rmin, rmin_at(z))); + v_rmax.insert(std::prev(v_rmax.end()), std::min(rmax, rmax_at(z))); + v_z.insert(std::prev(v_z.end()), z); + } + } + solid = Polycone(phimin, deltaphi, v_rmin, v_rmax, v_z); + } } else { printout(ERROR, x_det.nameStr(), "Unknown support type: %s", type.c_str()); std::exit(1); From cf368f18ba35e493a7e98e5d045f8586d774d26e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 28 Apr 2024 23:44:33 -0400 Subject: [PATCH 081/113] scripts/view*: use bash from $PATH (#716) Existence of /bin/bash is not guaranteed. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- scripts/view1/generate_eps | 2 +- scripts/view11/generate_eps | 2 +- scripts/view12/generate_eps | 2 +- scripts/view13/generate_eps | 2 +- scripts/view14/generate_eps | 2 +- scripts/view15/generate_eps | 2 +- scripts/view2/generate_eps | 2 +- scripts/view20/generate_eps | 2 +- scripts/view3/generate_eps | 2 +- scripts/view4/generate_eps | 2 +- scripts/view5/generate_eps | 2 +- scripts/view50/generate_eps | 2 +- scripts/view6/generate_eps | 2 +- scripts/view7/generate_eps | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/view1/generate_eps b/scripts/view1/generate_eps index b7d4419ed..33beae078 100755 --- a/scripts/view1/generate_eps +++ b/scripts/view1/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #export DAWN_PS_PREVIEWER="derp" diff --git a/scripts/view11/generate_eps b/scripts/view11/generate_eps index 1f53c6534..c93288c27 100755 --- a/scripts/view11/generate_eps +++ b/scripts/view11/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #trignometry sin () diff --git a/scripts/view12/generate_eps b/scripts/view12/generate_eps index cbb2b355f..08ce870eb 100755 --- a/scripts/view12/generate_eps +++ b/scripts/view12/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #trignometry sin () diff --git a/scripts/view13/generate_eps b/scripts/view13/generate_eps index 748badbf6..1aab04df1 100755 --- a/scripts/view13/generate_eps +++ b/scripts/view13/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "view2 produces a series of XY slices a different z locations." diff --git a/scripts/view14/generate_eps b/scripts/view14/generate_eps index b1fd92b03..ca1fca10b 100755 --- a/scripts/view14/generate_eps +++ b/scripts/view14/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #trignometry sin () diff --git a/scripts/view15/generate_eps b/scripts/view15/generate_eps index 1bf171575..d05e5ca81 100755 --- a/scripts/view15/generate_eps +++ b/scripts/view15/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #trignometry sin () diff --git a/scripts/view2/generate_eps b/scripts/view2/generate_eps index d3162019e..bcbcec379 100755 --- a/scripts/view2/generate_eps +++ b/scripts/view2/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "view2 produces a series of XY slices a different z locations." diff --git a/scripts/view20/generate_eps b/scripts/view20/generate_eps index 5822e8eb3..9289de069 100755 --- a/scripts/view20/generate_eps +++ b/scripts/view20/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #export DAWN_PS_PREVIEWER="derp" diff --git a/scripts/view3/generate_eps b/scripts/view3/generate_eps index 1abde4653..d01291487 100755 --- a/scripts/view3/generate_eps +++ b/scripts/view3/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "view3 produces a series of XY slices a different z locations." diff --git a/scripts/view4/generate_eps b/scripts/view4/generate_eps index 0cf16687b..fbc0c7dea 100755 --- a/scripts/view4/generate_eps +++ b/scripts/view4/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # this is a detector slice diff --git a/scripts/view5/generate_eps b/scripts/view5/generate_eps index c551627db..b9626e2c1 100755 --- a/scripts/view5/generate_eps +++ b/scripts/view5/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # this is a detector slice diff --git a/scripts/view50/generate_eps b/scripts/view50/generate_eps index f2de94608..2a8e40fbf 100755 --- a/scripts/view50/generate_eps +++ b/scripts/view50/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #export DAWN_PS_PREVIEWER="derp" diff --git a/scripts/view6/generate_eps b/scripts/view6/generate_eps index 27040afdb..639c9fee5 100755 --- a/scripts/view6/generate_eps +++ b/scripts/view6/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "view6 produces a series of XY slices a different z locations." diff --git a/scripts/view7/generate_eps b/scripts/view7/generate_eps index 4f33c544b..a227de4f9 100755 --- a/scripts/view7/generate_eps +++ b/scripts/view7/generate_eps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "view7 produces a series of XY slices a different z locations." From ed8f4cf3d4119d0488c77fb9484931cd33b018c9 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 28 Apr 2024 23:50:20 -0400 Subject: [PATCH 082/113] bin/generate_prim_file: use POSIX process groups instead of psutil (#717) psutil is an external package. I'd rather not have to worry about providing it. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- bin/generate_prim_file | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/bin/generate_prim_file b/bin/generate_prim_file index 9474472f4..3e7f9fcb6 100755 --- a/bin/generate_prim_file +++ b/bin/generate_prim_file @@ -12,7 +12,6 @@ import atexit import time from datetime import datetime import fcntl -import psutil def readline_nonblocking(output): @@ -102,7 +101,8 @@ finished = False # run simulation print(' '.join(sim_cmd)) p = subprocess.Popen(args=sim_cmd, env=dawn_env, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, + preexec_fn=os.setsid) __child_pid = p.pid while elapse.seconds < args.timeout: line = readline_nonblocking(p.stdout) @@ -134,14 +134,10 @@ while elapse.seconds < args.timeout: time.sleep(1) -p.kill() -# use to kill the subprocess generated from the python wrapper -# this is unsafe so maybe more checks required -for proc in psutil.process_iter(): - pinfo = proc.as_dict(attrs=['pid', 'name', 'create_time']) - if pinfo['pid'] == p.pid + 1 and pinfo['name'] == 'python': - print('kill {}, generated from {}'.format(pinfo, p.pid)) - os.kill(pinfo['pid'], signal.SIGTERM) +try: + os.killpg(os.getpgid(p.pid), signal.SIGTERM) +except ProcessLookupError: + pass # assume process is dead # revert the change #os.system('sed -i \'s/radius=\"EcalEndcapP_FiberRadius*10\"/radius=\"EcalEndcapP_FiberRadius\"/\' {}'.format(ci_ecal)) From 52819f492d7f2042e49202a4275820f9bdaef0dc Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 5 May 2024 11:52:01 -0400 Subject: [PATCH 083/113] calibrations.xml: add LUTs for drich, pfrich and tof (#719) This adds LUTs for use in EICrecon. --- compact/calibrations.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/compact/calibrations.xml b/compact/calibrations.xml index 250d0709a..d9e89bc90 100644 --- a/compact/calibrations.xml +++ b/compact/calibrations.xml @@ -9,11 +9,26 @@ <arg value="file:calibrations/onnx/identity_gemm_w1x1_b1.onnx"/> <arg value="url:https://github.com/eic/epic-data/raw/27ef75b2b6108b5e72d3ab891f32aeeb3770c7bd/onnx/identity_gemm_w1x1_b1.onnx"/> </plugin> + <plugin name="epic_FileLoader"> + <arg value="cache:$DETECTOR_PATH:/opt/detector"/> + <arg value="file:calibrations/drich.lut"/> + <arg value="url:https://github.com/eic/epic-data/raw/b863589baf6998acdc22f5e445a5e462bbf72b0a/drich.lut"/> + </plugin> <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/hpdirc_positive.lut"/> <arg value="url:https://raw.githubusercontent.com/nathanwbrei/fastpid/66acf386f368d8fe95cbf157407492e92344ee7f/hpdirc_positive.lut"/> </plugin> + <plugin name="epic_FileLoader"> + <arg value="cache:$DETECTOR_PATH:/opt/detector"/> + <arg value="file:calibrations/pfrich.lut"/> + <arg value="url:https://github.com/eic/epic-data/raw/b863589baf6998acdc22f5e445a5e462bbf72b0a/pfrich.lut"/> + </plugin> + <plugin name="epic_FileLoader"> + <arg value="cache:$DETECTOR_PATH:/opt/detector"/> + <arg value="file:calibrations/tof.lut"/> + <arg value="url:https://github.com/eic/epic-data/raw/b863589baf6998acdc22f5e445a5e462bbf72b0a/tof.lut"/> + </plugin> </plugins> </lccdd> From 66327439198f47563e56f925fa686aac07708eb6 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sun, 5 May 2024 11:56:05 -0400 Subject: [PATCH 084/113] PFRICH: restore sensititvity to hits (#715) Fixes a minor regression from the latest geometry update in #664. Fixes: #706 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/PFRICH_geo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PFRICH_geo.cpp b/src/PFRICH_geo.cpp index db9fbe1bc..1d2ee5613 100644 --- a/src/PFRICH_geo.cpp +++ b/src/PFRICH_geo.cpp @@ -305,6 +305,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se Volume hrppdVol_air(detName + "_air_hrppd", hrppd_Solid, air); Volume hrppdVol(detName + "_hrppd", hrppd_Solid, sensorMat); + hrppdVol_air.setSensitiveDetector(sens); hrppdVol_air.setVisAttributes(gasvolVis); DetElement hrppdDE(sdet, "hrppd_de", 0); From 5a737d5c5baf7edff699804d7605cfa75b47872e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Tue, 7 May 2024 12:34:00 -0400 Subject: [PATCH 085/113] calibrations.xml: update to use latest tof.lut and pfrich.lut (#721) This updates to use the latest LUT from https://github.com/eic/epic-data/pull/12 No binning change, so we don't need any file renames. --- compact/calibrations.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/calibrations.xml b/compact/calibrations.xml index d9e89bc90..b5392ec18 100644 --- a/compact/calibrations.xml +++ b/compact/calibrations.xml @@ -22,12 +22,12 @@ <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/pfrich.lut"/> - <arg value="url:https://github.com/eic/epic-data/raw/b863589baf6998acdc22f5e445a5e462bbf72b0a/pfrich.lut"/> + <arg value="url:https://raw.githubusercontent.com/eic/epic-data/126e57e058adddd1d044c63656eb76bc25a1aae5/pfrich.lut"/> </plugin> <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/tof.lut"/> - <arg value="url:https://github.com/eic/epic-data/raw/b863589baf6998acdc22f5e445a5e462bbf72b0a/tof.lut"/> + <arg value="url:https://github.com/eic/epic-data/raw/c0f0ec03ca98de39cb74bf03407948ea64169eb1/tof.lut"/> </plugin> </plugins> From 26cf48a11a0f6e8b64b40918161055a83d13afb3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Tue, 7 May 2024 19:42:48 -0400 Subject: [PATCH 086/113] calibrations.xml: update pfrich.lut again (#722) This updates calibration to the latest revision https://github.com/eic/epic-data/commit/f83bf74a79ba4cc71b459a65ba48d3a68deb0ae3 --- compact/calibrations.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact/calibrations.xml b/compact/calibrations.xml index b5392ec18..3ef4e1649 100644 --- a/compact/calibrations.xml +++ b/compact/calibrations.xml @@ -22,7 +22,7 @@ <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/pfrich.lut"/> - <arg value="url:https://raw.githubusercontent.com/eic/epic-data/126e57e058adddd1d044c63656eb76bc25a1aae5/pfrich.lut"/> + <arg value="url:https://raw.githubusercontent.com/eic/epic-data/f83bf74a79ba4cc71b459a65ba48d3a68deb0ae3/pfrich.lut"/> </plugin> <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> From 09e29f4750c24e79eb1ee32476cbc26c0e9724e4 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Fri, 10 May 2024 01:24:35 -0400 Subject: [PATCH 087/113] linux-eic-shell.yml: provide PIPELINE_NAME to detector_benchmarks (#723) This takes advantage of https://github.com/eic/detector_benchmarks/pull/20 --- .github/workflows/linux-eic-shell.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 449d03beb..f8635edf9 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -538,6 +538,7 @@ jobs: DETECTOR_CONFIG=${{ matrix.detector_config }} GITHUB_REPOSITORY=${{ github.repository }} GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }} + PIPELINE_NAME=${{ github.event.pull_request.title || github.sha }} - run: | gh api \ --method POST \ From 5cb29962e921dcf915ca7a12386e6dc1f1b80fec Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Sat, 11 May 2024 20:02:12 -0400 Subject: [PATCH 088/113] calibrations.xml: add hpdirc.lut.gz (#724) This is a version with both charges, as found on dropbox. --- compact/calibrations.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compact/calibrations.xml b/compact/calibrations.xml index 3ef4e1649..3696c7fa8 100644 --- a/compact/calibrations.xml +++ b/compact/calibrations.xml @@ -14,11 +14,16 @@ <arg value="file:calibrations/drich.lut"/> <arg value="url:https://github.com/eic/epic-data/raw/b863589baf6998acdc22f5e445a5e462bbf72b0a/drich.lut"/> </plugin> - <plugin name="epic_FileLoader"> + <plugin name="epic_FileLoader"><!-- DEPRECATED --> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/hpdirc_positive.lut"/> <arg value="url:https://raw.githubusercontent.com/nathanwbrei/fastpid/66acf386f368d8fe95cbf157407492e92344ee7f/hpdirc_positive.lut"/> </plugin> + <plugin name="epic_FileLoader"> + <arg value="cache:$DETECTOR_PATH:/opt/detector"/> + <arg value="file:calibrations/hpdirc.lut.gz"/> + <arg value="url:https://raw.githubusercontent.com/eic/epic-data/4cfc44404d538cebe513cb491e5fcd62f99ad4f6/hpdirc.lut.gz"/> + </plugin> <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/pfrich.lut"/> From fcf90937193c983c0af2acf1251e01f2e2c3a259 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 00:35:47 -0500 Subject: [PATCH 089/113] [pre-commit.ci] pre-commit autoupdate (#727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <!--pre-commit.ci start--> updates: - [github.com/pre-commit/mirrors-clang-format: v18.1.4 → v18.1.5](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.4...v18.1.5) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 236d6ff38..6ee3808cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.4 + rev: v18.1.5 hooks: - id: clang-format - repo: https://github.com/Lucas-C/pre-commit-hooks From e52f76a7b8555c59a7560df85ba388d5009e083a Mon Sep 17 00:00:00 2001 From: Maria Zurek <33816222+mariakzurek@users.noreply.github.com> Date: Wed, 22 May 2024 15:48:12 -0500 Subject: [PATCH 090/113] Bic geo adjustment (#729) ### Briefly, what does this PR introduce? Changes the size of Barrel ECal to the current envelope r=82 cm, length in z = 435 cm (active SciFi/Pb matrix). Removes the Aluminum support planes of SciFi/Pb, and replaces them with thicker Carbon Fiber planes according to the newest geometry. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? no ### Does this PR change default behavior? yes --------- Co-authored-by: Maria Zurek <zurek@anl.gov> --- compact/definitions.xml | 2 +- compact/ecal/barrel_interlayers.xml | 39 +++++++++++------------------ 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/compact/definitions.xml b/compact/definitions.xml index cbb47ee99..0d0b0831e 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -550,7 +550,7 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc <constant name="EcalEndcapN_rmin" value="9.*cm"/> <!-- Currently fix value hardcoded --> <constant name="EcalEndcapN_rmax" value="63.*cm"/> <!-- Currently fix value hardcoded --> - <constant name="EcalBarrel_rmin" value="max(81.*cm, CentralTrackingRegion_rmax + BarrelPIDRegion_thickness + BarrelExtraSpace_thickness)"/> <!-- FIXME hardcoded max --> + <constant name="EcalBarrel_rmin" value="max(82.*cm, CentralTrackingRegion_rmax + BarrelPIDRegion_thickness + BarrelExtraSpace_thickness)"/> <constant name="EcalBarrelRegion_thickness" value="Solenoid_rmin-EcalBarrel_rmin"/> <constant name="EcalBarrel_inner_margin" value="2*cm"/> <constant name="EcalBarrel_rmax" value="EcalBarrel_rmin + EcalBarrelRegion_thickness"/> diff --git a/compact/ecal/barrel_interlayers.xml b/compact/ecal/barrel_interlayers.xml index b5277c5c2..a305d9dec 100644 --- a/compact/ecal/barrel_interlayers.xml +++ b/compact/ecal/barrel_interlayers.xml @@ -21,15 +21,14 @@ <constant name="EcalBarrelImagingLayers_num" value="6"/> <comment> Active part of the calorimeter is - 215 cm long in e-going - 221.5 cm long in p-going - -42 cm offset + 435 cm long + -41.25 cm offset </comment> <constant name="EcalBarrel_Calorimeter_zmin" - value="min(260.25*cm, EcalBarrelBackward_zmax)"/> + value="min(258.75*cm, EcalBarrelBackward_zmax)"/> <constant name="EcalBarrel_Calorimeter_zmax" value="min(176.25*cm, EcalBarrelForward_zmax)"/> - <constant name="EcalBarrel_Readout_zmin" value="275.25*cm"/> + <constant name="EcalBarrel_Readout_zmin" value="273.75*cm"/> <constant name="EcalBarrel_Readout_zmax" value="191.25*cm"/> <constant name="EcalBarrel_Calorimeter_length" value="EcalBarrel_Calorimeter_zmax + EcalBarrel_Calorimeter_zmin"/> @@ -43,8 +42,8 @@ <constant name="EcalBarrel_CopperThickness" value="100*um"/> <constant name="EcalBarrel_KaptonThickness" value="200*um"/> <constant name="EcalBarrel_EpoxyThickness" value="100*um"/> - <constant name="EcalBarrel_CarbonThickness" value="0.5*mm"/> - <constant name="EcalBarrel_CarbonSpacerWidth" value="4*mm"/> + <constant name="EcalBarrel_CarbonFrameThickness" value="2*mm"/> + <constant name="EcalBarrel_CarbonStaveThickness" value="0.5*mm"/> <constant name="EcalBarrel_AstroPix_width" value="2*cm"/> <constant name="EcalBarrel_AstroPix_length" value="2*cm"/> @@ -58,7 +57,7 @@ <constant name="EcalBarrel_Stave_width" value="EcalBarrel_AstroPix_width + 2. * EcalBarrel_AstroPix_margin"/> <constant name="EcalBarrel_Stave_length" value="EcalBarrel_Calorimeter_length"/> - <constant name="EcalBarrel_Stave_thickness" value="EcalBarrel_AstroPix_thickness + EcalBarrel_CarbonThickness"/> + <constant name="EcalBarrel_Stave_thickness" value="EcalBarrel_AstroPix_thickness + EcalBarrel_CarbonStaveThickness"/> <constant name="EcalBarrel_StaveTilt_angle" value="10*degree"/> <constant name="EcalBarrel_Stave_ModuleRepeat" value="floor(EcalBarrel_Calorimeter_length / (EcalBarrel_AstroPix_length + EcalBarrel_AstroPix_margin))"/> @@ -74,18 +73,17 @@ <constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing * 17"/> <constant name="EcalBarrel_TotalFiberLayers_num" value="12"/> <constant name="EcalBarrel_RadiatorEdgeThickness" value="0.61*mm"/> - <constant name="EcalBarrel_AluminumPlateThickness" value="1*mm"/> <constant name="EcalBarrel_SectorRepeat" value="EcalBarrelSectorsN"/> <constant name="EcalBarrel_AvailThickness" value="EcalBarrelRegion_thickness - EcalBarrel_BackSupportThickness - EcalBarrel_FrontSupportThickness"/> - <constant name="EcalBarrel_ImagingLayerThickness" value="1.5*cm"/> + <constant name="EcalBarrel_ImagingLayerThickness" value="1.7*cm"/> <constant name="EcalBarrel_ImagingLayerThickness_WithoutFrame" value="EcalBarrel_ImagingLayerThickness - - 2*EcalBarrel_CarbonThickness"/> + - 2*EcalBarrel_CarbonFrameThickness"/> <constant name="EcalBarrel_ScFiLayerThickness_Imaging" - value="EcalBarrel_RadiatorThickness + 2*EcalBarrel_RadiatorEdgeThickness + 2*EcalBarrel_AluminumPlateThickness"/> + value="EcalBarrel_RadiatorThickness + 2*EcalBarrel_RadiatorEdgeThickness"/> <comment> Adjusting size of the ScFi back chunk to match number of imaging layers @@ -155,11 +153,7 @@ <layer repeat="1" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" space_before="EcalBarrel_FrontSupportThickness"> - <barrel_envelope - inner_r="EcalBarrel_rmin - EcalBarrel_Stave_thickness" - outer_r="EcalBarrel_rmin + EcalBarrel_Stave_thickness" - z_length="EcalBarrel_Calorimeter_length"/> - <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> + <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonFrameThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> <stave repeat="6" width="EcalBarrel_Stave_width" length="EcalBarrel_Stave_length" @@ -177,14 +171,14 @@ <layer repeat="1" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> - <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> + <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonFrameThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> </layer> <layer repeat="2" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" space_between="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween" space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> - <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> + <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonFrameThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> <stave repeat="6" width="EcalBarrel_Stave_width" length="EcalBarrel_Stave_length" @@ -202,14 +196,14 @@ <layer repeat="1" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> - <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> + <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonFrameThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> </layer> <layer repeat="EcalBarrelImagingLayers_num-5" vis="EcalBarrelLayerVis" thickness="EcalBarrel_ImagingLayerThickness" space_between="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween" space_before="EcalBarrel_ScFiLayerThickness_Imaging + EcalBarrel_SpaceBetween"> - <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> + <frame material="CarbonFiber" fill="Air" thickness="EcalBarrel_CarbonFrameThickness" height="EcalBarrel_ImagingLayerThickness" vis="EcalBarrelSliceVis"/> <stave repeat="7" width="EcalBarrel_Stave_width" length="EcalBarrel_Stave_length" @@ -246,7 +240,6 @@ <layer repeat="EcalBarrelImagingLayers_num-1" vis="EcalBarrelLayerVis" space_between="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween" space_before="EcalBarrel_FrontSupportThickness + EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween/2."> - <slice material="Aluminum" thickness="EcalBarrel_AluminumPlateThickness" vis="EcalBarrelSliceVis"/> <slice material="SciFiPb_PbGlue_Edge" thickness="EcalBarrel_RadiatorEdgeThickness" vis="EcalBarrelSliceVis"/> <slice material="SciFiPb_PbGlue" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis"> <fiber material="SciFiPb_Scintillator" @@ -261,12 +254,10 @@ </fiber> </slice> <slice material="SciFiPb_PbGlue_Edge" thickness="EcalBarrel_RadiatorEdgeThickness" vis="EcalBarrelSliceVis"/> - <slice material="Aluminum" thickness="EcalBarrel_AluminumPlateThickness" vis="EcalBarrelSliceVis"/> </layer> <layer repeat="1" vis="EcalBarrelLayerVis" space_before="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween"> - <slice material="Aluminum" thickness="EcalBarrel_AluminumPlateThickness" vis="EcalBarrelSliceVis"/> <slice material="SciFiPb_PbGlue_Edge" thickness="EcalBarrel_RadiatorEdgeThickness" vis="EcalBarrelSliceVis"/> <slice material="SciFiPb_PbGlue" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis"> <fiber material="SciFiPb_Scintillator" From 145e722b5e8ab03833853aa70182c61da223e08a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Wed, 22 May 2024 16:09:05 -0500 Subject: [PATCH 091/113] feat: rm DETECTOR_VERSION from thisepic.sh; rm setup.sh (#733) This PR removed DETECTOR_VERSION from thisepic.sh, and it removes installation of the setup.sh script. ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, don't use `setup.sh` anymore. It's dead Jim. --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/labeler.yml | 2 +- .github/workflows/linux-eic-shell.yml | 36 +++++++++++------------ CMakeLists.txt | 12 ++++---- README.md | 2 +- templates/{setup.sh.in => thisepic.sh.in} | 7 ++++- 5 files changed, 32 insertions(+), 27 deletions(-) rename templates/{setup.sh.in => thisepic.sh.in} (56%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 07b36d704..a6d3cc661 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -62,7 +62,7 @@ - "reports/**/*" - "requirements.txt" - "scripts/**/*" - - "templates/setup.sh.in" + - "templates/thisepic.sh.in" - "views/**/*" "topic: magnets": diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index f8635edf9..fdf0fb96f 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -97,7 +97,7 @@ jobs: path: install/ if-no-files-found: error - run: | - source install/setup.sh + source install/bin/thisepic.sh sed -i 's%\(<fiber\|<lens\)%<comment>\1%g; s%\(/fiber>\|/lens>\)%\1</comment>%g' \ ${DETECTOR_PATH}/compact/ecal/barrel_interlayers.xml \ ${DETECTOR_PATH}/compact/ecal/forward_scfi.xml \ @@ -161,7 +161,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}" for config in ${configs[@]} ; do @@ -187,7 +187,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${{matrix.detector_config}}.xml\")" | tee check_tracking_geometry.out bin/acts_geo_check check_tracking_geometry.out @@ -207,7 +207,7 @@ jobs: - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | pushd scripts/material_map export DETECTOR_CONFIG=epic_craterlake_material_map @@ -239,7 +239,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}" for config in ${configs[@]} ; do @@ -269,7 +269,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}" for config in ${configs[@]} ; do @@ -301,7 +301,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | # For some reason npdet_to_step really wants a space in IFS IFS=$' \n\t' @@ -337,7 +337,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | mkdir -p doc npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | tee doc/${{matrix.detector_config}}_constants.out @@ -364,7 +364,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | mkdir -p doc npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | grep -v '^\s' | grep '=' | cut -d= -f1-2 | tee doc/${{matrix.detector_config}}_constants.toml @@ -432,7 +432,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "bridge" # this job must succeed even when new artifacts - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | mkdir -p doc checkOverlaps --option ${{ matrix.option }} -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_tgeo.out @@ -453,7 +453,7 @@ jobs: - uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | mkdir -p doc checkGeometry -f true -c ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml | tee geometry_check_full.out @@ -485,7 +485,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "bridge" # this job must succeed even when new artifacts - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | mkdir -p doc python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out @@ -510,7 +510,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "bridge" # this job must succeed even when new artifacts - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | mkdir -p doc python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out @@ -569,7 +569,7 @@ jobs: with: platform-release: "jug_xl:nightly" network_types: "none" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | bin/generate_prim_file -c $DETECTOR_PATH/${{ matrix.detector_config }}.xml -o prim -D -t ${{ matrix.detector_config }} - uses: actions/upload-artifact@v4 @@ -672,7 +672,7 @@ jobs: uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -G --random.seed 1 --gun.particle "${{ matrix.particle }}-" --gun.momentumMin "1*GeV" --gun.momentumMax "20*GeV" --gun.distribution "uniform" -N 100 --outputFile sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -v WARNING - uses: actions/upload-artifact@v4 @@ -693,7 +693,7 @@ jobs: uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH mkdir capybara-reports @@ -731,7 +731,7 @@ jobs: uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | url=root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/DIS/NC/${{matrix.beam}}/minQ2=${{matrix.minq2}}/pythia8NCDIS_${{matrix.beam}}_minQ2=${{matrix.minq2}}_beamEffects_xAngle=-0.025_hiDiv_1.hepmc3.tree.root npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -N 100 --inputFiles ${url} --random.seed 1 --outputFile sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -v WARNING @@ -753,7 +753,7 @@ jobs: uses: eic/run-cvmfs-osg-eic-shell@main with: platform-release: "jug_xl:nightly" - setup: install/setup.sh + setup: install/bin/thisepic.sh run: | pip install 'pygithub>=2' 'bokeh>=3' export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f8da16e4..fa06a7105 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,13 +109,13 @@ execute_process( OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) -configure_file(templates/setup.sh.in ${CMAKE_CURRENT_BINARY_DIR}/setup.sh @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh - DESTINATION ${CMAKE_INSTALL_PREFIX} -) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh +configure_file(templates/thisepic.sh.in ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh DESTINATION ${CMAKE_INSTALL_BINDIR} - RENAME this${PROJECT_NAME}.sh +) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh + DESTINATION ${CMAKE_INSTALL_PREFIX} + RENAME setup.sh ) # install programs diff --git a/README.md b/README.md index b26cf36ff..aa19caebd 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ cmake --install build ``` To load the geometry, you can use the scripts in the `install` directory: ```bash -source install/setup.sh +source install/bin/thisepic.sh ``` ### Adding/changing detector geometry diff --git a/templates/setup.sh.in b/templates/thisepic.sh.in similarity index 56% rename from templates/setup.sh.in rename to templates/thisepic.sh.in index 9f1006ce8..464202c72 100644 --- a/templates/setup.sh.in +++ b/templates/thisepic.sh.in @@ -3,7 +3,12 @@ export DETECTOR=@PROJECT_NAME@ export DETECTOR_PATH=@CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@ export DETECTOR_CONFIG=${1:-@PROJECT_NAME@} -export DETECTOR_VERSION=@GIT_BRANCH@ + +## Warn is not the right name (this script is sourced, hence $1) +if [[ "$(basename ${BASH_SOURCE[0]})" != "thisepic.sh" ]]; then + echo "Warning: This script will cease to exist at '$(realpath --no-symlinks ${BASH_SOURCE[0]})'." + echo " Please use the version at '$(realpath --no-symlinks $(dirname ${BASH_SOURCE[0]})/thisepic.sh)'." +fi ## Export detector libraries if [[ "$(uname -s)" = "Darwin" ]] || [[ "$OSTYPE" == "darwin"* ]]; then From 6dbba78f3e0196e752e41e976950d7af02b14118 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 23:40:23 -0500 Subject: [PATCH 092/113] build(deps): bump eic/trigger-gitlab-ci from 2 to 3 (#726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [eic/trigger-gitlab-ci](https://github.com/eic/trigger-gitlab-ci) from 2 to 3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/eic/trigger-gitlab-ci/releases">eic/trigger-gitlab-ci's releases</a>.</em></p> <blockquote> <h2>v3</h2> <h2>What's Changed</h2> <ul> <li>action.yml: parse variables line by line by <a href="https://github.com/veprbl"><code>@veprbl</code></a> in <a href="https://redirect.github.com/eic/trigger-gitlab-ci/pull/11">eic/trigger-gitlab-ci#11</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/eic/trigger-gitlab-ci/compare/v2...v3">https://github.com/eic/trigger-gitlab-ci/compare/v2...v3</a></p> <h2>v2.1</h2> <h2>What's Changed</h2> <ul> <li>action.yml: print response json when error occurs by <a href="https://github.com/veprbl"><code>@veprbl</code></a> in <a href="https://redirect.github.com/eic/trigger-gitlab-ci/pull/10">eic/trigger-gitlab-ci#10</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/veprbl"><code>@veprbl</code></a> made their first contribution in <a href="https://redirect.github.com/eic/trigger-gitlab-ci/pull/10">eic/trigger-gitlab-ci#10</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/eic/trigger-gitlab-ci/compare/v2...v2.1">https://github.com/eic/trigger-gitlab-ci/compare/v2...v2.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/eic/trigger-gitlab-ci/commit/5651b8b0d87f0c6c14f629314737793ecd8b82fb"><code>5651b8b</code></a> action.yml: parse variables line by line (<a href="https://redirect.github.com/eic/trigger-gitlab-ci/issues/11">#11</a>)</li> <li>See full diff in <a href="https://github.com/eic/trigger-gitlab-ci/compare/v2...v3">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/linux-eic-shell.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index fdf0fb96f..54a4f159e 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -128,7 +128,7 @@ jobs: - xmllint-after-build - list-detector-configs steps: - - uses: eic/trigger-gitlab-ci@v2 + - uses: eic/trigger-gitlab-ci@v3 id: trigger with: url: https://eicweb.phy.anl.gov @@ -524,7 +524,7 @@ jobs: matrix: detector_config: [epic_craterlake] steps: - - uses: eic/trigger-gitlab-ci@v2 + - uses: eic/trigger-gitlab-ci@v3 id: trigger with: url: https://eicweb.phy.anl.gov From cd33003a36ffb1a729d698b526160a3c22ee4af1 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Thu, 23 May 2024 15:49:33 -0500 Subject: [PATCH 093/113] fix: correct warning message when using setup.sh (#734) ### Briefly, what does this PR introduce? This PR fixes the warning which said: ``` Warning: This script will cease to exist at '/opt/detector/epic-main/setup.sh'. Please use the version at '/opt/detector/epic-main/thisepic.sh'. ``` to say the following instead: ``` Warning: This script will cease to exist at '/opt/detector/epic-main/setup.sh'. Please use the version at '/opt/detector/epic-main/bin/thisepic.sh'. ``` ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --- templates/thisepic.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/thisepic.sh.in b/templates/thisepic.sh.in index 464202c72..9a6013f05 100644 --- a/templates/thisepic.sh.in +++ b/templates/thisepic.sh.in @@ -7,7 +7,7 @@ export DETECTOR_CONFIG=${1:-@PROJECT_NAME@} ## Warn is not the right name (this script is sourced, hence $1) if [[ "$(basename ${BASH_SOURCE[0]})" != "thisepic.sh" ]]; then echo "Warning: This script will cease to exist at '$(realpath --no-symlinks ${BASH_SOURCE[0]})'." - echo " Please use the version at '$(realpath --no-symlinks $(dirname ${BASH_SOURCE[0]})/thisepic.sh)'." + echo " Please use the version at '$(realpath --no-symlinks $(dirname ${BASH_SOURCE[0]})/bin/thisepic.sh)'." fi ## Export detector libraries From f638ae9e23e80d2c0059ed753b0a9a9b147873eb Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Fri, 24 May 2024 16:01:34 -0400 Subject: [PATCH 094/113] linux-eic-shell.yml: trigger {physics,reconstruction}_benchmarks directly (#737) Trigger physics benchmarks directly. After https://github.com/eic/detector_benchmarks/pull/23, the downstream pipelines are not triggered, so we need to trigger them ourselves. This is a good opportunity start to triggering them earlier. ### Briefly, what does this PR introduce? ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --- .github/workflows/linux-eic-shell.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 54a4f159e..0a1464361 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -517,19 +517,30 @@ jobs: noverlaps="$(grep -c GeomVol1002 doc/overlap_check_geant4.out || true)" if [[ "${noverlaps}" -gt "0" ]] ; then echo "${noverlaps} overlaps found!" && false ; fi - trigger-detector-benchmarks: + trigger-benchmarks: runs-on: ubuntu-latest needs: [check-overlap-tgeo, check-overlap-geant4-fast] strategy: matrix: detector_config: [epic_craterlake] + benchmark_repo: [detector_benchmarks, physics_benchmarks, reconstruction_benchmarks] + include: + - benchmark_repo: detector_benchmarks + project_id: 399 + secret_var: EICWEB_DETECTOR_BENCHMARK_TRIGGER + - benchmark_repo: physics_benchmarks + project_id: 400 + secret_var: EICWEB_PHYSICS_BENCHMARK_TRIGGER + - benchmark_repo: reconstruction_benchmarks + project_id: 408 + secret_var: EICWEB_RECONSTRUCTION_BENCHMARK_TRIGGER steps: - uses: eic/trigger-gitlab-ci@v3 id: trigger with: url: https://eicweb.phy.anl.gov - project_id: 399 - token: ${{ secrets.EICWEB_DETECTOR_BENCHMARK_TRIGGER }} + project_id: ${{ matrix.project_id }} + token: ${{ secrets[matrix.secret_var] }} ref_name: master variables: | DETECTOR=epic @@ -547,7 +558,7 @@ jobs: -f state="pending" \ -f target_url="${{ steps.trigger.outputs.web_url }}" \ -f description="Triggered... $(TZ=America/New_York date)" \ - -f context="eicweb/detector_benchmarks (${{ matrix.detector_config }})" + -f context="eicweb/${{ matrix.benchmark_repo }} (${{ matrix.detector_config }})" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e16473c0c5dc0584ef1db7fe9a1f881c4fe4cbb5 Mon Sep 17 00:00:00 2001 From: Simon Gardner <simon.gardner@glasgow.ac.uk> Date: Sat, 25 May 2024 05:41:46 +0100 Subject: [PATCH 095/113] Added tmva model to file loader (#735) ### Briefly, what does this PR introduce? Introduces the tmva low-q2 model file to the geometry calibrations so it gets downloaded when the geometry is loaded by eicrecon ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --------- Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/calibrations.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compact/calibrations.xml b/compact/calibrations.xml index 3696c7fa8..724d7b239 100644 --- a/compact/calibrations.xml +++ b/compact/calibrations.xml @@ -4,6 +4,11 @@ <lccdd> <plugins> + <plugin name="epic_FileLoader"> + <arg value="cache:$DETECTOR_PATH:/opt/detector"/> + <arg value="file:calibrations/tmva/LowQ2_DNN_CPU.weights.xml"/> + <arg value="url:https://raw.githubusercontent.com/eic/epic-data/e441e5d88d0a44a1e407d3083914ac1a7de26f41/tmva/LowQ2_DNN_CPU.weights.xml"/> + </plugin> <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/onnx/identity_gemm_w1x1_b1.onnx"/> From 3fd9d7b284b1e203cf4a7a74c676105542091456 Mon Sep 17 00:00:00 2001 From: Michael Pitt <m_u_pitt@yahoo.com> Date: Thu, 30 May 2024 01:14:35 +0300 Subject: [PATCH 096/113] Add more vacuum at z>40m (#720) ### Briefly, what does this PR introduce? This RP will fill the hadron line downstream with a vacuum to allow faster simulation of ion fragments. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [X] Other: This makes the simulation run faster in case of eA collisions in which ions (or ion fragments) are defined as stable particles and propagate downstream the Hadron beamline (x10 improvement). ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [X] Changes have been communicated to collaborators: Presented at the FF WG meeting on May 14 https://indico.bnl.gov/event/23379/#15-forward-detectors-with-epic ### Does this PR introduce breaking changes? What changes might users need to make to their code? Besides the execution time, this PR should keep the results unchanged. ### Does this PR change default behavior? no --------- Co-authored-by: Michael Pitt <mpitt@eic0106.rcf.bnl.gov> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/far_forward/vacuum.xml | 6 ++++ src/magnetVacuumFF.cpp | 61 +++++++++++++++++++++------------- 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/compact/far_forward/vacuum.xml b/compact/far_forward/vacuum.xml index 10d8a1966..ad5c8acab 100644 --- a/compact/far_forward/vacuum.xml +++ b/compact/far_forward/vacuum.xml @@ -53,6 +53,12 @@ <apperture x="B1APF_InnerRadius*2" y="B1APF_InnerRadius*2" r="B1APF_InnerRadius"/> </element> + <element> + <placement x="B2PF_XPosition" y="0*m" z="B2PF_CenterPosition" theta="B2PF_RotationAngle" /> + <dimensions z="B2PF_Length" /> + <apperture x="B2PF_InnerRadius*2" y="B2PF_InnerRadius*2" r="B2PF_InnerRadius" /> + </element> + </detector> </detectors> diff --git a/src/magnetVacuumFF.cpp b/src/magnetVacuumFF.cpp index eb462fcea..3ffe3d1d8 100644 --- a/src/magnetVacuumFF.cpp +++ b/src/magnetVacuumFF.cpp @@ -44,7 +44,8 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * // make it easier to update later. //---------------------------------------------- - bool makeIP_B0pfVacuum = true; //This is for the special gap location between IP and b0pf + bool makeIP_B0pfVacuum = true; //This is for the special gap location between IP and b0pf + bool make_B2pf_EW_Vacuum = true; //This is for the gap after b2pf //information for actual FF magnets, with magnet centers as reference vector<double> radii_magnet; @@ -101,7 +102,7 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * int numMagnets = radii_magnet.size(); //number of actual FF magnets between IP and FF detectors int numGaps = numMagnets - - 1; //number of gaps between magnets (excluding the IP to B0pf transition -- special case) + 2; //number of gaps between magnets (excluding the IP to B0pf transition -- special case, and the gao after B1apf) //------------------------------------------- // override numbers for the first element --> @@ -202,14 +203,10 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * Volume vpiece(piece_name, magnetPiece, m_Vac); sdet.setAttributes(det, vpiece, x_det.regionStr(), x_det.limitsStr(), vis_name); - auto pv = assembly.placeVolume( - vpiece, Transform3D(RotationY(rotation_magnet[pieceIdx]), - Position(x_elem_magnet[pieceIdx], y_elem_magnet[pieceIdx], - z_elem_magnet[pieceIdx]))); - pv.addPhysVolID("sector", 1); - - DetElement de(sdet, Form("sector%d_de", pieceIdx), 1); - de.setPlacement(pv); + assembly.placeVolume(vpiece, + Transform3D(RotationY(rotation_magnet[pieceIdx]), + Position(x_elem_magnet[pieceIdx], y_elem_magnet[pieceIdx], + z_elem_magnet[pieceIdx]))); } //-------------------------- @@ -230,13 +227,8 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * Volume vpiece(piece_name, gapPiece, m_Vac); sdet.setAttributes(det, vpiece, x_det.regionStr(), x_det.limitsStr(), vis_name); - auto pv = assembly.placeVolume( - vpiece, Transform3D(RotationY(angle_elem_gap[correctIdx]), - Position(x_gap[correctIdx], 0.0, z_gap[correctIdx]))); - pv.addPhysVolID("sector", 1); - - DetElement de(sdet, Form("sector%d_de", pieceIdx), 1); - de.setPlacement(pv); + assembly.placeVolume(vpiece, Transform3D(RotationY(angle_elem_gap[correctIdx]), + Position(x_gap[correctIdx], 0.0, z_gap[correctIdx]))); } //-------------------------------------------------------------- @@ -259,17 +251,38 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * Volume specialGap_v(piece_name, specialGap, m_Vac); sdet.setAttributes(det, specialGap_v, x_det.regionStr(), x_det.limitsStr(), vis_name); - auto pv = - assembly.placeVolume(specialGap_v, Transform3D(RotationY(crossingAngle), - Position(specialGap_x, 0.0, specialGap_z))); - pv.addPhysVolID("sector", 1); - - DetElement de(sdet, Form("sector%d_de", numGaps + numMagnets), 1); - de.setPlacement(pv); + assembly.placeVolume(specialGap_v, Transform3D(RotationY(crossingAngle), + Position(specialGap_x, 0.0, specialGap_z))); } //---------------------------------------------------- + //-------------------------------------------------------------- + //make and place vacuum volume after the FF detector array up to end of the world + //-------------------------------------------------------------- + if (make_B2pf_EW_Vacuum) { + + int pieceIdx = numMagnets - 1; // last B2PF magnet + std::string piece_name = Form("GapVacuum%d", numGaps + numMagnets + 1); + double endGapLength = (10000.0 - z_end[pieceIdx]) / cos(rotation_magnet[pieceIdx]); + endGapLength = + endGapLength - + 4 * radii_magnet[pieceIdx] * + tan(-rotation_magnet[pieceIdx]); // shift to keep the tube inside the physical volume + double endGap_z = 0.5 * endGapLength * cos(rotation_magnet[pieceIdx]) + z_end[pieceIdx]; + double endGap_x = 0.5 * endGapLength * sin(rotation_magnet[pieceIdx]) + x_end[pieceIdx]; + + Tube vacuum_endWorld(piece_name, 0.0, 4 * radii_magnet[pieceIdx], + endGapLength / 2); // make larger tube than inner magnet radius + Volume vpiece(piece_name, vacuum_endWorld, m_Vac); + sdet.setAttributes(det, vpiece, x_det.regionStr(), x_det.limitsStr(), + "InvisibleNoDaughters"); // make invisible instead of AnlBlue + + assembly.placeVolume(vpiece, Transform3D(RotationY(rotation_magnet[pieceIdx]), + Position(endGap_x, 0.0, endGap_z))); + } + //---------------------------------------------------- + pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly); pv_assembly.addPhysVolID("system", x_det.id()).addPhysVolID("barrel", 1); sdet.setPlacement(pv_assembly); From 7c7f26f34371e70754ad582487b32f79acb0ac4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 20:41:39 -0500 Subject: [PATCH 097/113] build(deps): bump korthout/backport-action from 2 to 3 (#738) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 2 to 3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/korthout/backport-action/releases">korthout/backport-action's releases</a>.</em></p> <blockquote> <h2>Backport-action v3.0.0</h2> <h2>Changed</h2> <ul> <li>[Breaking] Use merge method to cherry-pick by default by <a href="https://github.com/korthout"><code>@korthout</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/420">korthout/backport-action#420</a></li> </ul> <p>This release changes the default behavior of the action to determine which commits are cherry-picked. While this behavior change doesn't necessarily require changes to your workflow, it warrants a major version bump.</p> <p>Previously, the action cherry-picked the commits from the pull request. Specifically, those reachable from the pull request's head and not reachable from the pull request's base.</p> <p>From now on, the action cherry-picks the commits based on the method used to merge the pull request by default.</p> <ul> <li>For "Squash and merge", the action cherry-picks the squashed commit.</li> <li>For "Rebase and merge", the action cherry-picks the rebased commits.</li> <li>For "Merged as a merge commit", the action cherry-picks the commits from the pull request.</li> </ul> <p>If you previously used the experimental <code>detect_merge_method</code> input, we suggest you remove it from your workflow. This experimental input has been deprecated and replaced by the <a href="https://github.com/korthout/backport-action?tab=readme-ov-file#cherry_picking"><code>cherry_picking</code></a> input.</p> <p>If you want to return to the previous behavior, you can set the <a href="https://github.com/korthout/backport-action?tab=readme-ov-file#cherry_picking"><code>cherry_picking</code></a> input to <code>pull_request_head</code>.</p> <p>This behavior was previously available via the experimental <code>detect_merge_method</code> input, introduced in <a href="https://redirect.github.com/korthout/backport-action/pull/399">korthout/backport-action#399</a>. Special thanks go out to <a href="https://github.com/jschmid1"><code>@jschmid1</code></a> for contributing this feature.</p> <h2>Added</h2> <p>This release also adds two new experimental features. Special shoutouts to <a href="https://github.com/tasso94"><code>@tasso94</code></a> and <a href="https://github.com/vermz99"><code>@vermz99</code></a> for contributing these!</p> <ul> <li>Allow backporting to a downstream repository by <a href="https://github.com/tasso94"><code>@tasso94</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/405">korthout/backport-action#405</a></li> </ul> <p>With the experimental <a href="https://github.com/korthout/backport-action?tab=readme-ov-file#downstream_repo"><code>downstream_repo</code></a> and <a href="https://github.com/korthout/backport-action?tab=readme-ov-file#downstream_owner"><code>downstream_owner</code></a> inputs, you can backport to a repository other than where the workflow runs. For example, when you use a fork to maintain the previously released versions. You can also see this as backporting to a remote repository, but we felt it was better described as backporting to a downstream repository. The default behavior remains that the action always backports to the repository in which the workflow runs.</p> <ul> <li>Add <code>conflict_resolution</code> input by <a href="https://github.com/vermz99"><code>@vermz99</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/417">korthout/backport-action#417</a></li> </ul> <p>With the experimental <a href="https://github.com/korthout/backport-action?tab=readme-ov-file#conflict_resolution"><code>conflict_resolution</code></a> input, you can now change how the action will handle conflicts during cherry-picking. Set it to <code>draft_commit_conflicts</code> to create a draft pull request with the first conflict encountered committed to reduce some of the manual efforts in backporting. The default behavior stays like before and can be configured explicitly as <code>fail</code>. In that case, the backport fails when the cherry-pick encounters a conflict.</p> <h2>Updated Dependencies</h2> <ul> <li>build(deps): bump undici from 5.28.3 to 5.28.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/418">korthout/backport-action#418</a></li> <li>build(deps): bump dedent from 1.5.1 to 1.5.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/419">korthout/backport-action#419</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/tasso94"><code>@tasso94</code></a> made their first contribution in <a href="https://redirect.github.com/korthout/backport-action/pull/405">korthout/backport-action#405</a></li> <li><a href="https://github.com/vermz99"><code>@vermz99</code></a> made their first contribution in <a href="https://redirect.github.com/korthout/backport-action/pull/417">korthout/backport-action#417</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/korthout/backport-action/compare/v2.5.0...v3.0.0">https://github.com/korthout/backport-action/compare/v2.5.0...v3.0.0</a></p> <h2>Backport-action v2.5.0</h2> <h2>What's Changed</h2> <ul> <li>Add configurable <code>branch_name</code> input by <a href="https://github.com/AlexVermette-Eaton"><code>@AlexVermette-Eaton</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/416">korthout/backport-action#416</a></li> </ul> <h2>Updated Dependencies</h2> <ul> <li>build(deps): bump undici from 5.27.0 to 5.28.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/korthout/backport-action/pull/414">korthout/backport-action#414</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/AlexVermette-Eaton"><code>@AlexVermette-Eaton</code></a> made their first contribution in <a href="https://redirect.github.com/korthout/backport-action/pull/416">korthout/backport-action#416</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/korthout/backport-action/commit/7e7cb1977d64d20339e8fdec12c0a1a065371de7"><code>7e7cb19</code></a> dist: release 3.0.0</li> <li><a href="https://github.com/korthout/backport-action/commit/5ff61e2a4ef0b1622f968587c9a7ca727b493cfb"><code>5ff61e2</code></a> Merge pull request <a href="https://redirect.github.com/korthout/backport-action/issues/420">#420</a> from korthout/korthout-elevate-detect-merge-method-input</li> <li><a href="https://github.com/korthout/backport-action/commit/54c4bc6f55dd9c72655c0260b10f6bd90da1f2b7"><code>54c4bc6</code></a> dist: bump major version to v3</li> <li><a href="https://github.com/korthout/backport-action/commit/206c8313707874faf344362a5ef70f433928d1fa"><code>206c831</code></a> dist: build new version</li> <li><a href="https://github.com/korthout/backport-action/commit/79c8bf770142d62bb43fdd83d12f3e9b799c28e5"><code>79c8bf7</code></a> docs: remove deprecated detect_merge_method input</li> <li><a href="https://github.com/korthout/backport-action/commit/0d9e56705b93ca27bcf01514f68ddc7f82ba4abf"><code>0d9e567</code></a> feat: deprecate experimental detect_merge_method</li> <li><a href="https://github.com/korthout/backport-action/commit/f63ddf8c948929bdaf44d0f0375c29e60f7860e6"><code>f63ddf8</code></a> breaking: change default cherry-picked commits</li> <li><a href="https://github.com/korthout/backport-action/commit/a9da7bca50ebd6a739d318b6b0ae8cbaef731bad"><code>a9da7bc</code></a> docs: clarify how commits are cherry-picked</li> <li><a href="https://github.com/korthout/backport-action/commit/a3c24611eba2eeafccb9fc6eb4355137931b6067"><code>a3c2461</code></a> feat: introduce cherry_picking input</li> <li><a href="https://github.com/korthout/backport-action/commit/8e95300cb7fb0b4e3cbb6e09eadae1a264b61030"><code>8e95300</code></a> Merge pull request <a href="https://redirect.github.com/korthout/backport-action/issues/417">#417</a> from vermz99/main</li> <li>Additional commits viewable in <a href="https://github.com/korthout/backport-action/compare/v2...v3">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/pr-backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-backport.yml b/.github/workflows/pr-backport.yml index 768d1965f..66fdbb6ec 100644 --- a/.github/workflows/pr-backport.yml +++ b/.github/workflows/pr-backport.yml @@ -14,6 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - name: Create backport pull requests - uses: korthout/backport-action@v2 + uses: korthout/backport-action@v3 with: github_token: ${{ secrets.BACKPORT_ACTION_TOKEN }} From 8c40e0ba534f9c3bd7cac3bfcbb46c785b368643 Mon Sep 17 00:00:00 2001 From: Matt Posik <mposik1983@gmail.com> Date: Sun, 2 Jun 2024 19:10:58 -0400 Subject: [PATCH 098/113] Update definitions_craterlake.xml (#731) update forward mpgd disk inner radii ### Briefly, what does this PR introduce? Increases the inner radii of the forward MPGD disks to 9cm as described in the geometry table:https://eic.jlab.org/Geometry/Detector/Detector-20240515102931.html ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [x] Other: ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ x] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? none ### Does this PR change default behavior? no Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/tracking/definitions_craterlake.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/tracking/definitions_craterlake.xml b/compact/tracking/definitions_craterlake.xml index ce5bc835e..6ab463102 100644 --- a/compact/tracking/definitions_craterlake.xml +++ b/compact/tracking/definitions_craterlake.xml @@ -103,8 +103,8 @@ <comment> Main parameters for MPGD endcap disks, offset here is the distance between disks </comment> <constant name="ForwardMPGD_zmin" value="148*cm"/> <constant name="ForwardMPGDMod_offset" value="13.0*cm"/> - <constant name="ForwardMPGDMod1_rmin" value="7.014*cm" /> - <constant name="ForwardMPGDMod2_rmin" value="7.014*cm"/> + <constant name="ForwardMPGDMod1_rmin" value="9.0*cm" /> + <constant name="ForwardMPGDMod2_rmin" value="9.0*cm"/> <constant name="ForwardMPGDMod1_rmax" value="50*cm" /> <constant name="ForwardMPGDMod2_rmax" value="50*cm" /> From 3f457b790e44496480dd596904c36ca18e02a2a3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Mon, 3 Jun 2024 19:46:02 -0400 Subject: [PATCH 099/113] EEEMCal geometry update (#704) ### Briefly, what does this PR introduce? Updates: - Change thickness of outer support volume - Removing steel from filling gaps between cells and outer support - New inner support collar - Remove copper between inner support and cells - Adjust cell width - Adjust intercell wrappers thicknesses ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? ### Does this PR change default behavior? --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/ecal/backward_PbWO4.xml | 71 +++++++++------ configurations/eeemcal_only.yml | 7 ++ src/HomogeneousCalorimeter_geo.cpp | 136 ++++++++++++++++------------- 3 files changed, 130 insertions(+), 84 deletions(-) create mode 100644 configurations/eeemcal_only.yml diff --git a/compact/ecal/backward_PbWO4.xml b/compact/ecal/backward_PbWO4.xml index 5db0b266b..636440545 100644 --- a/compact/ecal/backward_PbWO4.xml +++ b/compact/ecal/backward_PbWO4.xml @@ -1,5 +1,5 @@ <!-- SPDX-License-Identifier: LGPL-3.0-or-later --> -<!-- Copyright (C) 2022 Pu-Kai Wang, Wouter Deconinck --> +<!-- Copyright (C) 2024 Pu-Kai Wang, Wouter Deconinck, Dmitry Kalinkin --> <lccdd> <define> @@ -10,12 +10,13 @@ carbonfiber[ VM2000[ crystal ]VM2000 ]carbonfiber 0.2 0.05 200.00 </comment> - <constant name="EcalEndcapN_crystalmodule_crystal_width" value="20.00*mm"/> + <constant name="EcalEndcapN_crystalmodule_crystal_width" value="20.50*mm"/> <constant name="EcalEndcapN_crystalmodule_crystal_length" value="200.00*mm"/> - <constant name="EcalEndcapN_crystalmodule_carbonfiber_thickness" value="0.20*mm"/> - <constant name="EcalEndcapN_crystalmodule_VM2000_thickness" value="0.05*mm"/> + <constant name="EcalEndcapN_crystalmodule_carbonfiber_thickness" value="0.25*mm"/> + <constant name="EcalEndcapN_crystalmodule_VM2000_thickness" value="0.13*mm"/> <constant name="EcalEndcapN_crystalmodule_carbonfiber_length" value="20.00*mm"/> <constant name="EcalEndcapN_crystalmodule_PCB_thickness" value="1.45*mm"/> + <constant name="EcalEndcapN_crystalmodule_total_width" value="EcalEndcapN_crystalmodule_crystal_width + 2 * EcalEndcapN_crystalmodule_carbonfiber_thickness + 2 * EcalEndcapN_crystalmodule_VM2000_thickness"/> <comment> The S14160 SiPM from Hamamatsu is planned to use @@ -27,6 +28,8 @@ <constant name="EcalEndcapN_crystalmodule_Nsensor_in_X" value="2"/> <constant name="EcalEndcapN_crystalmodule_Nsensor_in_Y" value="2"/> + <constant name="EcalEndcapN_crystalmodule_total_length" value="EcalEndcapN_crystalmodule_crystal_length + EcalEndcapN_crystalmodule_VM2000_thickness + EcalEndcapN_crystalmodule_sensor_thickness + EcalEndcapN_crystalmodule_PCB_thickness" /> + <comment> Basic hardcoded parameters about supporting structures, rotation and shift ** +15 deg rotation (Protate) make top side of outer supporting structure (Oring) and @@ -39,15 +42,17 @@ ** some existed parameters are passed from "difinition.xml" </comment> <constant name="EcalEndcapN_structure_Oring_length" value="EcalEndcapN_length"/> + <constant name="EcalEndcapN_inner_support_length" value="25.*cm"/> + <constant name="EcalEndcapN_envelope_length" value="max(EcalEndcapN_inner_support_length, EcalEndcapN_crystalmodule_total_length)" /> + <constant name="EcalEndcapN_structure_Oring_thickness" value="2.0*cm"/> <constant name="EcalEndcapN_structure_Oring_max" value="65.00*cm"/> - <constant name="EcalEndcapN_structure_Oring_min" value="EcalEndcapN_structure_Oring_max - 0.9*cm"/> + <constant name="EcalEndcapN_structure_Oring_min" value="EcalEndcapN_structure_Oring_max - EcalEndcapN_structure_Oring_thickness"/> <constant name="EcalEndcapN_Protate" value="15.*degree"/> <constant name="EcalEndcapN_Nrotate" value="-15.*degree"/> - <constant name="EcalEndcapN_Oring_relative_shift" value="-20.*cm"/> - <constant name="EcalEndcapN_Iring_axisA" value="7.5*cm"/> + <constant name="EcalEndcapN_Oring_relative_shift" value="(EcalEndcapN_envelope_length - EcalEndcapN_structure_Oring_length) / 2"/> + <constant name="EcalEndcapN_Iring_axisA" value="7.0*cm"/> <constant name="EcalEndcapN_Iring_axisB" value="5.5*cm"/> - <comment> FIXME currently unused </comment> @@ -68,7 +73,7 @@ name="EcalEndcapN" type="epic_HomogeneousCalorimeter" readout="EcalEndcapNHits"> - <position x="0" y="0" z="-(EcalEndcapN_zmin + (EcalEndcapN_crystalmodule_crystal_length + EcalEndcapN_crystalmodule_VM2000_thickness + EcalEndcapN_crystalmodule_sensor_thickness + EcalEndcapN_crystalmodule_PCB_thickness)/2.)"/> + <position x="0" y="0" z="-(EcalEndcapN_zmin + EcalEndcapN_envelope_length / 2.)"/> <rotation x="0" y="0." z="0"/> <placements> <disk_12surface @@ -77,7 +82,8 @@ r12min="EcalEndcapN_structure_Oring_min" r12max="EcalEndcapN_structure_Oring_max" outerringlength="EcalEndcapN_structure_Oring_length" - modulelength="EcalEndcapN_crystalmodule_crystal_length + EcalEndcapN_crystalmodule_VM2000_thickness + EcalEndcapN_crystalmodule_sensor_thickness + EcalEndcapN_crystalmodule_PCB_thickness" + modulelength="EcalEndcapN_crystalmodule_total_length" + envelope_length="EcalEndcapN_envelope_length" protate="EcalEndcapN_Protate" nrotate="EcalEndcapN_Nrotate" outerringshift="EcalEndcapN_Oring_relative_shift" @@ -87,29 +93,44 @@ ringmaterial="StainlessSteel" sector="1" vis_struc="RPVis" - vis_steel_gap="AnlGray"> + vis_steel_gap="InvisibleWithDaughters"> + + <comment> + A small `x_offset` here is set to avoid overlap with regular cell aligment. + </comment> + <inner_support_collar + electron_rmin="65 * mm" + electron_rmax="73 * mm" + proton_rmin="35 * mm" + proton_rmax="43 * mm" + straight_section_tilt="62.05 * deg" + z_length="EcalEndcapN_inner_support_length" + x_offset="-1 * mm" + material="Copper" + vis="AnlOrange" + /> <comment> The points information for constructing inner supporting structure [extrudedpolygon shape, 12 points in total] </comment> <points_extrudedpolygon> - <position x="6.15*cm" y="6.15*cm"/> - <position x="6.15*cm" y="4.1*cm"/> - <position x="8.2*cm" y="4.1*cm"/> - <position x="8.2*cm" y="-4.1*cm"/> - <position x="6.15*cm" y="-4.1*cm"/> - <position x="6.15*cm" y="-6.15*cm"/> - <position x="-6.15*cm" y="-6.15*cm"/> - <position x="-6.15*cm" y="-4.1*cm"/> - <position x="-8.2*cm" y="-4.1*cm"/> - <position x="-8.2*cm" y="4.1*cm"/> - <position x="-6.15*cm" y="4.1*cm"/> - <position x="-6.15*cm" y="6.15*cm"/> + <position x="3 * EcalEndcapN_crystalmodule_total_width" y="3.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="3 * EcalEndcapN_crystalmodule_total_width" y="2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="5 * EcalEndcapN_crystalmodule_total_width" y="2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="5 * EcalEndcapN_crystalmodule_total_width" y="-2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="3 * EcalEndcapN_crystalmodule_total_width" y="-2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="3 * EcalEndcapN_crystalmodule_total_width" y="-3.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="-3 * EcalEndcapN_crystalmodule_total_width" y="-3.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="-3 * EcalEndcapN_crystalmodule_total_width" y="-2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="-4 * EcalEndcapN_crystalmodule_total_width" y="-2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="-4 * EcalEndcapN_crystalmodule_total_width" y="2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="-3 * EcalEndcapN_crystalmodule_total_width" y="2.5 * EcalEndcapN_crystalmodule_total_width"/> + <position x="-3 * EcalEndcapN_crystalmodule_total_width" y="3.5 * EcalEndcapN_crystalmodule_total_width"/> </points_extrudedpolygon> <module - modulex="EcalEndcapN_crystalmodule_crystal_width + 2.0*EcalEndcapN_crystalmodule_carbonfiber_thickness + 2.0*EcalEndcapN_crystalmodule_VM2000_thickness" - moduley="EcalEndcapN_crystalmodule_crystal_width + 2.0*EcalEndcapN_crystalmodule_carbonfiber_thickness + 2.0*EcalEndcapN_crystalmodule_VM2000_thickness" + modulex="EcalEndcapN_crystalmodule_total_width" + moduley="EcalEndcapN_crystalmodule_total_width" modulez="EcalEndcapN_crystalmodule_crystal_length + EcalEndcapN_crystalmodule_VM2000_thickness + EcalEndcapN_crystalmodule_sensor_thickness + EcalEndcapN_crystalmodule_PCB_thickness" moduleshift="EcalEndcapN_crystalmodule_VM2000_thickness" gmaterial="Vacuum" diff --git a/configurations/eeemcal_only.yml b/configurations/eeemcal_only.yml new file mode 100644 index 000000000..1e0a3ef80 --- /dev/null +++ b/configurations/eeemcal_only.yml @@ -0,0 +1,7 @@ +features: + # beampipe: + tracking: + definitions_craterlake: + support_service_craterlake: + ecal: + backward_PbWO4: diff --git a/src/HomogeneousCalorimeter_geo.cpp b/src/HomogeneousCalorimeter_geo.cpp index 28b915068..e24ceeae8 100644 --- a/src/HomogeneousCalorimeter_geo.cpp +++ b/src/HomogeneousCalorimeter_geo.cpp @@ -1,22 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Chao Peng, Dmitry Romanov, Pu-Kai Wang -//========================================================================== -// A general implementation for homogeneous calorimeter -//-------------------------------------------------------------------------- -// Author: Chao Peng (ANL) -// Date: 06/09/2021 -//========================================================================== -//========================================================================== -// Date: 03/10/2022 -// Add the new geometry and the supporting structue -// Adapted the single module with additional wrraper and supporting structure -//-------------------------------------------------------------------------- -// Date: 20/03/2023 -// Reorganize and optimize the scripts -// Adapted the inner supporting structure for improving low Q2 measurements -//-------------------------------------------------------------------------- -// Author: WANG Pu-Kai, ZHU Yuwei (IJClab) -//========================================================================== +// Copyright (C) 2022 - 2024, Chao Peng, Dmitry Romanov, Pu-Kai Wang, Yuwei Zhu, Dmitry Kalinkin #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" @@ -35,7 +18,6 @@ using namespace dd4hep; /** \addtogroup Homogeneous Calorimeter * \brief Type: **HomogeneousCalorimeter**. - * \author C. Peng * \ingroup calorimeters * * @{ @@ -58,6 +40,63 @@ template <class XmlComp> Position get_xml_xyz(XmlComp& comp, dd4hep::xml::Strng_ return pos; } +static Volume inner_support_collar(Detector& desc, xml_comp_t handle) { + // This consists of two circular tubes joined by straight sections + + Material inner_ring_material = desc.material(handle.materialStr()); + + double electron_rmin = handle.attr<double>(_Unicode(electron_rmin)); + double electron_rmax = handle.attr<double>(_Unicode(electron_rmax)); + double proton_rmin = handle.attr<double>(_Unicode(proton_rmin)); + double proton_rmax = handle.attr<double>(_Unicode(proton_rmax)); + double straight_section_tilt = handle.attr<double>(_Unicode(straight_section_tilt)); + double z_length = handle.z_length(); + + double proton_x_offset = ((electron_rmax + electron_rmin) - (proton_rmax + proton_rmin)) / 2 / + cos(straight_section_tilt); + double mean_radius = (electron_rmax + electron_rmin + proton_rmax + proton_rmin) / 4; + Position straight_section_offset{ + proton_x_offset / 2 + cos(straight_section_tilt) * mean_radius, + sin(straight_section_tilt) * mean_radius, + 0, + }; + Position straight_section_offset_mirror_y{ + straight_section_offset.x(), + -straight_section_offset.y(), + straight_section_offset.z(), + }; + + Tube electron_side{electron_rmin, electron_rmax, z_length / 2, straight_section_tilt, + -straight_section_tilt}; + Tube proton_side{proton_rmin, proton_rmax, z_length / 2, -straight_section_tilt, + straight_section_tilt}; + Trd1 electron_proton_straight_section{ + (electron_rmax - electron_rmin) / 2, + (proton_rmax - proton_rmin) / 2, + z_length / 2, + proton_x_offset * sin(straight_section_tilt) / 2, + }; + UnionSolid inner_support{ + UnionSolid{ + UnionSolid{ + electron_side, + proton_side, + Position{proton_x_offset, 0., 0.}, + }, + electron_proton_straight_section, + Transform3D{straight_section_offset} * RotationZ(straight_section_tilt) * + RotationX(90 * deg), + }, + electron_proton_straight_section, + Transform3D{straight_section_offset_mirror_y} * RotationZ(-straight_section_tilt) * + RotationX(-90 * deg), + }; + + Volume inner_support_vol{"inner_support_vol", inner_support, inner_ring_material}; + inner_support_vol.setVisAttributes(desc.visAttributes(handle.visStr())); + return inner_support_vol; +} + // main static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) { xml::DetElement detElem = handle; @@ -228,6 +267,7 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A double r12max = plm.attr<double>(_Unicode(r12max)); double structure_frame_length = plm.attr<double>(_Unicode(outerringlength)); double calo_module_length = plm.attr<double>(_Unicode(modulelength)); + double envelope_length = plm.attr<double>(_Unicode(envelope_length)); double Prot = plm.attr<double>(_Unicode(protate)); double Nrot = plm.attr<double>(_Unicode(nrotate)); double Oring_shift = plm.attr<double>(_Unicode(outerringshift)); @@ -240,16 +280,6 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A std::vector<double> pt_innerframe_y; double half_modx = modSize.x() * 0.5, half_mody = modSize.y() * 0.5; - //========================================================= - // Read the positions information from xml file - //========================================================= - xml_coll_t pts_extrudedpolygon(plm, _Unicode(points_extrudedpolygon)); - for (xml_coll_t position_i(pts_extrudedpolygon, _U(position)); position_i; ++position_i) { - xml_comp_t position_comp = position_i; - pt_innerframe_x.push_back((position_comp.x())); - pt_innerframe_y.push_back((position_comp.y())); - } - //========================================================= // optional envelope volume and the supporting frame //========================================================= @@ -258,8 +288,6 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A // Material outer_ring_material = desc.material(getAttrOrDefault<std::string>(plm, _U(material), "StainlessSteel")); - Material inner_ring_material = - desc.material(getAttrOrDefault<std::string>(plm, _U(material), "Copper")); //============================== // Outer supporting frame @@ -270,34 +298,15 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A Transform3D tr_global_Oring = RotationZYX(Prot, 0., 0.) * Translation3D(0., 0., Oring_shift); ring12_vol.setVisAttributes(desc.visAttributes(plm.attr<std::string>(_Unicode(vis_struc)))); - //============================= - // Inner supporting frame - //============================= - - // Version3: solid with elliptical inside - // - std::vector<double> sec_z = {-calo_module_length / 2., calo_module_length / 2.}; - std::vector<double> sec_x = {0., 0.}; - std::vector<double> sec_y = {0., 0.}; - std::vector<double> zscale = {1., 1.}; - - ExtrudedPolygon inner_support_main(pt_innerframe_x, pt_innerframe_y, sec_z, sec_x, sec_y, zscale); - EllipticalTube subtract_a(Innera, Innerb, calo_module_length / 2.); - SubtractionSolid inner_support_substracta(inner_support_main, subtract_a, Position(0., 0., 0.)); - Volume inner_support_vol("inner_support_vol", inner_support_substracta, inner_ring_material); - inner_support_vol.setVisAttributes( - desc.visAttributes(plm.attr<std::string>(_Unicode(vis_struc)))); - Transform3D tr_global_Iring_elli = RotationZYX(Nrot, 0., 0.) * Translation3D(0., 0., 0.); - //============================= // The mother volume of modules //============================= bool has_envelope = dd4hep::getAttrOrDefault<bool>(plm, _Unicode(envelope), false); - PolyhedraRegular solid_world(12, 0., r12min, calo_module_length); - EllipticalTube solid_sub(Innera, Innerb, calo_module_length / 2.); - Transform3D subtract_pos = RotationZYX(Nrot, 0., 0.) * Translation3D(0., 0., 0.); + PolyhedraRegular solid_world(12, 0., r12min, envelope_length); + EllipticalTube solid_sub(Innera, Innerb, envelope_length / 2.); + Transform3D subtract_pos = RotationZYX(Nrot, 0., 0.) * Translation3D(1 * cm, 0., 0.); SubtractionSolid calo_subtract(solid_world, solid_sub, subtract_pos); - Volume env_vol(std::string(env.name()) + "_envelope", calo_subtract, outer_ring_material); + Volume env_vol(std::string(env.name()) + "_envelope", calo_subtract, desc.material("Air")); Transform3D tr_global = RotationZYX(Prot, 0., 0.) * Translation3D(0., 0., 0.); env_vol.setVisAttributes(desc.visAttributes(plm.attr<std::string>(_Unicode(vis_steel_gap)))); @@ -306,15 +315,20 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A if (has_envelope) { env.placeVolume(env_vol, tr_global); // Place the mother volume for all modules env.placeVolume(ring12_vol, tr_global_Oring); // Place the outer supporting frame + + xml_comp_t collar_comp = plm.child(_Unicode(inner_support_collar)); + Volume inner_support_vol = inner_support_collar(desc, collar_comp); env_vol.placeVolume(inner_support_vol, - tr_global_Iring_elli); // Place the version3 inner supporting frame + Transform3D{RotationZ{Nrot}} * Translation3D(collar_comp.x_offset(0.), + collar_comp.y_offset(0.), + collar_comp.z_offset(0.))); } //===================================================================== // Placing The Modules //===================================================================== - auto points = epic::geo::fillRectangles({half_modx, half_mody}, modSize.x(), modSize.y(), 0., + auto points = epic::geo::fillRectangles({half_modx, 0.}, modSize.x(), modSize.y(), 0., (rmax / std::cos(Prot)), phimin, phimax); std::pair<double, double> c1(0., 0.); @@ -325,6 +339,7 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A out_vertices.push_back(a); } + xml_coll_t pts_extrudedpolygon(plm, _Unicode(points_extrudedpolygon)); for (xml_coll_t position_i(pts_extrudedpolygon, _U(position)); position_i; ++position_i) { xml_comp_t position_comp = position_i; epic::geo::Point inpt = {position_comp.x(), position_comp.y()}; @@ -341,11 +356,11 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A if (square.x() < minX) minX = square.x(); if (square.y() < minY) - minY = square.x(); + minY = square.y(); if (square.x() > maxX) maxX = square.x(); if (square.y() > maxY) - maxY = square.x(); + maxY = square.y(); } } @@ -360,12 +375,15 @@ static std::tuple<int, std::pair<int, int>> add_12surface_disk(Detector& desc, A {square.x() - half_modx, square.y() + half_mody}, {square.x() - half_modx, square.y() - half_mody}, {square.x() + half_modx, square.y() - half_mody}}; + if (epic::geo::isBoxTotalInsidePolygon(box, out_vertices)) { if (!epic::geo::isBoxTotalInsidePolygon(box, in_vertices)) { column = std::round((square.x() - minX) / modSize.x()); row = std::round((maxY - square.y()) / modSize.y()); Transform3D tr_local = - RotationZYX(Nrot, 0.0, 0.0) * Translation3D(square.x(), square.y(), 0.0); + RotationZYX(Nrot, 0.0, 0.0) * + Translation3D(square.x(), square.y(), + std::max((envelope_length - calo_module_length) / 2, 0.)); auto modPV = (has_envelope ? env_vol.placeVolume(modVol, tr_local) : env.placeVolume(modVol, tr_global * tr_local)); modPV.addPhysVolID("sector", sector_id) From 4bebfd3c1670493d4c27267c77b0864904dc2fab Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Mon, 3 Jun 2024 20:05:38 -0500 Subject: [PATCH 100/113] feat: update fieldmap to MARCO v.7.6.2.2.11 (#740) ### Briefly, what does this PR introduce? This updates the fieldmap to the May 2024 version at https://wiki.bnl.gov/EPIC/index.php?title=Experimental_Solenoid. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x] Changes have been communicated to collaborators @ShujieL ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, updated fieldmap will be used. --- compact/fields/marco.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/fields/marco.xml b/compact/fields/marco.xml index 931c8d7f1..ea395be74 100644 --- a/compact/fields/marco.xml +++ b/compact/fields/marco.xml @@ -4,8 +4,8 @@ <lccdd> <fields> <field type="epic_FieldMapB" name="GlobalSolenoid" field_type="magnetic" coord_type="BrBz" - field_map="fieldmaps/MARCO_v.6.4.1.1.3_1.7T_Magnetic_Field_Map_2022_11_14_rad_coords_cm_T.txt" - url="https://github.com/eic/epic-data/raw/64b7ca6306b138b7f000e696c82bd8f72db1da56/MARCO_v.6.4.1.1.3_1.7T_Magnetic_Field_Map_2022_11_14_rad_coords_cm_T.txt" + field_map="fieldmaps/MARCO_v.7.6.2.2.11_1.7T_Magnetic_Field_Map_2024_05_02_rad_coords_cm_T.BMap.txt" + url="https://github.com/eic/epic-data/raw/81182bfe32e62db3e3e2014e27decbb1f47f7a6a/MARCO_v.7.6.2.2.11_1.7T_Magnetic_Field_Map_2024_05_02_rad_coords_cm_T.BMap.txt" cache="$DETECTOR_PATH:/opt/detector" scale="1.0"> <dimensions> From 7fc37802736b81b3fc22ccefabc702c49dd050ad Mon Sep 17 00:00:00 2001 From: ShujieL <ShujieL@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:02:38 -0700 Subject: [PATCH 101/113] Update material map (#741) New material map for craterlake with updated service cones. See https://eicweb.phy.anl.gov/EIC/detectors/athena/-/issues/153#note_27320 ### Briefly, what does this PR introduce? Update material map for the new service cone ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [x ] Tests for the changes have been added - [ ] Documentation has been added / updated - [x ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? N/A ### Does this PR change default behavior? it should improve the EICrecon/ACTS tracking performance. --- compact/tracking/definitions_craterlake.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact/tracking/definitions_craterlake.xml b/compact/tracking/definitions_craterlake.xml index 6ab463102..1ad650f24 100644 --- a/compact/tracking/definitions_craterlake.xml +++ b/compact/tracking/definitions_craterlake.xml @@ -197,7 +197,7 @@ <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/materials-map.cbor"/> - <arg value="url:https://eicweb.phy.anl.gov/EIC/detectors/athena/uploads/6253bfcb92dd6bc236dd9a06084614ba/material-maps.cbor"/> + <arg value="url:https://eicweb.phy.anl.gov/EIC/detectors/athena/uploads/bcebb055b105ead42a4b72bee7533ab1/material-map-june.cbor"/> </plugin> </plugins> From df1c8ec2f5e0bda51fac38264b9cb9e1eb50db3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:07:13 -0230 Subject: [PATCH 102/113] build(deps): bump dawidd6/action-download-artifact from 3 to 5 (#745) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 3 to 5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dawidd6/action-download-artifact/releases">dawidd6/action-download-artifact's releases</a>.</em></p> <blockquote> <h2>v5</h2> <p><strong>Full Changelog</strong>: <a href="https://github.com/dawidd6/action-download-artifact/compare/v4...v5">https://github.com/dawidd6/action-download-artifact/compare/v4...v5</a></p> <h2>v4</h2> <h2>What's Changed</h2> <ul> <li><strong>VERSIONING CHANGE</strong>: now there will only be major releases of this action, e.g. v5, v6 and so on</li> <li>build(deps): bump undici from 5.28.3 to 5.28.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/284">dawidd6/action-download-artifact#284</a></li> <li>build(deps): bump <code>@actions/artifact</code> from 2.1.4 to 2.1.5 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/285">dawidd6/action-download-artifact#285</a></li> <li>build(deps): bump <code>@actions/artifact</code> from 2.1.5 to 2.1.7 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/287">dawidd6/action-download-artifact#287</a></li> <li>build(deps): bump adm-zip from 0.5.12 to 0.5.13 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/289">dawidd6/action-download-artifact#289</a></li> <li>Set allow_forks to false by default by <a href="https://github.com/timweri"><code>@timweri</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/290">dawidd6/action-download-artifact#290</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/timweri"><code>@timweri</code></a> made their first contribution in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/290">dawidd6/action-download-artifact#290</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/dawidd6/action-download-artifact/compare/v3...v4">https://github.com/dawidd6/action-download-artifact/compare/v3...v4</a></p> <h2>v3.1.4</h2> <h2>What's Changed</h2> <ul> <li>build(deps): bump adm-zip from 0.5.10 to 0.5.12 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/282">dawidd6/action-download-artifact#282</a></li> <li>build(deps): bump <code>@actions/artifact</code> from 2.1.2 to 2.1.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/280">dawidd6/action-download-artifact#280</a></li> <li>fix: accept expired artifacts with documentation url by <a href="https://github.com/wdconinc"><code>@wdconinc</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/283">dawidd6/action-download-artifact#283</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/wdconinc"><code>@wdconinc</code></a> made their first contribution in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/283">dawidd6/action-download-artifact#283</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/dawidd6/action-download-artifact/compare/v3...v3.1.4">https://github.com/dawidd6/action-download-artifact/compare/v3...v3.1.4</a></p> <h2>v3.1.3</h2> <h2>What's Changed</h2> <ul> <li>node_modules: upgrade by <a href="https://github.com/dawidd6"><code>@dawidd6</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/276">dawidd6/action-download-artifact#276</a></li> <li>build(deps): bump <code>@actions/artifact</code> from 2.1.1 to 2.1.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/277">dawidd6/action-download-artifact#277</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/dawidd6/action-download-artifact/compare/v3.1.2...v3.1.3">https://github.com/dawidd6/action-download-artifact/compare/v3.1.2...v3.1.3</a></p> <h2>v3.1.2</h2> <h2>What's Changed</h2> <ul> <li>Read workflow_search input as a boolean by <a href="https://github.com/klutchell"><code>@klutchell</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/273">dawidd6/action-download-artifact#273</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/klutchell"><code>@klutchell</code></a> made their first contribution in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/273">dawidd6/action-download-artifact#273</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/dawidd6/action-download-artifact/compare/v3.1.1...v3.1.2">https://github.com/dawidd6/action-download-artifact/compare/v3.1.1...v3.1.2</a></p> <h2>v3.1.1</h2> <h2>What's Changed</h2> <ul> <li>Head sha revert by <a href="https://github.com/romangg"><code>@romangg</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/271">dawidd6/action-download-artifact#271</a></li> <li>build(deps): bump undici from 5.28.2 to 5.28.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/dawidd6/action-download-artifact/pull/272">dawidd6/action-download-artifact#272</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/deb3bb83256a78589fef6a7b942e5f2573ad7c13"><code>deb3bb8</code></a> node_modules: upgrade</li> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/1d93f37db2a8005b41437c75a4793d52e664d858"><code>1d93f37</code></a> README: v4</li> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/854e2de9396304899dbe03bf9995fd73533190d1"><code>854e2de</code></a> Set allow_forks to false by default (<a href="https://redirect.github.com/dawidd6/action-download-artifact/issues/290">#290</a>)</li> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/436c9d3774019b3e2789d7332e9c4efdba3d9d79"><code>436c9d3</code></a> build(deps): bump adm-zip from 0.5.12 to 0.5.13 (<a href="https://redirect.github.com/dawidd6/action-download-artifact/issues/289">#289</a>)</li> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/14040524bb7e51dee9683e2e755e0d562621a1d5"><code>1404052</code></a> build(deps): bump <code>@actions/artifact</code> from 2.1.5 to 2.1.7 (<a href="https://redirect.github.com/dawidd6/action-download-artifact/issues/287">#287</a>)</li> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/8a9be734dc508dcf8d67c27ba3f727b0d682ccb0"><code>8a9be73</code></a> build(deps): bump <code>@actions/artifact</code> from 2.1.4 to 2.1.5 (<a href="https://redirect.github.com/dawidd6/action-download-artifact/issues/285">#285</a>)</li> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/df593bbd0462b45b479f042d043c3aa47fe1c483"><code>df593bb</code></a> build(deps): bump undici from 5.28.3 to 5.28.4 (<a href="https://redirect.github.com/dawidd6/action-download-artifact/issues/284">#284</a>)</li> <li>See full diff in <a href="https://github.com/dawidd6/action-download-artifact/compare/v3...v5">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/linux-eic-shell.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 0a1464361..19bd9b90d 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -693,7 +693,7 @@ jobs: if-no-files-found: error - name: Download previous artifact id: download_previous_artifact - uses: dawidd6/action-download-artifact@v3 + uses: dawidd6/action-download-artifact@v5 with: branch: ${{ github.event.pull_request.base.ref || github.ref_name }} path: ref/ @@ -753,7 +753,7 @@ jobs: if-no-files-found: error - name: Download previous artifact id: download_previous_artifact - uses: dawidd6/action-download-artifact@v3 + uses: dawidd6/action-download-artifact@v5 with: branch: ${{ github.event.pull_request.base.ref || github.ref_name }} path: ref/ From 83ac323e127b4b960da864a3cef59e99104e25e2 Mon Sep 17 00:00:00 2001 From: Sebouh Paul <sebouh.paul@gmail.com> Date: Tue, 11 Jun 2024 07:23:18 -0400 Subject: [PATCH 103/113] HcalEndcapPInsert: Replace Tungsten layers with Steel layers (#744) Use only steel absorbers (replace tungsten layers with steel) ### Briefly, what does this PR introduce? Changes the materials used in the calorimeter insert to use only steel layers for the aborbers, rather than using tungsten. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [X] Other: update to materials used in the detector ### Please check if this PR fulfills the following: - [X] Tests for the changes have been added - [X] Documentation has been added / updated - [X] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? This could cause issues with EICrecon, since the sampling fraction will need to be changed in the code. ### Does this PR change default behavior? Yes. --- compact/hcal/forward_insert.xml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/compact/hcal/forward_insert.xml b/compact/hcal/forward_insert.xml index 1c8037d44..49704b524 100644 --- a/compact/hcal/forward_insert.xml +++ b/compact/hcal/forward_insert.xml @@ -49,8 +49,7 @@ HcalEndcapPInsertAirThickness " /> <constant name="HcalEndcapPInsertBackplateThickness" value="HcalEndcapPInsertAbsorberThickness"/> - <constant name="HcalEndcapPInsertLayer_NTungstenRepeat" value="10"/> - <constant name="HcalEndcapPInsertLayer_NSteelRepeat" value="54"/> + <constant name="HcalEndcapPInsertLayer_NSteelRepeat" value="64"/> </define> <detectors> @@ -58,7 +57,7 @@ ### Forward (Positive Z) Endcap Insert for Hadronic Calorimeter Insert goes in the middle of the forward endcap HCal -- around the beampipe - Insert is 1 front layer of Steel/Sc, 10 layers of W/Sc, 54 layers of Steel/Sc + 1 backplate of steel + Insert is 1 front layer of Steel/Sc + 64 layers of Steel/Sc + 1 backplate of steel Each of the layers (sans backplate) includes air gaps (front and back of each layer), ESR foil (front and back of scintillator), a PCB, and an aluminum scitnillator cover @@ -84,7 +83,7 @@ <backplate thickness="HcalEndcapPInsertBackplateThickness"/> <comment> Front layer to match front walls of LFHCAL modules </comment> <comment> Slices will be ordered according to the slice order listed here </comment> - <layer repeat="1" thickness="HcalEndcapPInsertFrontLayerThickness" vis="InvisibleWithDaughters"> + <layer repeat="1" thickness="HcalEndcapPInsertFrontLayerThickness" vis="InvisibleWithDaughters"> <slice material="Steel235" thickness="LFHCAL_FrontWallThickness" vis="LFHCAL8MModVis" /> <slice material="Air" thickness="HcalEndcapPInsertAirThickness"/> <slice material="Aluminum" thickness="HcalEndcapPInsertScintillatorCoverThickness" vis="AnlProcess_Blue"/> @@ -94,17 +93,6 @@ <slice material="Fr4" thickness="HcalEndcapPInsertPCBThickness"/> <slice material="Air" thickness="HcalEndcapPInsertAirThickness"/> </layer> - <comment> Tungsten/Scintillator layers </comment> - <layer repeat="HcalEndcapPInsertLayer_NTungstenRepeat" thickness="HcalEndcapPInsertSingleLayerThickness" vis="InvisibleWithDaughters"> - <slice material="Tungsten" thickness="HcalEndcapPInsertAbsorberThickness" vis="LFHCAL4MModVis" /> - <slice material="Air" thickness="HcalEndcapPInsertAirThickness"/> - <slice material="Aluminum" thickness="HcalEndcapPInsertScintillatorCoverThickness" vis="AnlProcess_Blue"/> - <slice material="Polystyrene" thickness="HcalEndcapPInsertESRFoilThickness" vis="AnlGray"/> - <slice material="Polystyrene" thickness="HcalEndcapPInsertPolystyreneThickness" sensitive="true" limits="cal_limits" vis="AnlLightGray"/> - <slice material="Polystyrene" thickness="HcalEndcapPInsertESRFoilThickness" vis="AnlGray"/> - <slice material="Fr4" thickness="HcalEndcapPInsertPCBThickness"/> - <slice material="Air" thickness="HcalEndcapPInsertAirThickness"/> - </layer> <comment> Steel/Sc layers </comment> <layer repeat="HcalEndcapPInsertLayer_NSteelRepeat" thickness="HcalEndcapPInsertSingleLayerThickness" vis="InvisibleWithDaughters"> <slice material="Steel235" thickness="HcalEndcapPInsertAbsorberThickness" vis="LFHCAL8MModVis"/> From 8a9a3da2d542846b4c903858e0d2e317c96041fd Mon Sep 17 00:00:00 2001 From: lkosarz <42405623+lkosarz@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:37:37 -0400 Subject: [PATCH 104/113] nHCal fix rotated segmentation (#748) ### Briefly, what does this PR introduce? ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [x] Other: Fix rotated segmentation for backward HCal ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators Tests have been performed ### Does this PR introduce breaking changes? What changes might users need to make to their code? ### Does this PR change default behavior? --------- Signed-off-by: lkosarz <leszek.kosarzewski@gmail.com> Signed-off-by: Kosarzewski <kosarzewski.1@asc.ohio-state.edu> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> Co-authored-by: Kosarzewski <kosarzewski.1@asc.ohio-state.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- compact/hcal/backward.xml | 2 +- configurations/backward_hcal_only.yml | 4 ++++ src/PolyhedraEndcapCalorimeter2_geo.cpp | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 configurations/backward_hcal_only.yml diff --git a/compact/hcal/backward.xml b/compact/hcal/backward.xml index 2df2373cd..5f23ab662 100644 --- a/compact/hcal/backward.xml +++ b/compact/hcal/backward.xml @@ -20,7 +20,7 @@ </documentation> <constant name="HcalEndcapNSingleLayerThickness" - value="HcalEndcapNSteelThickness + HcalEndcapNPolystyreneThickness"/> + value="HcalEndcapNSteelThickness + HcalEndcapNPolystyreneThickness + HcalEndcapNLayerGap"/> <constant name="HcalEndcapNLayer_NRepeat" value="floor(HcalEndcapN_length / HcalEndcapNSingleLayerThickness)"/> <constant name="HcalEndcapN_thickness" value="HcalEndcapNLayer_NRepeat * HcalEndcapNSingleLayerThickness"/> </define> diff --git a/configurations/backward_hcal_only.yml b/configurations/backward_hcal_only.yml new file mode 100644 index 000000000..1e331c41b --- /dev/null +++ b/configurations/backward_hcal_only.yml @@ -0,0 +1,4 @@ +features: + hcal: + backward: + backward_endcap_flux: diff --git a/src/PolyhedraEndcapCalorimeter2_geo.cpp b/src/PolyhedraEndcapCalorimeter2_geo.cpp index 546b84278..c8cbc56c4 100644 --- a/src/PolyhedraEndcapCalorimeter2_geo.cpp +++ b/src/PolyhedraEndcapCalorimeter2_geo.cpp @@ -70,11 +70,12 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s string s_name = _toString(s_num, "slice%d"); double s_thick = x_slice.thickness(); Material s_mat = description.material(x_slice.materialStr()); - Volume s_vol(s_name, PolyhedraRegular(numsides, rmin, rmax, s_thick), s_mat); + Volume s_vol(s_name, PolyhedraRegular(numsides, M_PI / numsides, rmin, rmax, s_thick), s_mat); s_vol.setVisAttributes(description.visAttributes(x_slice.visStr())); sliceZ += s_thick / 2; - PlacedVolume s_phv = l_vol.placeVolume(s_vol, Position(0, 0, sliceZ)); + PlacedVolume s_phv = l_vol.placeVolume( + s_vol, Transform3D(RotationZYX(-M_PI / numsides, 0, 0), Position(0, 0, sliceZ))); s_phv.addPhysVolID("slice", s_num); if (x_slice.isSensitive()) { sens.setType("calorimeter"); From c899ff99ad8d78bc4056d005802e119bc8ecea4c Mon Sep 17 00:00:00 2001 From: billlee77 <wenliang.billlee@gmail.com> Date: Tue, 25 Jun 2024 09:10:01 -0400 Subject: [PATCH 105/113] Modified .cpp file and adding the parameter section to the xml file (#743) ### Briefly, what does this PR introduce? ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [ x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? Np --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/pid/pfrich.xml | 51 ++++++++++++++++++ src/PFRICH_geo.cpp | 120 +++++++++++++++++++++-------------------- 2 files changed, 113 insertions(+), 58 deletions(-) diff --git a/compact/pid/pfrich.xml b/compact/pid/pfrich.xml index cf5d085ae..22b03f443 100644 --- a/compact/pid/pfrich.xml +++ b/compact/pid/pfrich.xml @@ -38,6 +38,57 @@ <constant name="PFRICH_pixel_pitch" value="PFRICH_pixel_size + PFRICH_pixel_gap"/> <!-- center-to-center distance between SiPMs in a 8x8 panel --> <constant name="PFRICH_debug_optics" value="0"/> + +<!-- Flange --> +<constant name="FLANGE_EPIPE_DIAMETER" value="10.53*cm"/> +<constant name="FLANGE_HPIPE_DIAMETER" value="4.47*cm"/> +<constant name="FLANGE_HPIPE_OFFSET" value="6.76*cm"/> +<constant name="CLEARANCE" value="0.5*cm"/> + +<!-- Mirrors --> + +<constant name="CONICAL_MIRROR_INNER_RADIUS" value="12.0*cm"/> +<constant name="CONICAL_MIRROR_OUTER_RADIUS" value="57.0*cm"/> +<constant name="INNER_MIRROR_THICKNESS" value="0.1*cm"/> +<constant name="OUTER_MIRROR_THICKNESS" value="0.2*cm"/> + +<constant name="FIDUCIAL_VOLUME_LENGTH" value="49.1*cm"/> +<constant name="SENSOR_AREA_LENGTH" value="5*cm"/> +<constant name="HRPPD_CENTRAL_ROW_OFFSET" value="4.0*cm"/> +<constant name="HRPPD_WINDOW_THICKNESS" value="0.38*cm"/> +<constant name="HRPPD_CONTAINER_VOLUME_HEIGHT" value="3.2*cm"/> +<constant name="HRPPD_INSTALLATION_GAP" value="0.25*cm"/> + +<constant name="HRPPD_SUPPORT_GRID_BAR_HEIGHT" value="0.2*cm"/> + +<constant name="HRPPD_TILE_SIZE" value="12.0*cm"/> +<constant name="HRPPD_OPEN_AREA_SIZE" value="11.4*cm"/> +<constant name="HRPPD_ACTIVE_AREA_SIZE" value="10.8*cm"/> +<constant name="HRPPD_CERAMIC_BODY_THICKNESS" value="0.9*cm"/> +<constant name="HRPPD_BASEPLATE_THICKNESS" value="0.3*cm"/> +<constant name="HRPPD_PLATING_LAYER_THICKNESS" value="0.006*cm"/> +<constant name="EFFECTIVE_MCP_THICKNESS" value="2 * 0.06 * 0.3*cm"/> + +<constant name="READOUT_PCB_THICKNESS" value="0.2*cm"/> +<constant name="READOUT_PCB_SIZE" value="HRPPD_OPEN_AREA_SIZE - 0.2*cm"/> + +<constant name="ASIC_SIZE_XY" value="1.6*cm"/> +<constant name="ASIC_THICKNESS" value="0.1*cm"/> + +<!-- Aerogel --> + +<constant name="AEROGEL_INNER_WALL_THICKNESS" value="0.01"/> +<constant name="VESSEL_INNER_WALL_THICKNESS" value="0.29 * 2.54"/> +<constant name="VESSEL_OUTER_WALL_THICKNESS" value="0.54 * 2.54"/> +<constant name="VESSEL_OUTER_RADIUS" value="63.8"/> +<constant name="VESSEL_FRONT_SIDE_THICKNESS" value="0.29 * 2.54"/> +<constant name="FLANGE_CLEARANCE" value="0.5"/> +<constant name="BUILDING_BLOCK_CLEARANCE" value="0.1"/> +<constant name="AEROGEL_BAND_COUNT" value="3"/> +<constant name="AEROGEL_SEPARATOR_WALL_THICKNESS" value="0.05"/> +<constant name="AEROGEL_OUTER_WALL_THICKNESS" value="0.1"/> + +<!-- hardcoded constants --> </define> <detectors> diff --git a/src/PFRICH_geo.cpp b/src/PFRICH_geo.cpp index 1d2ee5613..8751e3125 100644 --- a/src/PFRICH_geo.cpp +++ b/src/PFRICH_geo.cpp @@ -152,12 +152,69 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se Cone mirror_cone(vesselLength / 2.0, vesselRmax1 - 7, vesselRmax1 - 7 + 0.3, vesselRmax1 - 13, vesselRmax1 - 13 + 0.3); - // flange + /*--------------------------------------------------*/ + // Flange + float _FLANGE_EPIPE_DIAMETER_ = description.constant<double>("FLANGE_EPIPE_DIAMETER"); + float _FLANGE_HPIPE_DIAMETER_ = description.constant<double>("FLANGE_HPIPE_DIAMETER"); + float _FLANGE_HPIPE_OFFSET_ = description.constant<double>("FLANGE_HPIPE_OFFSET"); + double clearance = description.constant<double>("CLEARANCE"); + + // Mirrors + float _CONICAL_MIRROR_INNER_RADIUS_ = description.constant<double>("CONICAL_MIRROR_INNER_RADIUS"); + float _CONICAL_MIRROR_OUTER_RADIUS_ = description.constant<double>("CONICAL_MIRROR_OUTER_RADIUS"); + float _INNER_MIRROR_THICKNESS_ = description.constant<double>("INNER_MIRROR_THICKNESS"); + float _OUTER_MIRROR_THICKNESS_ = description.constant<double>("OUTER_MIRROR_THICKNESS"); - float _FLANGE_EPIPE_DIAMETER_ = 10.53; // in cm - float _FLANGE_HPIPE_DIAMETER_ = 4.47; // in cm - float _FLANGE_HPIPE_OFFSET_ = 6.76; // in cm - float clearance = 0.5; // in cm + // HRPPD + float _FIDUCIAL_VOLUME_LENGTH_ = description.constant<double>("FIDUCIAL_VOLUME_LENGTH"); + float _SENSOR_AREA_LENGTH_ = description.constant<double>("SENSOR_AREA_LENGTH"); + float _HRPPD_CENTRAL_ROW_OFFSET_ = description.constant<double>("HRPPD_CENTRAL_ROW_OFFSET"); + float _HRPPD_WINDOW_THICKNESS_ = description.constant<double>("HRPPD_WINDOW_THICKNESS"); + float _HRPPD_CONTAINER_VOLUME_HEIGHT_ = + description.constant<double>("HRPPD_CONTAINER_VOLUME_HEIGHT"); + float _HRPPD_INSTALLATION_GAP_ = description.constant<double>("HRPPD_INSTALLATION_GAP"); + + float _HRPPD_SUPPORT_GRID_BAR_HEIGHT_ = + description.constant<double>("HRPPD_SUPPORT_GRID_BAR_HEIGHT"); + + float _HRPPD_TILE_SIZE_ = description.constant<double>("HRPPD_TILE_SIZE"); + float _HRPPD_OPEN_AREA_SIZE_ = description.constant<double>("HRPPD_OPEN_AREA_SIZE"); + float _HRPPD_ACTIVE_AREA_SIZE_ = description.constant<double>("HRPPD_ACTIVE_AREA_SIZE"); + float _HRPPD_CERAMIC_BODY_THICKNESS_ = + description.constant<double>("HRPPD_CERAMIC_BODY_THICKNESS"); + float _HRPPD_BASEPLATE_THICKNESS_ = description.constant<double>("HRPPD_BASEPLATE_THICKNESS"); + float _HRPPD_PLATING_LAYER_THICKNESS_ = + description.constant<double>("HRPPD_PLATING_LAYER_THICKNESS"); + float _EFFECTIVE_MCP_THICKNESS_ = description.constant<double>("EFFECTIVE_MCP_THICKNESS"); + + float _READOUT_PCB_THICKNESS_ = description.constant<double>("READOUT_PCB_THICKNESS"); + float _READOUT_PCB_SIZE_ = description.constant<double>("READOUT_PCB_SIZE"); + + float _ASIC_SIZE_XY_ = description.constant<double>("ASIC_SIZE_XY"); + float _ASIC_THICKNESS_ = description.constant<double>("ASIC_THICKNESS"); + + // Aerogel + float _AEROGEL_INNER_WALL_THICKNESS_ = + description.constant<double>("AEROGEL_INNER_WALL_THICKNESS"); + float _VESSEL_INNER_WALL_THICKNESS_ = description.constant<double>("VESSEL_INNER_WALL_THICKNESS"); + float _VESSEL_OUTER_WALL_THICKNESS_ = description.constant<double>("VESSEL_OUTER_WALL_THICKNESS"); + float _VESSEL_OUTER_RADIUS_ = description.constant<double>("VESSEL_OUTER_RADIUS"); + double _VESSEL_FRONT_SIDE_THICKNESS_ = + description.constant<double>("VESSEL_FRONT_SIDE_THICKNESS"); + float _FLANGE_CLEARANCE_ = description.constant<double>("FLANGE_CLEARANCE"); + float _BUILDING_BLOCK_CLEARANCE_ = description.constant<double>("BUILDING_BLOCK_CLEARANCE"); + //float _AEROGEL_BAND_COUNT_ = aerogel_band_count; + float _AEROGEL_SEPARATOR_WALL_THICKNESS_ = + description.constant<double>("AEROGEL_SEPARATOR_WALL_THICKNESS"); + float _AEROGEL_OUTER_WALL_THICKNESS_ = + description.constant<double>("AEROGEL_OUTER_WALL_THICKNESS"); + + double m_gas_volume_length = + _FIDUCIAL_VOLUME_LENGTH_ - _VESSEL_FRONT_SIDE_THICKNESS_ - _SENSOR_AREA_LENGTH_; + double m_gas_volume_radius = _VESSEL_OUTER_RADIUS_ - _VESSEL_OUTER_WALL_THICKNESS_; + + //cout << "FLANGE_EPIPE_DIAMETER : " << _FLANGE_EPIPE_DIAMETER_ << endl; + //cout << "CONICAL_MIRROR_INNER_RADIUS : " << _CONICAL_MIRROR_INNER_RADIUS_ << endl; /// Inner mirror cone // A wedge bridging two cylinders; @@ -261,36 +318,6 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se // -- Mirrors --------------------------------------------------------------------------------- // Some "standard" value applied to all mirrors; // At the downstream (sensor plane) location; upstream radii are calculated automatically; - double _CONICAL_MIRROR_INNER_RADIUS_ = 12.0; - double _CONICAL_MIRROR_OUTER_RADIUS_ = 57.0; - - double _INNER_MIRROR_THICKNESS_ = 0.1; //0.29*_INCH - double _OUTER_MIRROR_THICKNESS_ = 0.2; //0.54*_INCH - - /// Detailed sensor description - - double _FIDUCIAL_VOLUME_LENGTH_ = 49.1; // cm - double _SENSOR_AREA_LENGTH_ = 5; // cm - double _HRPPD_CENTRAL_ROW_OFFSET_ = 4.0; // cm - double _HRPPD_WINDOW_THICKNESS_ = 0.38; // cm - double _HRPPD_CONTAINER_VOLUME_HEIGHT_ = 3.2; // cm - double _HRPPD_INSTALLATION_GAP_ = 0.25; // cm - - double _HRPPD_SUPPORT_GRID_BAR_HEIGHT_ = 0.2; - - double _HRPPD_TILE_SIZE_ = 12.0; // cm - double _HRPPD_OPEN_AREA_SIZE_ = 11.4; // cm - double _HRPPD_ACTIVE_AREA_SIZE_ = 10.8; // cm - double _HRPPD_CERAMIC_BODY_THICKNESS_ = 0.9; // cm - double _HRPPD_BASEPLATE_THICKNESS_ = 0.3; // cm - double _HRPPD_PLATING_LAYER_THICKNESS_ = 0.006; // cm - double _EFFECTIVE_MCP_THICKNESS_ = 2 * 0.06 * 0.3; // cm - - double _READOUT_PCB_THICKNESS_ = 0.2; - double _READOUT_PCB_SIZE_ = _HRPPD_OPEN_AREA_SIZE_ - 0.2; - - double _ASIC_SIZE_XY_ = 1.6; - double _ASIC_THICKNESS_ = 0.1; double xysize = _HRPPD_TILE_SIZE_, wndthick = _HRPPD_WINDOW_THICKNESS_; @@ -494,30 +521,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se /// Aerogel - float _AEROGEL_INNER_WALL_THICKNESS_ = 0.01; - - float _VESSEL_INNER_WALL_THICKNESS_ = 0.29 * 2.54; - - float _VESSEL_OUTER_WALL_THICKNESS_ = 0.54 * 2.54; - ; - - float _VESSEL_OUTER_RADIUS_ = 63.8; - - double _VESSEL_FRONT_SIDE_THICKNESS_ = 0.29 * 2.54; - - double m_gas_volume_length = - _FIDUCIAL_VOLUME_LENGTH_ - _VESSEL_FRONT_SIDE_THICKNESS_ - _SENSOR_AREA_LENGTH_; - double m_gas_volume_radius = _VESSEL_OUTER_RADIUS_ - _VESSEL_OUTER_WALL_THICKNESS_; - - float _FLANGE_CLEARANCE_ = 0.5; - float _BUILDING_BLOCK_CLEARANCE_ = 0.1; - const int _AEROGEL_BAND_COUNT_ = 3; - - float _AEROGEL_SEPARATOR_WALL_THICKNESS_ = 0.05; - - float _AEROGEL_OUTER_WALL_THICKNESS_ = 0.1; - float m_r0min = _FLANGE_EPIPE_DIAMETER_ / 2 + _FLANGE_CLEARANCE_ + _VESSEL_INNER_WALL_THICKNESS_ + _BUILDING_BLOCK_CLEARANCE_; float m_r0max = m_gas_volume_radius - _BUILDING_BLOCK_CLEARANCE_; From e65f98476851c9946dfb056baca4e59732443ab7 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Mon, 1 Jul 2024 23:57:00 -0400 Subject: [PATCH 106/113] linux-eic-shell.yml: trigger eicweb with PR merge sha instead of HEAD (#751) --- .github/workflows/linux-eic-shell.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 19bd9b90d..778c7f654 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -140,7 +140,7 @@ jobs: DETECTOR_REPOSITORYURL=${{ github.server_url }}/${{ github.repository }} DETECTOR_REPOSITORYREF=${{ github.ref }} DETECTOR_CONFIG=${{ needs.list-detector-configs.outputs.configs_csv }} - DETECTOR_VERSION=${{ github.event.pull_request.head.ref || github.ref_name }} + DETECTOR_VERSION=${{ github.sha }} GITHUB_REPOSITORY=${{ github.repository }} GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }} GITHUB_PR=${{ github.event.pull_request.number }} @@ -545,11 +545,11 @@ jobs: variables: | DETECTOR=epic DETECTOR_REPOSITORYURL=${{ github.server_url }}/${{ github.repository }} - DETECTOR_VERSION=${{ github.event.pull_request.head.ref || github.ref_name }} + DETECTOR_VERSION=${{ github.sha }} DETECTOR_CONFIG=${{ matrix.detector_config }} GITHUB_REPOSITORY=${{ github.repository }} GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }} - PIPELINE_NAME=${{ github.event.pull_request.title || github.sha }} + PIPELINE_NAME=${{ github.event.pull_request.title || github.ref_name }} - run: | gh api \ --method POST \ From 41bb6e05241702813c7cffd666de4fbfe297ff08 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Wed, 10 Jul 2024 17:20:03 -0400 Subject: [PATCH 107/113] calibrations.xml: update pfRICH LUT (#752) ### Briefly, what does this PR introduce? This incorporates https://github.com/eic/epic-data/pull/21 ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --- compact/calibrations.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact/calibrations.xml b/compact/calibrations.xml index 724d7b239..a6abaca26 100644 --- a/compact/calibrations.xml +++ b/compact/calibrations.xml @@ -32,7 +32,7 @@ <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> <arg value="file:calibrations/pfrich.lut"/> - <arg value="url:https://raw.githubusercontent.com/eic/epic-data/f83bf74a79ba4cc71b459a65ba48d3a68deb0ae3/pfrich.lut"/> + <arg value="url:https://raw.githubusercontent.com/eic/epic-data/f51abca78db0e5dd8460184353b0ce00ba4b3a19/pfrich.lut"/> </plugin> <plugin name="epic_FileLoader"> <arg value="cache:$DETECTOR_PATH:/opt/detector"/> From 0e9f41be4dceb294a2fe4407afe92e6ebc0db0d4 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Wed, 17 Jul 2024 21:11:49 -0400 Subject: [PATCH 108/113] FileLoaderHelper: avoid supplying non-existent paths for fs::equivalent (#753) ### Briefly, what does this PR introduce? This avoids triggering an exception every time path is updated: ``` cppyy.gbl.std.runtime_error: void dd4hep::sim::Geant4Kernel::loadGeometry(const string& compact_file) => runtime_error: filesystem error: in equivalent: Operation not supported ["calibrations/pfrich.lut"] ["calibrations/17a7536e11d8bc3f"] ``` ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --- src/FileLoaderHelper.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/FileLoaderHelper.h b/src/FileLoaderHelper.h index 5680febc0..6987d21a3 100644 --- a/src/FileLoaderHelper.h +++ b/src/FileLoaderHelper.h @@ -70,7 +70,7 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri // if file exists and is symlink to correct hash fs::path hash_path(parent_path / hash); - if (fs::exists(file_path) && fs::equivalent(file_path, hash_path)) { + if (fs::exists(file_path) && fs::exists(hash_path) && fs::equivalent(file_path, hash_path)) { printout(INFO, "FileLoader", "link " + file + " -> hash " + hash + " already exists"); return; } @@ -151,7 +151,8 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri // file already exists if (fs::is_symlink(file_path)) { // file is symlink - if (fs::equivalent(hash_path, fs::read_symlink(file_path))) { + fs::path symlink_target = fs::read_symlink(file_path); + if (fs::exists(symlink_target) && fs::equivalent(hash_path, symlink_target)) { // link points to correct path return; } else { From 215474bd44873deda7feb61997caf354e8d3a670 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Thu, 18 Jul 2024 15:54:53 -0400 Subject: [PATCH 109/113] FileLoaderHelper: reduce printout verbosity (#755) ### Briefly, what does this PR introduce? Removes lengthy output like ``` FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/repos/eic/packages/root FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/repos/eic/packages/geant4 FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/repos/eic/packages/podio FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/repos/eic/packages/dd4hep FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/repos/eic/packages/epic FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/repos/eic/packages/hepmc3 FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/archived-files FileLoader INFO checking /opt/detector/epic-24.04.0/.spack/epic/archived-files/spack-build-xozo5y2 ``` ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --- src/FileLoaderHelper.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FileLoaderHelper.h b/src/FileLoaderHelper.h index 6987d21a3..0563881aa 100644 --- a/src/FileLoaderHelper.h +++ b/src/FileLoaderHelper.h @@ -18,7 +18,7 @@ namespace fs = std::filesystem; -using dd4hep::ERROR, dd4hep::WARNING, dd4hep::INFO; +using dd4hep::ERROR, dd4hep::WARNING, dd4hep::VERBOSE, dd4hep::INFO; using dd4hep::printout; namespace FileLoaderHelper { @@ -89,11 +89,11 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri printout(INFO, "FileLoader", "cache " + cache_path.string()); if (fs::exists(cache_path)) { auto check_path = [&](const fs::path& cache_dir_path) { - printout(INFO, "FileLoader", "checking " + cache_dir_path.string()); + printout(VERBOSE, "FileLoader", "checking " + cache_dir_path.string()); fs::path cache_hash_path = cache_dir_path / hash; if (fs::exists(cache_hash_path)) { // symlink hash to cache/.../hash - printout(INFO, "FileLoader", + printout(VERBOSE, "FileLoader", "file " + file + " with hash " + hash + " found in " + cache_hash_path.string()); fs::path link_target; From 3c3c5d59e7a1938ce1141d8505e8e65d34999b3b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Fri, 19 Jul 2024 21:43:24 -0400 Subject: [PATCH 110/113] EEEMCal: reparametrize inner collar in terms of proton ring x offest (#742) Implements implicit suggestion from https://github.com/eic/epic/pull/704#discussion_r1625108217 --- compact/ecal/backward_PbWO4.xml | 2 +- src/HomogeneousCalorimeter_geo.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compact/ecal/backward_PbWO4.xml b/compact/ecal/backward_PbWO4.xml index 636440545..ad371a013 100644 --- a/compact/ecal/backward_PbWO4.xml +++ b/compact/ecal/backward_PbWO4.xml @@ -103,9 +103,9 @@ electron_rmax="73 * mm" proton_rmin="35 * mm" proton_rmax="43 * mm" - straight_section_tilt="62.05 * deg" z_length="EcalEndcapN_inner_support_length" x_offset="-1 * mm" + proton_x_offset="64 * mm" material="Copper" vis="AnlOrange" /> diff --git a/src/HomogeneousCalorimeter_geo.cpp b/src/HomogeneousCalorimeter_geo.cpp index e24ceeae8..ea3f69f35 100644 --- a/src/HomogeneousCalorimeter_geo.cpp +++ b/src/HomogeneousCalorimeter_geo.cpp @@ -45,15 +45,15 @@ static Volume inner_support_collar(Detector& desc, xml_comp_t handle) { Material inner_ring_material = desc.material(handle.materialStr()); - double electron_rmin = handle.attr<double>(_Unicode(electron_rmin)); - double electron_rmax = handle.attr<double>(_Unicode(electron_rmax)); - double proton_rmin = handle.attr<double>(_Unicode(proton_rmin)); - double proton_rmax = handle.attr<double>(_Unicode(proton_rmax)); - double straight_section_tilt = handle.attr<double>(_Unicode(straight_section_tilt)); - double z_length = handle.z_length(); - - double proton_x_offset = ((electron_rmax + electron_rmin) - (proton_rmax + proton_rmin)) / 2 / - cos(straight_section_tilt); + double electron_rmin = handle.attr<double>(_Unicode(electron_rmin)); + double electron_rmax = handle.attr<double>(_Unicode(electron_rmax)); + double proton_rmin = handle.attr<double>(_Unicode(proton_rmin)); + double proton_rmax = handle.attr<double>(_Unicode(proton_rmax)); + double proton_x_offset = handle.attr<double>(_Unicode(proton_x_offset)); + double z_length = handle.z_length(); + + double straight_section_tilt = + acos(((electron_rmax + electron_rmin) - (proton_rmax + proton_rmin)) / 2 / proton_x_offset); double mean_radius = (electron_rmax + electron_rmin + proton_rmax + proton_rmin) / 4; Position straight_section_offset{ proton_x_offset / 2 + cos(straight_section_tilt) * mean_radius, From a940d330d321f53b34c36a8983f976f1d0b913a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 21:44:52 -0400 Subject: [PATCH 111/113] [pre-commit.ci] pre-commit autoupdate (#746) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <!--pre-commit.ci start--> updates: - [github.com/pre-commit/mirrors-clang-format: v18.1.5 → v18.1.8](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.5...v18.1.8) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ee3808cc..1973d0409 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.5 + rev: v18.1.8 hooks: - id: clang-format - repo: https://github.com/Lucas-C/pre-commit-hooks From 292e12d2c07c6590de3369c37c40c5e853984abe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:51:37 -0500 Subject: [PATCH 112/113] build(deps): bump dawidd6/action-download-artifact from 5 to 6 (#747) Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 5 to 6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dawidd6/action-download-artifact/releases">dawidd6/action-download-artifact's releases</a>.</em></p> <blockquote> <h2>v6</h2> <p><strong>Full Changelog</strong>: <a href="https://github.com/dawidd6/action-download-artifact/compare/v5...v6">https://github.com/dawidd6/action-download-artifact/compare/v5...v6</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/bf251b5aa9c2f7eeb574a96ee720e24f801b7c11"><code>bf251b5</code></a> node_modules: upgrade</li> <li><a href="https://github.com/dawidd6/action-download-artifact/commit/93c629661111aae296c04004b30ae3ba22ed46f3"><code>93c6296</code></a> README: v5</li> <li>See full diff in <a href="https://github.com/dawidd6/action-download-artifact/compare/v5...v6">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> --- .github/workflows/linux-eic-shell.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 778c7f654..8d5ec5220 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -693,7 +693,7 @@ jobs: if-no-files-found: error - name: Download previous artifact id: download_previous_artifact - uses: dawidd6/action-download-artifact@v5 + uses: dawidd6/action-download-artifact@v6 with: branch: ${{ github.event.pull_request.base.ref || github.ref_name }} path: ref/ @@ -753,7 +753,7 @@ jobs: if-no-files-found: error - name: Download previous artifact id: download_previous_artifact - uses: dawidd6/action-download-artifact@v5 + uses: dawidd6/action-download-artifact@v6 with: branch: ${{ github.event.pull_request.base.ref || github.ref_name }} path: ref/ From 50bc89bab17de2a954d9acfff957b279aede4889 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com> Date: Tue, 23 Jul 2024 17:03:49 -0400 Subject: [PATCH 113/113] cmake: set CMAKE_PROJECT_VERSION from git, add it back to thisepic.sh (#758) ### Briefly, what does this PR introduce? This uses same code as in EICrecon. This partially undoes of #733, geometry version is useful. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No ### Does this PR change default behavior? No --------- Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> --- CMakeLists.txt | 18 ++++++++++++------ cmake/git_version.cmake | 29 +++++++++++++++++++++++++++++ templates/epic.xml.jinja2 | 1 + templates/thisepic.sh.in | 1 + templates/version.xml.in | 4 ++++ 5 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 cmake/git_version.cmake create mode 100644 templates/version.xml.in diff --git a/CMakeLists.txt b/CMakeLists.txt index fa06a7105..49e5778d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ PROJECT(epic DESCRIPTION "DD4hep Geometry Description of the EPIC Experiment" ) +# Set version based on git +include(cmake/git_version.cmake) +set_git_version(CMAKE_PROJECT_VERSION) + # C++ standard set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17 CACHE STRING "Set the C++ standard to be used") @@ -101,14 +105,16 @@ install(DIRECTORY calibrations/ ) #----------------------------------------------------------------------------------- -# Configure and install detector setup script +# Configure and install compact/version.xml # -execute_process( - COMMAND git rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE +configure_file(templates/version.xml.in ${CMAKE_CURRENT_BINARY_DIR}/version.xml @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.xml + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/compact ) + +#----------------------------------------------------------------------------------- +# Configure and install detector setup script +# configure_file(templates/thisepic.sh.in ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/cmake/git_version.cmake b/cmake/git_version.cmake new file mode 100644 index 000000000..98e013cfe --- /dev/null +++ b/cmake/git_version.cmake @@ -0,0 +1,29 @@ +# Determine version from git describe cmake-lint: disable=C0103 +macro(set_git_version VERSION) + if(NOT Git_Found) + find_package(Git) + endif() + + if(GIT_EXECUTABLE) + # Generate a git-describe version string from Git repository tags + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tags --dirty --match "v*" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_DESCRIBE_VERSION + RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT GIT_DESCRIBE_ERROR_CODE) + set(${VERSION} ${GIT_DESCRIBE_VERSION}) + endif() + endif() + + # Final fallback: Just use a bogus version string that is semantically older + # than anything else and spit out a warning to the developer. + if(NOT DEFINED ${VERSION}) + set(${VERSION} v0.0.0-unknown) + message( + WARNING + "Failed to determine VERSION from Git tags. Using default version \"${${VERSION}}\"." + ) + endif() +endmacro() diff --git a/templates/epic.xml.jinja2 b/templates/epic.xml.jinja2 index ad376206d..0472526f2 100644 --- a/templates/epic.xml.jinja2 +++ b/templates/epic.xml.jinja2 @@ -48,6 +48,7 @@ <include ref="${DETECTOR_PATH}/compact/far_forward/definitions.xml" /> <include ref="${DETECTOR_PATH}/compact/far_backward/definitions.xml" /> <include ref="${DETECTOR_PATH}/compact/definitions.xml" /> + <include ref="${DETECTOR_PATH}/compact/version.xml"/> <include ref="${DD4hepINSTALL}/DDDetectors/compact/detector_types.xml"/> </define> diff --git a/templates/thisepic.sh.in b/templates/thisepic.sh.in index 9a6013f05..f3ef9fde5 100644 --- a/templates/thisepic.sh.in +++ b/templates/thisepic.sh.in @@ -3,6 +3,7 @@ export DETECTOR=@PROJECT_NAME@ export DETECTOR_PATH=@CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@ export DETECTOR_CONFIG=${1:-@PROJECT_NAME@} +export DETECTOR_VERSION=@CMAKE_PROJECT_VERSION@ ## Warn is not the right name (this script is sourced, hence $1) if [[ "$(basename ${BASH_SOURCE[0]})" != "thisepic.sh" ]]; then diff --git a/templates/version.xml.in b/templates/version.xml.in new file mode 100644 index 000000000..6398540f7 --- /dev/null +++ b/templates/version.xml.in @@ -0,0 +1,4 @@ +<!-- SPDX-License-Identifier: LGPL-3.0-or-later --> +<!-- Copyright (C) 2024 Dmitry Kalinkin --> + + <constant name="epic_version" value="@CMAKE_PROJECT_VERSION@" />