Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 24-optimize-barrel-em-calo-geometry
  • 18-make-ecal-blue
  • new_runner
  • geo_test
  • master
  • view_test
  • bigger_solenoid
  • vertex_tracker_radius
  • move_rich
  • rp_overlap
  • rich_optimize
  • acts_v4
  • tracker2
  • beampipe_overlap
  • rich_test
  • no_rich_hcal
  • dawnfix
  • ecal_radius
  • v0.0.1
  • v0.0.2
20 results

Target

Select target project
No results found
Select Git revision
  • master
  • no_rich_hcal
  • dawnfix
  • ecal_radius
4 results
Show changes

Commits on Source 51

63 files
+ 4581
1287
Compare changes
  • Side-by-side
  • Inline

Files

+135 −112
Original line number Diff line number Diff line
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 == "master"'
    - if: '$CI_COMMIT_TAG'

default:
  before_script:
    - mkdir -p images && mkdir -p doc/
    - git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git && ln -s accelerator/eic 
    - mkdir build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install  && cd ..
    - source .local/bin/env.sh
  artifacts:
    expire_in: 72 hours 
    paths:
      - images/
      - doc/
      - .local/detector
      - .local/lib
      - .local/bin
      - .local/include
      - .local/share
      - results
      - config
      - images
      - doc
      - juggler.env
    reports:
      dotenv: juggler.env

stages:
  - config
  - initialize
  - build
  - docs
  - test 
  - collect
  - finalize 
  - deploy

compile:
  stage: build
  tags:
    - silicon
  script:
    - echo "Build successful."
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:
    - export JUGGLER_DETECTOR="topside"
    - |
      if [[ "x${CI_PIPELINE_SOURCE}" == "xmerge_request_event"  || "$CI_COMMIT_BRANCH" == "master" ]]; then
        export JUGGLER_DETECTOR_VERSION="${CI_COMMIT_REF_NAME}"
        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
      fi
    - source setup/bin/env.sh && ./setup/bin/install_common.sh

common:detector:
  stage: initialize
  needs: ["common:setup"]
  script:
    - source .local/bin/env.sh && build_detector.sh
    - mkdir_local_data_link sim_output
    - mkdir -p results
    - mkdir -p config
    - print_env.sh

.views:
  stage: docs
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - ["compile"]
  tags:
    - silicon
  artifacts:
    paths:
      - images/
      - doc/
    - ["common:detector"]

dawn_view1:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view1 -d scripts/view1 -D
dawn_view1:ev1:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view1_ev1 -d scripts/view1 -s 2
dawn_view2:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view2 -d scripts/view2 -D
dawn_view2:ev1:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view2_ev1 -d scripts/view2 -s 2
dawn_view3:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view3 -d scripts/view3 -D
dawn_view3:ev1:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view3_ev1 -d scripts/view3 -s 2
dawn_view3:ev3:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view3_ev1 -d scripts/view3 -s 3
dawn_view3:ev4:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view3_ev1 -d scripts/view3 -s 4
dawn_view11:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view11 -d scripts/view11 -D
dawn_view12:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view12 -d scripts/view12 -D
dawn_view13:detector:
  extends: .views
include:
  - 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/config.yml'
    #

dump_constants:
  stage: test
  needs: 
    - ["common:detector"]
  script:
    - ./bin/make_dawn_views -t view13 -d scripts/view13 -D
dawn_view14:detector:
  extends: .views
    - npdet_info dump ${DETECTOR_PATH}/topside.xml  | tee doc/constants.out 

dump_geometry:
  stage: test
  needs: 
    - ["common:detector"]
  script:
    - ./bin/make_dawn_views -t view14 -d scripts/view14 -D
    - echo "dumping geometry to images"
    - mkdir -p images
    - dd_web_display --output images/detector_geo.root ${DETECTOR_PATH}/topside.xml


report:
  stage: test
  stage: finalize
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs: 
    - "dawn_view1:detector"
    - "dawn_view2:detector"
    - "dawn_view3:detector"
    - "dawn_view1:ev1"
    - "dawn_view2:ev1"
    - "dawn_view3:ev1"
    - "dawn_view11:detector"
    - "dawn_view12:detector"
    - "dawn_view13:detector"
    - "dawn_view14:detector"
  tags:
    - silicon
    - view_01
    - view_02
    - view_03
    - view_06
    - view_07
    - view_11
    - view_12
    - view_13
    - view_14
    - view_15
    - dump_constants
    - dump_geometry
  artifacts:
    paths:
      - images/
      - doc/
  script:
    - pip3 install jinja2 &&  ls -lrth
    - ./bin/make_images > doc/dawn_views.md
    - ./bin/make_images 


overlap_check:
  stage: test
  tags:
    - silicon
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs: 
    - ["compile"]
    - ["common:detector"]
  script:
    #- $(exit $(checkOverlaps -c topside.xml  | tee doc/overlap_check.out | wc -l ))
    - checkOverlaps -c topside.xml  | tee doc/overlap_check.out | wc -l
    - cat doc/overlap_check.out
  allow_failure: true

    - checkOverlaps -c ${DETECTOR_PATH}/topside.xml  | tee doc/overlap_check.out 
    - echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
    - if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi

topside:config_testing:
  stage: test
  tags:
    - silicon
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs: 
    - ["compile"]
    - ["common:detector"]
  script:
    #- $(exit $(checkOverlaps -c topside.xml  | tee doc/overlap_check.out | wc -l ))
    - checkOverlaps -c topside.xml  | tee doc/overlap_check.out | wc -l
    - checkOverlaps -c ${DETECTOR_PATH}/topside.xml  | tee doc/overlap_check.out | wc -l
    - cat doc/overlap_check.out
  allow_failure: true

benchmarks:reconstruction:

benchmarks:detector:
  stage: deploy
  trigger:
    project: EIC/benchmarks/reconstruction_benchmarks
  needs: ["overlap_check","report"]
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      when: never
    - if: '$CI_COMMIT_BRANCH != "master"'
      when: never
    - when: on_success
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  variables:
    JUGGLER_DETECTOR: "$JUGGLER_DETECTOR"
    JUGGLER_DETECTOR_VERSION: "$JUGGLER_DETECTOR_VERSION"
  trigger:
    project: EIC/benchmarks/detector_benchmarks
    strategy: depend
  needs: ["common:detector","overlap_check","report"]


benchmarks:physics:
  stage: deploy
  trigger:
    project: EIC/benchmarks/physics_benchmarks
  needs: ["overlap_check","report"]
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      when: never
    - if: '$CI_COMMIT_BRANCH != "master"'
      when: never
    - when: on_success
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache

pages:
  image: eicweb.phy.anl.gov:4567/containers/eic_container/node:15.12
  rules:
    - if: '$CI_SERVER_HOST != "eicweb.phy.anl.gov"'
  cache:
    paths:
      - node_modules/
  before_script:
    - ls -lrth
  script:
    - mkdir public && cp doc/main.html public/index.html && cp doc/*.html public/.
  artifacts:
    paths:
      - public
+11 −301
Original line number Diff line number Diff line
@@ -16,15 +16,20 @@ Quick start

[Browse latest](https://eicweb.phy.anl.gov/EIC/detectors/topside/-/jobs/artifacts/master/browse/images?job=report)

<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1.png?job=report" width="600px" />
[Detector views](views/detector_views.md)


<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view01.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view01.png?job=report" width="600px" />
</a>
<br \>

<br />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2a.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2a.png?job=report" width="400px" />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view02a.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view02a.png?job=report" width="400px" />
</a>
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2e.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2e.png?job=report" width="400px" />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view02e.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view02e.png?job=report" width="400px" />
</a>
<br />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11.pdf?job=report">
@@ -108,303 +113,8 @@ Done.

Looking at the detector 

https://ma.ttias.be/socks-proxy-linux-ssh-bypass-content-filters/




### TOPSiDE views


<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11a.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0050.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0100.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0150.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0200.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0250.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0300.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0350.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0400.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0450.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0500.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0550.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0600.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0650.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0700.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0750.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0800.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0850.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0900.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0950.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1000.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1050.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1100.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1150.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1200.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1250.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1300.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1350.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1400.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1450.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1500.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1550.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1600.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1650.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1700.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1750.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1800.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1850.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1900.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1950.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a2000.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view13b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0150.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0200.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0250.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0300.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0350.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0400.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0450.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0500.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0550.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0600.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0650.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0700.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0750.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0800.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0850.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0900.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a0950.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1000.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1050.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1100.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1150.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1200.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1250.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1300.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1350.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1400.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1450.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1500.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1550.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1600.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1650.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1700.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1750.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1800.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1850.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1900.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a1950.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14a2000.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view14b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1_ev1.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2a.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2c.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2d.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2e.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1a.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1c.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1d.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1e.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view3.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view3_ev1.png?job=report" width="400px" />
<br \>

+15 −7
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ export DAWN_PS_PREVIEWER="ls"
OUT_FILE=".DAWN_1.history"

function print_the_help {
  echo "USAGE: ${0} [-s <skip_events>] -d <dawn_run_dir> "
  echo "USAGE: ${0}  -d <dawn_run_dir> "
  echo "  OPTIONS: "
  echo "            -x         targeted x coordinate position"
  echo "            -y         targeted x coordinate position"
@@ -14,6 +14,7 @@ function print_the_help {
  echo "            --theta    viewing angle"
  echo "            --phi      viewing angle"
  echo "            -m,--mag   magnification"
  echo "            --draw     draw style "
  echo "            -d,--dawn-dir <dawn_run_dir>  Directory with the .DAWN files and a generate script "
  exit 
}
@@ -91,6 +92,13 @@ do
      shift # past argument
      shift # past value
      ;;
    --draw)
      echo "updating drawing to ${2}"
      sed -i '9d' ${DAWN_RUN_DIR}/${OUT_FILE}
      sed -i '9i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
      shift # past argument
      shift # past value
      ;;
    -i|--input)
      OUT_FILE="$2"
      shift # past argument
Original line number Diff line number Diff line
@@ -92,7 +92,9 @@ rm -f *.prim

if [  "${DETECTOR_ONLY}" -eq "1" ] ; then

  ./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
  ./scripts/run_topside.py \
    --compact ${DETECTOR_PATH}/topside.xml \
    -i scripts/input_data/few_events.hepmc \
    -o derp.root -n 1 \
    --ui csh --vis -b -m macro/dawn_picture.mac & 

@@ -108,7 +110,9 @@ kill %1
else 

  echo " Running simulation for tracks"
./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
./scripts/run_topside.py \
  --compact ${DETECTOR_PATH}/topside.xml \
  -i scripts/input_data/few_events.hepmc \
  -o derp.root -s ${SKIP_EVENTS} -n 1 \
  --ui csh --vis -b -m macro/dawn_picture2.mac & 

+10 −1
Original line number Diff line number Diff line
@@ -15,5 +15,14 @@ base_url = "https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master
images = glob.glob("images/*.png")

template = env.get_template('detector_views.md')
print(template.render(base_url=base_url, images=images))
res = template.render(base_url=base_url, images=images)
#print(template.render(base_url=base_url, images=images))
with open('doc/dawn_views.md','w') as out:
    out.write(res + '\n')

views_template = env.get_template('views.html')
#print(template.render(base_url=base_url, images=images))
res2 = views_template.render(base_url=base_url, images=images)
with open('doc/views.html','w') as out:
    out.write(res2 + '\n')

doc/main.html

0 → 100644
+208 −0
Original line number Diff line number Diff line
 <!DOCTYPE html>
<html>
<head>
<title>TOPSiDE</title>
</head>
<body>

<h1>TOPSiDE</h1>

<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1.png?job=report" width="600px" />
</a>
<br />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2a.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2a.png?job=report" width="400px" />
</a>
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2e.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2e.png?job=report" width="400px" />
</a>
<br />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11.png?job=report" width="600px" />
</a>

<br />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a.png?job=report" width="600px" />
</a>



<h2>TOPSiDE Reference</h2>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11a.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0050.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0100.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0150.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0200.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0250.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0300.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0350.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0400.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0450.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0500.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0550.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0600.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0650.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0700.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0750.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0800.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0850.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0900.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a0950.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1000.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1050.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1100.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1150.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1200.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1250.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1300.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1350.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1400.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1450.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1500.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1550.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1600.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1650.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1700.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1750.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1800.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1850.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1900.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a1950.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12a2000.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view12b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view13b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1_ev1.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2a.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2c.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2d.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2e.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1a.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1b.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1c.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1d.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2_ev1e.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view3.png?job=report" width="400px" />
<br \>

<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view3_ev1.png?job=report" width="400px" />
<br \>
</body>
</html> 

doc/views.html

0 → 100644
+801 −0

File added.

Preview size limit exceeded, changes collapsed.

Original line number Diff line number Diff line
#/vis/open DAWNFILE 1000x1000+600+400
#/vis/scene/create
#/vis/scene/add/volume
#/vis/sceneHandler/attach
#/vis/viewer/flush
#/vis/scene/add/trajectories
#/vis/scene/add/hits
#/tracking/storeTrajectory 1
#/vis/drawVolume
#/vis/geometry/set/forceSolid all -1 true
#/vis/geometry/set/visibility world_volume 0 0 
#/run/beamOn 1
#/vis/viewer/flush 
/vis/open DAWNFILE
/vis/viewer/set/lineSegmentsPerCircle 24
/vis/scene/create
/vis/scene/add/volume
/vis/sceneHandler/attach
#/vis/scene/add/scale 1 m x 1 0 0 manual -0.5 -2 0 m
/vis/scene/add/scale 1 m y 1 0 0 manual 2 -0.75 -3 m
#/vis/scene/add/scale 1 m y 1 0 0 manual 2 -0.75 -3 m
#/vis/scene/add/scale 2 m z 1 0 0 manual 0 -2 0 m
#/vis/scene/add/magneticField 6 lightArrow
/vis/viewer/flush
/vis/scene/add/trajectories
/vis/scene/add/trajectories rich smooth
/vis/scene/add/hits
/tracking/storeTrajectory 1

#/vis/geometry/set/forceSolid all -1 true
#/vis/geometry/set/visibility world_volume 0 0 

# Create an attribute filter named attributeFilter-0
/vis/filtering/trajectories/create/attributeFilter

# Select attribute "IMag"
/vis/filtering/trajectories/attributeFilter-0/setAttribute IMag

# Select trajectories with 100 MeV <= IMag< 500 GeV
/vis/filtering/trajectories/attributeFilter-0/addInterval 500 MeV 500 GeV
# List available attributes
/vis/list

# List filters
/vis/filtering/trajectories/list

/run/beamOn 5

exit
Original line number Diff line number Diff line
#/vis/open DAWNFILE 1000x1000+600+400
#/vis/scene/create
#/vis/scene/add/volume
#/vis/sceneHandler/attach
#/vis/viewer/flush
#/vis/scene/add/trajectories
#/vis/scene/add/hits
#/tracking/storeTrajectory 1
#/vis/drawVolume
#/vis/geometry/set/forceSolid all -1 true
#/vis/geometry/set/visibility world_volume 0 0 
#/run/beamOn 1
#/vis/viewer/flush 
/vis/open DAWNFILE
/vis/scene/create
/vis/scene/add/volume
/vis/sceneHandler/attach
#/vis/viewer/flush
/vis/scene/add/trajectories
/vis/scene/add/hits
/vis/scene/add/trajectories rich smooth
#/vis/scene/add/hits
#/vis/scene/add/scale 1 m x 1 0 0 manual -0.5 -2 0 m
/vis/scene/add/scale 1 m y 1 0 0 manual 2 -0.75 -3 m
#/vis/scene/add/scale 1 m y 1 0 0 manual 2 -0.75 -3 m
#/vis/scene/add/scale 2 m z 1 0 0 manual 0 -2 0 m
/tracking/storeTrajectory 1

#/vis/geometry/set/forceSolid all -1 true
#/vis/geometry/set/visibility world_volume 0 0 

# Create an attribute filter named attributeFilter-0
/vis/filtering/trajectories/create/attributeFilter

# Select attribute "IMag"
/vis/filtering/trajectories/attributeFilter-0/setAttribute IMag

# Select trajectories with 100 MeV <= IMag< 500 GeV
/vis/filtering/trajectories/attributeFilter-0/addInterval 500 MeV 500 GeV
# List available attributes
/vis/list

# List filters
/vis/filtering/trajectories/list

/run/beamOn 1

exit
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@
  <include ref="topside/hcal.xml"/>
  <include ref="topside/solenoid.xml"/>
  -->
  <include ref="topside/topside_rich.xml"/>
  <include ref="topside/forward_rich.xml"/>
  <!--
  <include ref="topside/roman_pots.xml"/>
  <include ref="../accelerator/eic/forward_ion_beamline.xml"/>
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ def run_sim(args):

    outputfile = args.output
    if outputfile is None:
        outputfile = 'data/topside_rich_' + time.strftime('%Y-%m-%d_%H-%M')
        outputfile = 'data/forward_rich_' + time.strftime('%Y-%m-%d_%H-%M')

    podio = DDG4.EventAction(kernel, 'Geant4Output2Podio/RootOutput', True)
    podio.HandleMCTruth = False
+25 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
  <head>
    <title>Topside Detector</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <style type="text/css">
      .container {
        max-width: 500px;
        padding-top: 100px;
      }
      h2 {color: red;}
    </style>
  </head>
  <body>
    <h1>TOPSiDE</h1>
    <div class="container">
      {% block content %}{% endblock %}
      <br>
      <h2>Details</h2>
    </div>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
  </body>
</html>
+18 −0
Original line number Diff line number Diff line
{% extends "layout.html" %}
{% block content %}
      <h2>Detector Views</h2>
      <br>

      <table>
        {%- for row in images|batch(3, '&nbsp;') %}
        <tr>
          {%- for column in row %}
          <td>
            <img src="{{base_url}}/{{column}}?job=report" width="300px" />
            <br \>
          </td>
          {%- endfor %}
        </tr>
        {%- endfor %}
      </table>
{% endblock %}
Original line number Diff line number Diff line
@@ -214,9 +214,21 @@ def run():
    #seq, act = geant4.setupDetector('HeavyGasCherenkov','PhotoMultiplierSDAction')
    #act.adopt(f3)

    seq, act = geant4.setupTracker('SiTrackerBarrel')
    seq, act = geant4.setupTracker('SiTrackerEndcapP')
    seq, act = geant4.setupTracker('SiTrackerEndcapN')
    seq, act = geant4.setupTracker('SiTrackerBarrel_Layer1')
    seq, act = geant4.setupTracker('SiTrackerEndcapP_Layer1')
    seq, act = geant4.setupTracker('SiTrackerEndcapN_Layer1')
    seq, act = geant4.setupTracker('SiTrackerBarrel_Layer2')
    seq, act = geant4.setupTracker('SiTrackerEndcapP_Layer2')
    seq, act = geant4.setupTracker('SiTrackerEndcapN_Layer2')
    seq, act = geant4.setupTracker('SiTrackerBarrel_Layer3')
    seq, act = geant4.setupTracker('SiTrackerEndcapP_Layer3')
    seq, act = geant4.setupTracker('SiTrackerEndcapN_Layer3')
    seq, act = geant4.setupTracker('SiTrackerBarrel_Layer4')
    seq, act = geant4.setupTracker('SiTrackerEndcapP_Layer4')
    seq, act = geant4.setupTracker('SiTrackerEndcapN_Layer4')
    seq, act = geant4.setupTracker('SiTrackerBarrel_Layer5')
    seq, act = geant4.setupTracker('SiTrackerEndcapP_Layer5')
    seq, act = geant4.setupTracker('SiTrackerEndcapN_Layer5')
    #seq, act = geant4.setupTracker('SiVertexBarrel')
    #seq, act = geant4.setupTracker('SiTrackerForward')
    #seq, act = geant4.setupCalorimeter('EcalBarrel')
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@ function print_the_help {
  exit 
}

FILE_TAG="view1"
INPUT_FILE="g4_0000.prim"
FILE_TAG="view01"
INPUT_FILE="../../g4_0000.prim"


POSITIONAL=()
@@ -44,6 +44,7 @@ done
set -- "${POSITIONAL[@]}" # restore positional parameters


# Side  view
dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim 
dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim  ${FILE_TAG}.prim
dawn -d ${FILE_TAG}.prim 
@@ -55,3 +56,15 @@ gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox


# Top view
dawncut 0 1 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim 
dawncut 0 -1 0 1 ${FILE_TAG}_temp0.prim  ${FILE_TAG}.prim
../../bin/dawn_tweak --theta 270
dawn -d ${FILE_TAG}.prim 
ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_top_full.pdf
gs -o ${FILE_TAG}_top.pdf -sDEVICE=pdfwrite \
  -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
  -f ${FILE_TAG}_top_full.pdf

pdftoppm ${FILE_TAG}_top.pdf ${FILE_TAG}_top -png -singlefile -cropbox
Original line number Diff line number Diff line
@@ -75,8 +75,9 @@ gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox


dawncut  1  0 -0.01666 200 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
dawncut -1  0  0.01666 200 ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
#dawncut  1  0 -0.01666 200 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
dawncut -1  0  0.01666 200 ${INPUT_FILE}  ${FILE_TAG}a.prim
  ../../bin/dawn_tweak  --draw 5
dawn -d ${FILE_TAG}a.prim 
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
Original line number Diff line number Diff line
#!/bin/bash

#trignometry
sin ()
{
    echo "scale=5;s($1)" | bc -l
}

cos ()
{
    echo "scale=5;c($1)" | bc -l
}

tan ()
{
    echo "scale=5;s($1)/c($1)" | bc -l
}
#sin ()
#{
#    echo "scale=5;s($1)" | bc -l
#}
#
#cos ()
#{
#    echo "scale=5;c($1)" | bc -l
#}
#
#tan ()
#{
#    echo "scale=5;s($1)/c($1)" | bc -l
#}


function print_the_help {
@@ -62,16 +62,18 @@ set -- "${POSITIONAL[@]}" # restore positional parameters

echo "view12 produces a series of slightly rotated XY slices a different z locations. Along beamline"

../../bin/dawn_tweak --mag 40

# slice at z = 2m
# note the offset has to change with sign of the direction to cut in the opposite direction.
dawncut 0  0  1  2005 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim 
dawncut 0  0 -1 -2000 ${FILE_TAG}b_temp0.prim  ${FILE_TAG}b.prim
dawn -d ${FILE_TAG}b.prim 
ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
  -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
  -f ${FILE_TAG}b_full.pdf
pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
#dawncut 0  0  1  2005 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim 
#dawncut 0  0 -1 -2000 ${FILE_TAG}b_temp0.prim  ${FILE_TAG}b.prim
#dawn -d ${FILE_TAG}b.prim 
#ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
#gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
#  -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
#  -f ${FILE_TAG}b_full.pdf
#pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox

original_file_tag="${FILE_TAG}"

@@ -90,7 +92,7 @@ make_slice(){
  rm "${FILE_TAG}_temp0.prim"
  rm "${FILE_TAG}.prim"
}
for zzz in $(seq 50 50 2000) ;
for zzz in $(seq 0 2 130) ;
do
  make_slice ${zzz} & 
done
Original line number Diff line number Diff line
1.34392e+07
0.0
72.5
189.5
0
@@ -6,7 +6,7 @@
0
1500
55
1
3
0.001
0
1
Original line number Diff line number Diff line
#!/bin/bash

#trignometry
sin ()
{
    echo "scale=5;s($1)" | bc -l
}

add ()
{
    echo "scale=5;$1 + $2" | bc -l
}

cos ()
{
    echo "scale=5;c($1)" | bc -l
}

tan ()
{
    echo "scale=5;s($1)/c($1)" | bc -l
}
#sin ()
#{
#    echo "scale=5;s($1)" | bc -l
#}
#
#add ()
#{
#    echo "scale=5;$1 + $2" | bc -l
#}
#
#cos ()
#{
#    echo "scale=5;c($1)" | bc -l
#}
#
#tan ()
#{
#    echo "scale=5;s($1)/c($1)" | bc -l
#}


function print_the_help {
@@ -102,7 +102,7 @@ make_slice(){
  rm "${FILE_TAG}_temp0.prim"
  rm "${FILE_TAG}.prim"
}
for zzz in $(seq 150 50 2000) ;
for zzz in $(seq 150 100 1000) ;
do
  make_slice ${zzz} 
done
+31 −0
Original line number Diff line number Diff line
0.0
72.5
189.5
0
0
0
1500
50
3
0.001
0
1
1
1
0.5
0.5
0.5
25.5
71
0.001
0.001
0.001
1
70
0.001
1
0
1
evince
0
0
+166 −0
Original line number Diff line number Diff line
#!/bin/bash

#trignometry
#sin ()
#{
#    echo "scale=5;s($1)" | bc -l
#}
#
#add ()
#{
#    echo "scale=5;$1 + $2" | bc -l
#}
#
#cos ()
#{
#    echo "scale=5;c($1)" | bc -l
#}
#
#tan ()
#{
#    echo "scale=5;s($1)/c($1)" | bc -l
#}


function print_the_help {
  echo "USAGE: $0 -i <PRIM_FILE>  "
  echo "  OPTIONS: "
  echo "            -t,--tag           filename tag (default: view1)"
  exit 
}

FILE_TAG="view15"
INPUT_FILE="../../g4_0000.prim"


POSITIONAL=()
while [[ $# -gt 0 ]]
do
  key="$1"

  case $key in
    -h|--help)
      shift # past argument
      print_the_help
      ;;
    -t|--tag)
      FILE_TAG="$2"
      shift # past argument
      shift # past value
      ;;
    -i|--input)
      INPUT_FILE="$2"
      shift # past argument
      shift # past value
      ;;
    *)    # 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

# units are mm

echo "view15 produces a series of slightly rotated XY slices a different z locations. Along beamline"

# slice at z = 2m
# note the offset has to change with sign of the direction to cut in the opposite direction.
#dawncut 0  0  1  10005 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim 
#dawncut 0  0 -1 -1000 ${FILE_TAG}b_temp0.prim  ${FILE_TAG}b.prim
#dawn  ${FILE_TAG}b.prim 
#ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
#gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
#  -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
#  -f ${FILE_TAG}b_full.pdf
#pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox

echo "done ..."


original_file_tag="${FILE_TAG}"

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
  ../../bin/dawn_tweak -z ${zpos}0 --draw 5
  #cp ${INPUT_FILE} ${FILE_TAG}.prim
  dawncut -1 0 0 0 ${INPUT_FILE} ${FILE_TAG}.prim 
  dawn -d ${FILE_TAG}.prim 
  ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
  gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
    -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
    -f ${FILE_TAG}_full.pdf
      pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox
  rm "${FILE_TAG}_temp0.prim"
  rm "${FILE_TAG}.prim"
}

for zzz in $(seq 150 50 2000) ;
do
  make_slice ${zzz} 
done

wait



#dawncut 0  1 0 10 ${INPUT_FILE} ${FILE_TAG}c_temp0.prim 
#dawncut 0 -1 0 0 ${FILE_TAG}c_temp0.prim  ${FILE_TAG}c.prim
#dawn -d ${FILE_TAG}c.prim 
#ps2pdf ${FILE_TAG}c.eps ${FILE_TAG}c_full.pdf
#gs -o ${FILE_TAG}c.pdf -sDEVICE=pdfwrite \
#  -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
#  -f ${FILE_TAG}c_full.pdf
#pdftoppm ${FILE_TAG}c.pdf ${FILE_TAG}c -png -singlefile -cropbox
#
## slice at z = -1m
#dawncut 0 0 1 -1000 ${INPUT_FILE} ${FILE_TAG}d_temp0.prim 
#dawncut 0 0 -1 1001 ${FILE_TAG}d_temp0.prim  ${FILE_TAG}d.prim
#dawn -d ${FILE_TAG}d.prim 
#ps2pdf ${FILE_TAG}d.eps ${FILE_TAG}d_full.pdf
#gs -o ${FILE_TAG}d.pdf -sDEVICE=pdfwrite \
#  -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
#  -f ${FILE_TAG}d_full.pdf
#pdftoppm ${FILE_TAG}d.pdf ${FILE_TAG}d -png -singlefile -cropbox
#
## slice at z = -2m
#dawncut 0 0 1 -2000 ${INPUT_FILE} ${FILE_TAG}e_temp0.prim 
#dawncut 0 0 -1 2001 ${FILE_TAG}e_temp0.prim  ${FILE_TAG}e.prim
#dawn -d ${FILE_TAG}e.prim 
#ps2pdf ${FILE_TAG}e.eps ${FILE_TAG}e_full.pdf
#gs -o ${FILE_TAG}e.pdf -sDEVICE=pdfwrite \
#  -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
#  -f ${FILE_TAG}e_full.pdf
#pdftoppm ${FILE_TAG}e.pdf ${FILE_TAG}e -png -singlefile -cropbox


#https://geant4.kek.jp/~tanaka/DAWN/About_DAWNCUT.html
# % dawncut a b c d input-file [output-file]
#
#       input-file : Source DAWN-format file describing a 3D scene.
#
#       output-file: Output DAWN-format file describing a plane-clipped 
#                    3D scene.  The default output stream is stdout.
#
#       a, b, c, d : Parameters  a, b, c, and d  are double values to
#                    define a clipping plane described with the following 
#                    equation: 
#
#                       ax + by + cz + d = 0. 
#
#                    Vector (a,b,c) defines the normal vector of 
#                    the clipping plane.  
#                    3D scene data in the half space at the front side 
#                    of the clipping plane are clipped out and erased. 
#                    The normal vector (a,b,c) needs not be a unit vector. 
#                    If it is a unit vector, parameter "d" gives distance 
#                    between the clipping plane and origin (0,0,0).
Original line number Diff line number Diff line
1.34392e+07
0
180
19
185.5
0
0
0
0
8
16
1
0.001
0
@@ -17,12 +17,12 @@
0.5
19
71
0.01
0.01
0.01
3
0.001
0.001
0.001
1
70
0.01
0.001
1
1
1
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@ function print_the_help {
  exit 
}

FILE_TAG="view2"
INPUT_FILE="g4_0000.prim"
FILE_TAG="view02"
INPUT_FILE="../../g4_0000.prim"


POSITIONAL=()
@@ -43,10 +43,15 @@ do
done
set -- "${POSITIONAL[@]}" # restore positional parameters

echo "INPUT_FILE = ${INPUT_FILE}"
echo "FILE_TAG   = ${FILE_TAG}"

ls -lrth ${INPUT_FILE}

../../bin/dawn_tweak --mag 16 --draw 1
# units are mm
dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
dawncut 0 0 1 1  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
dawncut 0 0 -1 2 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
dawncut 0 0 1 2  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
dawn -d ${FILE_TAG}a.prim 
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@ function print_the_help {
  exit 
}

FILE_TAG="view6"
INPUT_FILE="g4_0000.prim"
FILE_TAG="view06"
INPUT_FILE="../../g4_0000.prim"


POSITIONAL=()
@@ -50,6 +50,12 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
#SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
#SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick )

dawncut 0 0 -1 1000 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
dawncut 0 0 1 1000  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}_input.prim

INPUT_FILE=${FILE_TAG}_input.prim


# units are mm
dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
dawncut 0 0 1 1  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ function print_the_help {
  exit 
}

FILE_TAG="view7"
FILE_TAG="view07"
INPUT_FILE="g4_0000.prim"


Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ typedef ROOT::Math::XYPoint Point;


// check if a square in a ring
inline bool in_ring(const Point &pt, double side, double rmin, double rmax)
inline bool in_ring(const Point &pt, double side, double rmin, double rmax, double phmin, double phmax)
{
    if (pt.r() > rmax || pt.r() < rmin) {
        return false;
@@ -39,7 +39,7 @@ inline bool in_ring(const Point &pt, double side, double rmin, double rmax)
        Point(pt.x() + side/2., pt.y() + side/2.),
    };
    for (auto &p : pts) {
        if (p.r() > rmax || p.r() < rmin) {
        if (p.r() > rmax || p.r() < rmin || p.phi() > phmax || p.phi() < phmin) {
            return false;
        }
    }
@@ -59,34 +59,36 @@ inline bool overlap(const Point &pt, double side, const std::vector<Point> &pts)
}

// a helper function to recursively fill square in a ring
void add_square(Point p, std::vector<Point> &res, double lside, double rmin, double rmax)
void add_square(Point p, std::vector<Point> &res, double lside, double rmin, double rmax,
                double phmin, double phmax)
{
    // outside of the ring or overlapping
    if (!in_ring(p, lside, rmin, rmax) || overlap(p, lside, res)) {
    if (!in_ring(p, lside, rmin, rmax, phmin, phmax) || overlap(p, lside, res)) {
        return;
    }

    res.emplace_back(p);

    // check adjacent squares
    add_square(Point(p.x() + lside, p.y()), res, lside, rmin, rmax);
    add_square(Point(p.x() - lside, p.y()), res, lside, rmin, rmax);
    add_square(Point(p.x(), p.y() + lside), res, lside, rmin, rmax);
    add_square(Point(p.x(), p.y() - lside), res, lside, rmin, rmax);
    add_square(Point(p.x() + lside, p.y()), res, lside, rmin, rmax, phmin, phmax);
    add_square(Point(p.x() - lside, p.y()), res, lside, rmin, rmax, phmin, phmax);
    add_square(Point(p.x(), p.y() + lside), res, lside, rmin, rmax, phmin, phmax);
    add_square(Point(p.x(), p.y() - lside), res, lside, rmin, rmax, phmin, phmax);
}

// fill squares
std::vector<Point> fill_squares(Point ref, double lside, double rmin, double rmax)
std::vector<Point> fill_squares(Point ref, double lside, double rmin, double rmax,
                                double phmin = 0., double phmax = 2.*M_PI)
{
    // start with a seed square and find one in the ring
    // move to center
    ref = ref - Point(int(ref.x()/lside)*lside, int(ref.y()/lside)*lside);

    auto find_seed = [] (const Point &ref, int n, double side, double rmin, double rmax) {
    auto find_seed = [] (const Point &ref, int n, double side, double rmin, double rmax, double phmin, double phmax) {
        for (int ix = -n; ix < n; ++ix) {
            for (int iy = -n; iy < n; ++iy) {
                Point pt(ref.x() + ix*side, ref.y() + iy*side);
                if (in_ring(pt, side, rmin, rmax)) {
                if (in_ring(pt, side, rmin, rmax, phmin, phmax)) {
                    return pt;
                }
            }
@@ -95,8 +97,8 @@ std::vector<Point> fill_squares(Point ref, double lside, double rmin, double rma
    };

    std::vector<Point> res;
    ref = find_seed(ref, int(rmax/lside) + 2, lside, rmin, rmax);
    add_square(ref, res, lside, rmin, rmax);
    ref = find_seed(ref, int(rmax/lside) + 2, lside, rmin, rmax, phmin, phmax);
    add_square(ref, res, lside, rmin, rmax, phmin, phmax);
    return res;
}

@@ -110,19 +112,16 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec

    DetElement det(detName, detID);
    xml::Component dims = detElem.dimensions();
    xml::Component tank = detElem.child(_Unicode(tank));
    xml::Component rads = detElem.child(_Unicode(radiator));
    xml::Component mir = detElem.child(_Unicode(mirror));
    xml::Component mcp = detElem.child(_Unicode(mcppmt));

    // dimensions
    double z0 = dims.z0();

    // gas tank
    auto tRmin = tank.rmin();
    auto tRmax1 = tank.rmax1();
    auto tRmax2 = tank.rmax2();
    auto tLength = tank.length();
    auto tZ = tank.attr<double>(_Unicode(zdiff));
    double length = dims.length();
    double rmin = dims.rmin();
    double rmax1 = dims.attr<double>(_Unicode(rmax1));
    double rmax2 = dims.attr<double>(_Unicode(rmax2));

    // mirror setting
    auto mThick = mir.thickness();
@@ -139,42 +138,37 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec

    // materials
    auto mirMat = desc.material(mir.materialStr());
    auto gasMat = desc.material(tank.attr<std::string>(_Unicode(gas)));
    auto gasMat = desc.material(rads.materialStr());
    auto mcpMat = desc.material(mcp.materialStr());

    // constants
    auto richCenterAngle = std::atan((rmin + (rmax2 - rmin)/2.)/mirZ);
    //std::cout << richCenterAngle*180./M_PI << std::endl;

    // an envelope for the detector
    // use a complicated shape to avoid conflict with the other parts
    // cone for radiator and the first set of mirrors
    double halfLength = 0.5 * (mirZ + 5.0*cm);
    double rmin = tRmin;
    double rmax = tRmax2;
    // cone for radiator
    double halfLength = length/2.;
    Cone env1(halfLength, rmin, rmax1, rmin, rmax2);
    // envelope for detection plane
    Tube env2(rmin, pRmax + pTol + pGap + 1.0*cm, (length - pZ)/2., 0., 2*M_PI);
    // envelope for mirror sets
    double rMirEnv = rmax2;
    for (xml::Collection_t sl(mir, _Unicode(slice)); sl; ++sl) {
        auto mRmin = sl.attr<double>(_Unicode(rmin));
        auto mRmax = sl.attr<double>(_Unicode(rmax));
        if (mRmin < rmin) { rmin = mRmin; }
        if (mRmax > rmax) { rmax = mRmax; }
        auto mr = sl.attr<double>(_Unicode(rmax));
        rMirEnv = mr > rMirEnv ? mr: rMirEnv;
    }
    rmin = std::max(0., rmin - 0.1*cm);
    rmax = 2.*halfLength/mirZ*rmax;
    Cone env1(halfLength, rmin, tRmax1 + 0.1*cm , rmin, rmax + 0.1*cm);
    // disk for detection plane
    Tube env2(std::max(0., pRmin - 0.1*cm), pRmax + pTol + pGap + 0.1*cm, pThick + 0.1*cm, 0., 2.*M_PI);
    Tube env3(rmin, rMirEnv + 1.0*cm, mir.attr<double>(_Unicode(env_length))/2., 0., 2*M_PI);

    UnionSolid envShape(env1, env2, Position(0., 0., -halfLength + pZ + pThick/2.));
    UnionSolid env12(env1, env2, Position(0., 0., pZ/2.));
    UnionSolid envShape(env12, env3, Position(0., 0., mirZ/2.));

    Volume envVol(detName + "_envelope", envShape, desc.material("AirOptical"));
    // envVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
    Volume envVol(detName + "_envelope", envShape, gasMat);
    envVol.setVisAttributes(desc.visAttributes(detElem.visStr()));

    // ---------------
    // Gas radiator container and spherical mirrors inside it
    // spherical mirrors inside it
    int ilayer = 1;
    Cone tankShape(tLength/2.0, tRmin, tRmax1, tRmin, tRmax2);
    Volume tankVol("RICH_tank", tankShape, gasMat);
    tankVol.setVisAttributes(desc.visAttributes(tank.visStr()));
    auto tankPV = envVol.placeVolume(tankVol, Position(0., 0., -halfLength + tZ + tLength/2.0));
    tankPV.addPhysVolID("layer", ilayer++);
    DetElement tankDE(det, "Tank_DE", 1);
    tankDE.setPlacement(tankPV);

    // optical surface
    OpticalSurfaceManager surfMgr = desc.surfaceManager();
@@ -207,6 +201,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
            Transform3D tr = Translation3D(0., 0., mirZ - halfLength)   // move for z position
                           * RotationZ(rotZ)                            // rotate phi angle
                           * RotationY(rotY)                            // rotate for focus point
                           * RotationX(180*degree)
                           * Translation3D(0., 0., -curve)              // move spherical shell to origin
                           * RotationZ(-wphi/2.);                       // center phi angle to 0. (-wphi/2., wphi/2.)
            mirPV = envVol.placeVolume(mirVol, tr);
@@ -227,6 +222,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
    ilayer++;

    // ---------------
    // photo-detector unit
    // Fill the photo-detection plane with square shape MCP-PMTs
    Box mcpShape1(pSize/2.0, pSize/2.0, pThick/2.0);
    Volume mcpVol1("mcppmt_v_material", mcpShape1, mcpMat);
@@ -240,15 +236,28 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
    sens.setType("photoncounter");
    mcpVol.setSensitiveDetector(sens);

    auto points = fill_squares(Point(0., 0.), pSize + pGap, pRmin - pTol - pGap, pRmax + pTol + pGap);
    // photo-detector plane envelope
    double rmcp = pRmin - pTol - pGap;
    double pZ2 = pZ - rmcp*std::sin(richCenterAngle) + 5.0*cm;
    for (size_t ipd = 0; ipd < 6; ++ipd) {
        double phmin = -M_PI/6.;
        double phmax = M_PI/6.;
        Tube pdEnvShape(pRmin - pTol - pGap, pRmax + pTol + pGap, pThick/2.0 + 0.1*cm, phmin, phmax);
        Volume pdVol("pd_envelope", pdEnvShape, desc.material("AirOptical"));
        auto points = fill_squares(Point(0., 0.), pSize + pGap, pRmin - pTol - pGap, pRmax + pTol + pGap, phmin, phmax);
        for (size_t i = 0; i < points.size(); ++i) {
            auto pt = points[i];
        auto mcpPV = envVol.placeVolume(mcpVol, Position(pt.x(), pt.y(), -halfLength + pZ + pThick/2.0));
            auto mcpPV = pdVol.placeVolume(mcpVol, Position(pt.x(), pt.y(), 0.));
            mcpPV.addPhysVolID("layer", ilayer).addPhysVolID("module", i + 1);
        DetElement mcpDE(det, Form("MCPPMT_DE%d", i + 1), i + 1);
            DetElement mcpDE(det, Form("MCPPMT_DE%d_%d", ipd + 1, i + 1), i + 1);
            mcpDE.setPlacement(mcpPV);
        }

        Transform3D tr = Translation3D(0., 0., -halfLength + pZ2 + pThick/2.0)   // move for z position
                        * RotationZ(ipd*M_PI/3.)        // rotate phi angle
                        * RotationY(-richCenterAngle);  // rotate to perpendicular position
        auto pdPV = envVol.placeVolume(pdVol, tr);
        pdPV.addPhysVolID("layer", ilayer).addPhysVolID("piece", ipd + 1);
    }
    Volume motherVol = desc.pickMotherVolume(det);
    PlacedVolume envPV = motherVol.placeVolume(envVol, Position(0, 0, z0 + halfLength));
    envPV.addPhysVolID("system", detID);
Original line number Diff line number Diff line
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "DDRec/DetectorData.h"
#include "DDRec/Surface.h"
#include "TMath.h"
#include "XML/Helper.h"
#include "XML/Layering.h"

using namespace dd4hep;

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();

src/RomanPot_geo.cpp

0 → 100644
+287 −0
Original line number Diff line number Diff line
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "TMath.h"
#include "DDRec/Surface.h"
#include "DDRec/DetectorData.h"
#include "XML/Layering.h"

using namespace std;
using namespace dd4hep;
using namespace dd4hep::rec;
using namespace ROOT::Math;

/** \addtogroup trackers Tracking Detectors
 *
 *
 */

/** \addtogroup romanpot Roman Pot Tracker
 * \brief Type: **RomanPot**, for small angle detection.
 * \ingroup trackers
 *
 *  The Roman pot is a movable detector in the forward direction that integrates with the beampipe vacuum. 
 *
 * \code
 *   <detector id = "1" name = "MyRomanPot" type = "RomanPot" readout =
 *             "ForwardRomanPotHits" vis = "InvisibleWithDaughters">
 *     <dimensions x = "3.0*cm" y = "3.0*cm" delta = "0.5*cm" />
 *     <frame x = "10.0*cm" y = "5.0*cm" z = "2*cm" />
 *     <position z_offset = "0.0*m" rotation = "false" vmax = "10*cm" v = "2.0*cm" />
 *     <layer repeat = "5">
 *       <slice material="Carbon"  thickness="0.5*mm"  vis = "BlueVis" />
 *       <slice material="Silicon" thickness="0.3*mm"  vis = "GreenVis" sensitive = "true"  />
 *       <slice material="Carbon"  thickness="0.5*mm"  vis = "BlueVis" />
 *       <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
 *     </layer>
 *   </detector>
 * \endcode
 *
 * @{
 */
static Ref_t build_detector(Detector& dtor, xml_h e, SensitiveDetector sens) {
  xml_det_t  x_det        = e;
  //Layering   layering     (e);
  int        det_id       = x_det.id();
  string     det_name     = x_det.nameStr();
  xml_dim_t  dim          = x_det.dimensions();
  double     pixel_x      = dim.x();
  double     pixel_y      = dim.y();
  double     delta        = dim.delta();
  xml_dim_t  frame_dim    = x_det.child(_U(frame));
  double     frame_x      = frame_dim.x();
  double     frame_y      = frame_dim.y();
  double     frame_z      = frame_dim.z();
  string     frame_vis    = dd4hep::getAttrOrDefault(frame_dim, _Unicode(vis), "RPLayerVis");
  xml_dim_t  pos          = x_det.position();
  double     zoffset      = pos.z_offset();
  double     x_pos        = dd4hep::getAttrOrDefault(pos, _Unicode(x),0.0);
  double     y_pos        = dd4hep::getAttrOrDefault(pos, _Unicode(y),0.0);
  double     z_pos        = dd4hep::getAttrOrDefault(pos, _Unicode(z),0.0);
  bool       rotated      = pos.attr<bool>(_Unicode(rotation));
  double     pos_out      = pos.attr<double>(_Unicode(vmax));
  double     curr_pos     = pos.attr<double>(_Unicode(v));
  Material   vacuum       = dtor.material("Vacuum");
  Material   aluminum     = dtor.material("Aluminum");
  Material   frame_mat    = dtor.material("Aluminum");

  DetElement sdet(det_name, det_id);
  Assembly   assembly(det_name + "_assembly");

  sens.setType("tracker");
  string module_name = "RomanPot";

  string vis0 = dd4hep::getAttrOrDefault(x_det, _Unicode(vis), "BlueVis");

  sdet.setAttributes(dtor, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr());

  double rp_detector_tube_length    = frame_x + pos_out; // TODO: Shortest possible tube given the RP dimensions. Will probably change in the future.
  double rp_detector_tube_thickness = 5.0 * dd4hep::mm;
  double rp_detector_tube_radius    = 0.55*sqrt(frame_z * frame_z + frame_y * frame_y); // TODO: Tightest possible fit. Will probably change in the future.
  Tube   rp_detector_vacuum_tube(0.0, rp_detector_tube_radius + rp_detector_tube_thickness, rp_detector_tube_length);
  Tube   rp_detector_vacuum_tube2(0.0, rp_detector_tube_radius, rp_detector_tube_length);

  // These are currently hardcoded. Will probably change in the future.
  double rp_chamber_thickness = 10.0 * dd4hep::mm;
  double rp_chamber_radius    = 5.0 * dd4hep::cm;
  double rp_chamber_length    = rp_detector_tube_radius*1.5;

  // All the rotation and translation shenanigans related to RP unit orientation happen here.
  // `rot1` and `rot2` are used for in construction of the tubes, `shift_pos1` and `shift_pos2`
  // properly transform the RP detector positions.
  auto rot1 = rotated ? Rotation3D(RotationX(0.5*M_PI)) : Rotation3D(RotationY(0.5*M_PI));
  auto rot2 = rotated ? Rotation3D(RotationX(-0.5*M_PI)) : Rotation3D(RotationY(-0.5*M_PI));
  auto shift_pos1 = rotated ? Transform3D(RotationZ(0.5 * M_PI) * Translation3D(curr_pos + 0.5 * frame_x, 0.0, 0.0))
                            : Transform3D(Translation3D(curr_pos + 0.5 * frame_x, 0, 0));
  auto shift_pos2 = rotated ? Transform3D(RotationZ(-0.5 * M_PI) * Translation3D(curr_pos + 0.5 * frame_x, 0.0, 0.0))
                            : Transform3D(RotationZ(M_PI) * Translation3D(curr_pos + 0.5 * frame_x, 0, 0));
  auto det_offset = Position(0.5*(pixel_x + delta - frame_x), 0, 0);

  // Construct the RP enclosure shell.
  Tube   rp_beam_pipe_tube(rp_chamber_radius, rp_chamber_radius + rp_chamber_thickness, rp_chamber_length/2.0);
  Tube   rp_beam_vacuum_tube(0.0,  rp_chamber_radius + rp_chamber_thickness, rp_chamber_length);
  Tube   rp_beam_vacuum_tube2(0.0, rp_chamber_radius, rp_chamber_length);
  UnionSolid rp_chamber_tee_outer1(rp_beam_vacuum_tube, rp_detector_vacuum_tube, rot1);
  UnionSolid rp_chamber_tee_outer(rp_chamber_tee_outer1, rp_detector_vacuum_tube, rot2);
  UnionSolid rp_chamber_tee_inner1(rp_beam_vacuum_tube2, rp_detector_vacuum_tube2, rot1);
  UnionSolid rp_chamber_tee_inner(rp_chamber_tee_inner1, rp_detector_vacuum_tube2, rot2);
  //SubtractionSolid shell(rp_chamber_tee_outer,rp_chamber_tee_inner);
  Volume           rp_chamber_vol("rp_chamber_walls_vol", rp_chamber_tee_outer, aluminum);
  Volume           rp_vacuum_vol("rp_chamber_vacuum_vol", rp_chamber_tee_inner, vacuum);

  auto chamber_pv = assembly.placeVolume(rp_chamber_vol);
  auto vacuum_pv  = rp_chamber_vol.placeVolume(rp_vacuum_vol);
  vacuum_pv.addPhysVolID("element", 1);
  rp_chamber_vol.setVisAttributes(vis0.c_str());
  rp_vacuum_vol.setVisAttributes(vis0.c_str());
  //rp_vacuum_vol.setVisAttributes(dtor.invisible());

  DetElement vacuum_DE(sdet, "vacuum_DE", 1);
  // Make the enclosure box for the detector frame
  Box frame_box_full(0.5 * frame_x, 0.5 * frame_y, 0.5 * frame_z);
  Box det_cutoff(0.5 * (pixel_x + delta), 0.5 * (pixel_y + delta), 0.5 * frame_z);
  // Make the cutout where whe detector will sit
  // The frame with a hole for the detector
  SubtractionSolid frame_box(frame_box_full, det_cutoff, det_offset); 
  // Here we assum there is only one unique layer which is repeated.
  // Layer
  xml_comp_t x_layer          = x_det.child(_U(layer));
  const int repeat = x_layer.repeat();
  double layer_thickness =  0.0;
  for (xml_coll_t si(x_layer, _U(slice)); si; ++si) {
    xml_comp_t x_slice         = si;
    layer_thickness += x_slice.thickness();
  }
  //std::cout << " layer thickness = " << layer_thickness << " \n";
  double total_thickness = repeat*layer_thickness;
  // --- d1 ---
  //
  Volume       frame_box_full1_vol("frame_box_full1", frame_box_full, vacuum);
  PlacedVolume frame_box_full1_pv = rp_vacuum_vol.placeVolume(frame_box_full1_vol, shift_pos1);
  DetElement   frame1_DE(vacuum_DE, "frame_DE1", 1);
  frame_box_full1_pv.addPhysVolID("frame", 1);

  frame1_DE.setAttributes(dtor, frame_box_full1_vol, x_det.regionStr(), x_det.limitsStr(), frame_vis);

  Volume       frame1_vol("xsensor_frame1", frame_box, frame_mat);
  PlacedVolume frame1_pv = frame_box_full1_vol.placeVolume(frame1_vol);

  // Loop over layers
  double     layer_pos_offset = -0.5 * total_thickness;
  int        layer_num        = 1;
  // How many times does the layer repeat. Defined in the compact description.
  for (int j = 0; j < repeat; j++) {
    string layer_name = _toString(layer_num, "layer1_%d");
    // double layer_thickness =
    //    layering.layer(layer_num - 1)->thickness(); // Get the thickness of the current layer.
    Position   layer_pos = Position(0, 0, layer_pos_offset + 0.5 * layer_thickness);
    Box        layer_box(0.5 * (pixel_x + delta), 0.5 * (pixel_y + delta), layer_thickness / 2.0);
    Volume     layer_vol(layer_name, layer_box, vacuum);
    DetElement layer(frame1_DE, layer_name, layer_num);
    layer.setAttributes(dtor, layer_vol, x_det.regionStr(), x_det.limitsStr(), frame_vis);

    // Loop over slices within the layer
    double slice_pos_offset = -0.5 * layer_thickness;
    int    slice_num        = 1;
    for (xml_coll_t si(x_layer, _U(slice)); si; ++si) {
      xml_comp_t x_slice         = si;
      string     slice_name      = _toString(slice_num, "slice1_%d");
      double     slice_thickness = x_slice.thickness();
      Position   slice_pos       = Position(0, 0, slice_pos_offset + 0.5 * slice_thickness);
      Box        slice_box       = x_slice.isSensitive()
                          ? Box(0.5 * pixel_x, 0.5 * pixel_y, slice_thickness / 2.0)
                          : Box(0.5 * (pixel_x), 0.5 * (pixel_y), slice_thickness / 2.0);
      Volume slice_vol(slice_name, slice_box, dtor.material(x_slice.materialStr()));
      string slice_vis = dd4hep::getAttrOrDefault(x_slice, _Unicode(vis), "BlueVis");
      slice_vol.setVisAttributes(slice_vis.c_str());
      DetElement slice(layer, slice_name, slice_num);
      if (x_slice.isSensitive()) {
        Vector3D    u(1., 0., 0.);
        Vector3D    v(0., 1., 0.);
        Vector3D    n(0., 0., 1.);
        Vector3D    o(0., 0., 0.);
        double      inner_thickness = slice_pos_offset + slice_thickness / 2.0;
        double      outer_thickness = layer_thickness - inner_thickness;
        SurfaceType type(SurfaceType::Sensitive);
        VolPlane    surf(slice_vol, type, inner_thickness, outer_thickness, u, v, n, o);
        slice_vol.setSensitiveDetector(sens);
        sens.setType("tracker");
      }
      slice.setAttributes(dtor, slice_vol, x_det.regionStr(), x_det.limitsStr(), slice_vis);
      // Place the slice.
      PlacedVolume slice_pv = layer_vol.placeVolume(slice_vol, slice_pos);
      slice_pv.addPhysVolID("slice", slice_num );
      slice.setPlacement(slice_pv);
      slice_pos_offset += slice_thickness; // Move the position offset for the next slice.
      ++slice_num;
    }
    // Place the layer.
    PlacedVolume layer_pv = frame_box_full1_vol.placeVolume(layer_vol, layer_pos + det_offset);
    layer_pv.addPhysVolID("layer", layer_num );
    layer.setPlacement(layer_pv);
    layer_pos_offset += layer_thickness;
    ++layer_num;
  }

  // --- d2 ---
  //Volume       frame2_vol("xsensor_frame2", frame_box, frame_mat);
  //PlacedVolume frame2_pv = rp_vacuum_vol.placeVolume(frame2_vol, shift_pos2);
  //DetElement   frame2_DE(vacuum_DE, "frame_DE2", 2);
  //frame2_pv.addPhysVolID("frame", 2);
  //frame2_DE.setAttributes(dtor, frame2_vol, x_det.regionStr(), x_det.limitsStr(), "RedVis");

  Volume       frame_box_full2_vol("frame_box_full2", frame_box_full, vacuum);
  PlacedVolume frame_box_full2_pv = rp_vacuum_vol.placeVolume(frame_box_full2_vol, shift_pos2);
  DetElement   frame2_DE(vacuum_DE, "frame_DE2", 2);
  frame_box_full2_pv.addPhysVolID("frame", 2);
  frame2_DE.setAttributes(dtor, frame_box_full2_vol, x_det.regionStr(), x_det.limitsStr(), frame_vis);

  Volume       frame2_vol("xsensor_frame2", frame_box, frame_mat);
  PlacedVolume frame2_pv = frame_box_full2_vol.placeVolume(frame2_vol);

  //  Loop over layers
  layer_pos_offset = -0.5 * total_thickness;
  layer_num        = 1;
  for (int j = 0; j < repeat; j++) {
    string layer_name = _toString(layer_num, "layer2_%d");
    // double     layer_thickness = layering.layer(layer_num - 1)->thickness(); // Get the thickness
    // of the current layer.
    Position   layer_pos = Position(0, 0, layer_pos_offset + 0.5 * layer_thickness);
    Box        layer_box(0.5 * (pixel_x + delta), 0.5 * (pixel_y + delta), layer_thickness / 2.0);
    Volume     layer_vol(layer_name, layer_box, vacuum);
    DetElement layer(frame2_DE, layer_name, layer_num);
    layer.setAttributes(dtor, layer_vol, x_det.regionStr(), x_det.limitsStr(),
                        frame_vis);

    // Loop over slices within the layer
    double slice_pos_offset = -0.5 * layer_thickness;
    int    slice_num        = 1;
    for (xml_coll_t si(x_layer, _U(slice)); si; ++si) {
      xml_comp_t x_slice         = si;
      string     slice_name      = _toString(slice_num, "slice2_%d");
      double     slice_thickness = x_slice.thickness();
      Position   slice_pos       = Position(0, 0, slice_pos_offset + 0.5 * slice_thickness);
      Box        slice_box       = x_slice.isSensitive()
                          ? Box(0.5 * pixel_x, 0.5 * pixel_y, slice_thickness / 2.0)
                          : Box(0.5 * pixel_x, 0.5 * pixel_y, slice_thickness / 2.0);
      Volume slice_vol(slice_name, slice_box, dtor.material(x_slice.materialStr()));
      string slice_vis = dd4hep::getAttrOrDefault(x_slice, _Unicode(vis), "BlueVis");
      slice_vol.setVisAttributes(slice_vis.c_str());
      DetElement slice(layer, slice_name, slice_num);
      if (x_slice.isSensitive()) {
        Vector3D    u(1., 0., 0.);
        Vector3D    v(0., 1., 0.);
        Vector3D    n(0., 0., 1.);
        Vector3D    o(0., 0., 0.);
        double      inner_thickness = slice_pos_offset + slice_thickness / 2.0;
        double      outer_thickness = layer_thickness - inner_thickness;
        SurfaceType type(SurfaceType::Sensitive);
        VolPlane    surf(slice_vol, type, inner_thickness, outer_thickness, u, v, n, o);
        slice_vol.setSensitiveDetector(sens);
        sens.setType("tracker");
      }
      slice.setAttributes(dtor, slice_vol, x_det.regionStr(), x_det.limitsStr(), slice_vis);
      // Place the slice.
      PlacedVolume slice_pv = layer_vol.placeVolume(slice_vol, slice_pos);
      slice_pv.addPhysVolID("slice", slice_num );
      slice.setPlacement(slice_pv);
      slice_pos_offset += slice_thickness; // Move the position offset for the next slice.
      ++slice_num;
    }
    // Place the layer.
    PlacedVolume layer_pv = frame_box_full2_vol.placeVolume(layer_vol, layer_pos + det_offset);
    layer_pv.addPhysVolID("layer", layer_num );
    layer.setPlacement(layer_pv);
    layer_pos_offset += layer_thickness;
    ++layer_num;
    }

  auto assembly_pv = dtor.pickMotherVolume(sdet).placeVolume(assembly, Position(x_pos, y_pos, z_pos + zoffset));
  assembly_pv.addPhysVolID("system", det_id);
  sdet.setPlacement(assembly_pv);

  assembly->GetShape()->ComputeBBox();
  return sdet;
}
//@}
DECLARE_DETELEMENT(topside_RomanPot, build_detector)
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Utilities/Units.hpp"
#include "Acts/Definitions/Units.hpp"


using namespace std;
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
    xml_comp_t x_mod = mi;
    xml_comp_t m_env = x_mod.child(_U(module_envelope));
    string     m_nam = x_mod.nameStr();
    Volume     m_vol(m_nam, Box(m_env.width() / 2, m_env.length() / 2, m_env.thickness() / 2), air);
    Volume     m_vol(m_nam, Box(m_env.thickness() / 2,m_env.width() / 2, m_env.length() / 2 ), air);
    int        ncomponents = 0, sensor_number = 1;

    if (volumes.find(m_nam) != volumes.end()) {
@@ -49,27 +49,32 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
      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");
      Box        c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2);
      Box        c_box(x_comp.thickness() / 2, x_comp.width() / 2 ,x_comp.length() / 2 );
      Volume     c_vol(c_nam, c_box, description.material(x_comp.materialStr()));
      PlacedVolume c_pv;
      //if (x_pos) {
      //std::cout << x_pos.x(0) << "\n";
      //}


      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));
        pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos));
        c_pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos));
      } else if (x_rot) {
        pv = m_vol.placeVolume(c_vol, RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)));
        c_pv = m_vol.placeVolume(c_vol, RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)));
      } else if (x_pos) {
        pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0)));
        c_pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0)));
      } else {
        pv = m_vol.placeVolume(c_vol);
        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()) {
        pv.addPhysVolID(_U(sensor), sensor_number++);
        c_pv.addPhysVolID(_U(sensor), sensor_number++);
        c_vol.setSensitiveDetector(sens);
        sensitives[m_nam].push_back(pv);
        sensitives[m_nam].push_back(c_pv);
      }
    }
  }
@@ -99,6 +104,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s

    Acts::ActsExtension* layerExtension = new Acts::ActsExtension();
    layerExtension->addType("sensitive cylinder", "layer");
    //layerExtension->addValue(10. * Acts::UnitConstants::mm, "r", "envelope");
    lay_elt.addExtension<Acts::ActsExtension>(layerExtension);

    Placements& sensVols = sensitives[m_nam];
@@ -127,7 +133,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
        //         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(0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), Position(x, y, module_z));
        Transform3D tr(RotationZYX(phic - phi_tilt,0, 0), Position(x, y, module_z));

        pv = lay_vol.placeVolume(m_env, tr);
        pv.addPhysVolID("module", module);
@@ -136,7 +142,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
          PlacedVolume sens_pv = sensVols[ic];
          DetElement   comp_elt(mod_elt, sens_pv.volume().name(), module);
          comp_elt.setPlacement(sens_pv);
          Acts::ActsExtension* moduleExtension = new Acts::ActsExtension();
          Acts::ActsExtension* moduleExtension = new Acts::ActsExtension("YZX");
          comp_elt.addExtension<Acts::ActsExtension>(moduleExtension);
        }

@@ -166,7 +172,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
  assembly.setVisAttributes(description.invisible());
  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
  pv.addPhysVolID("system", det_id); // Set the subdetector system ID.
  pv.addPhysVolID("barrel", 0);      // Flag this as a barrel subdetector.
  pv.addPhysVolID("barrel", 1);      // Flag this as a barrel subdetector.
  sdet.setPlacement(pv);
  return sdet;
}
Original line number Diff line number Diff line
@@ -18,10 +18,11 @@
#include <map>

#include "Acts/Plugins/DD4hep/ActsExtension.hpp"
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Utilities/Units.hpp"
//#include "Acts/Surfaces/PlanarBounds.hpp"
//#include "Acts/Surfaces/RectangleBounds.hpp"
//#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Definitions/Units.hpp"

using namespace std;
using namespace dd4hep;
using namespace dd4hep::detail;
@@ -50,7 +51,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
  detWorldExt->addType("endcap", "detector");
  sdet.addExtension<Acts::ActsExtension>(detWorldExt);

  assembly.setVisAttributes(description.invisible());
  //assembly.setVisAttributes(description.invisible());
  sens.setType("tracker");

  for(xml_coll_t mi(x_det,_U(module)); mi; ++mi, ++m_id)  {
@@ -68,6 +69,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s

    y1 = y2 = total_thickness / 2;
    Volume  m_volume(m_nam, Trapezoid(x1, x2, y1, y2, z), vacuum);
    //Volume  m_volume(m_nam, Box(x1, y1, z), vacuum);
    m_volume.setVisAttributes(description.visAttributes(x_mod.visStr()));

    for(ci.reset(), n_sensor=1, c_id=0, posY=-y1; ci; ++ci, ++c_id)  {
@@ -76,6 +78,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
      Material   c_mat   = description.material(c.materialStr());
      string     c_name  = _toString(c_id,"component%d");
      Volume     c_vol(c_name, Trapezoid(x1,x2,c_thick/2e0,c_thick/2e0,z), c_mat);
      //Volume     c_vol(c_name, Box(x1,c_thick/2,z), c_mat);

      c_vol.setVisAttributes(description.visAttributes(c.visStr()));
      pv = m_volume.placeVolume(c_vol,Position(0,posY+c_thick/2,0));
@@ -103,7 +106,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
    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));
    std::cout << "SiTracker Endcap layer " << l_id << " zstart = " << layer_zstart/dd4hep::mm << "mm ( " << layer_length/dd4hep::mm << " mm thick )\n";
    //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);
@@ -114,7 +118,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
    PlacedVolume layer_pv;
    if (reflect) {
      layer_pv = assembly.placeVolume(layer_vol, Position(0,0,-layer_zstart-layer_length/2));
      layer_pv.addPhysVolID("barrel", 1).addPhysVolID("layer", l_id);
      layer_pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id);
      layer_name += "_N";
    } else {
      layer_pv = assembly.placeVolume(layer_vol, Position(0, 0, +layer_zstart + layer_length / 2));
@@ -125,6 +129,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
    layer_element.setPlacement(layer_pv);
    Acts::ActsExtension* layerExtension = new Acts::ActsExtension();
    layerExtension->addType("layer", "layer");
    //layerExtension->addType("axes", "definitions", "XZY");
    layer_element.addExtension<Acts::ActsExtension>(layerExtension);

    int mod_num = 1;
@@ -175,7 +180,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
        }
        if (reflect) {
          pv = layer_vol.placeVolume(m_vol,Transform3D(RotationZYX(M_PI,-M_PI/2-phi,-M_PI/2)*RotationZYX(0,0,-alpha),Position(x,y,-zstart-sign*dz)));
          pv.addPhysVolID("barrel",2).addPhysVolID("layer",l_id).addPhysVolID("module",mod_num);
          //pv.addPhysVolID("barrel",2).addPhysVolID("layer",l_id).addPhysVolID("module",mod_num);
          pv.addPhysVolID("module",mod_num);
          DetElement r_module(layer_element,m_base+"_N",mod_num);
          r_module.setPlacement(pv);
          for(size_t ic=0; ic<sensVols.size(); ++ic)  {
@@ -192,8 +198,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
      }
      ++ring_num;
    }
    layer_vol.setVisAttributes(description.visAttributes(layer_vis));
  }
  Position final_pos(0,0,0);
  if(reflect) {
    final_pos = Position(0,0,-1.0e-9);
  }
  pv = motherVol.placeVolume(assembly);
  pv = motherVol.placeVolume(assembly,final_pos);
  pv.addPhysVolID("system",det_id);
  sdet.setPlacement(pv);
  return sdet;
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Utilities/Units.hpp"
#include "Acts/Definitions/Units.hpp"


using namespace std;
+30 −23
Original line number Diff line number Diff line
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "DDRec/DetectorData.h"
#include "DDRec/Surface.h"
#include "XML/Layering.h"
#include <XML/Helper.h>

using namespace dd4hep;

static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) {
static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens)
{
  xml::DetElement detElem = handle;

  std::string detName = detElem.nameStr();

src/topsideZDC.cpp

0 → 100644
+117 −0
Original line number Diff line number Diff line
//==========================================================================
//  Zero Degree Calorimeter Detector implementation 
//--------------------------------------------------------------------------
//  Build two towers of ZDC - small and large
//  Sampling type calorimeter
//  J.KIM
//  Created  2020-07-21 
//  Modified 2020-07-22
//==========================================================================
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include <XML/Helper.h>
#include "TMath.h"
#include "DDRec/Surface.h"
#include "DDRec/DetectorData.h"
#include "XML/Layering.h"
#include "Math/Transform3D.h"

using namespace std;
using namespace dd4hep;
using namespace dd4hep::rec;
using namespace dd4hep::detail;

/** \addtogroup calorimeters Calorimeters 
 */

/** \addtogroup ZeroDegreeCalorimeter Zero-degree calorimeter
 * \brief Type: **ZeroDegreeCAL**.
 * \author J. Kim
 * \ingroup calorimeters
 *
 *
 * \code
 *  	<detector id="2" name="largeZDC" type="ZDC" readout="ZDCHits" vis="RedVis">
 *   
 * \endcode
 *
 * @{
 */
static Ref_t createDetector(Detector& lcdd, xml_h e, SensitiveDetector sens) {
  	xml_det_t  x_det     = e;
	int        det_id    = x_det.id();
  	string     det_name  = x_det.nameStr();
  	xml_dim_t  pos       = x_det.position();
  	double     x_pos     = dd4hep::getAttrOrDefault(pos, _Unicode(x),0.0);
  	double     y_pos     = dd4hep::getAttrOrDefault(pos, _Unicode(y),0.0);
  	double     z_pos     = dd4hep::getAttrOrDefault(pos, _Unicode(z),0.0);
	xml_dim_t  dim       = x_det.dimensions();
	double     pixel_x   = dim.x();
	double     pixel_y   = dim.y();
	Material   air       = lcdd.material("Air");	
	double     z         = z_pos;
	double     zmin      = z_pos;
	DetElement det(det_name, det_id);
	
	int layer_num = 1;
	int slice_num = 1;
	double totWidth = Layering(x_det).totalThickness();
	Box envelope (pixel_x/2.0, pixel_y/2.0,totWidth);
	Volume envelopeVol(det_name+"_envelope",envelope,air); 
	PlacedVolume pv;
	
	xml_comp_t x_layer = x_det.child(_U(layer));

	// 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;
		for(xml_coll_t l(x_layer,_U(slice)); l; ++l)
			layerWidth += xml_comp_t(l).thickness();

		// Loop over repeat#
		for(int i=0; i< repeat; i++)
		{
			double zlayer = z;
			string layer_name = det_name + _toString(layer_num,"_layer%d");
			Volume layer_vol(layer_name,Box(pixel_x/2.0, pixel_y/2.0,layerWidth/2.0),air);

			// 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 = lcdd.material(x_slice.materialStr());		
				Volume slice_vol (slice_name,Box(pixel_x/2.0, pixel_y/2.0,w/2.0),slice_mat);
				if(x_slice.isSensitive())
				{
					sens.setType("calorimeter");
					slice_vol.setSensitiveDetector(sens);
				}
				slice_vol.setAttributes(lcdd,x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
				pv = layer_vol.placeVolume(slice_vol, Transform3D(RotationZYX(0.0,0.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(x_layer, _Unicode(vis), "InvisibleWithDaughters");
			layer_vol.setAttributes(lcdd, x_layer.regionStr(), x_layer.limitsStr(), layer_vis);
			pv = envelopeVol.placeVolume(layer_vol, Transform3D(RotationZYX(0.0,0.0,0.0), Position(0,0,zlayer-zmin-totWidth/2.0+layerWidth/2.0)));
			pv.addPhysVolID("layer", layer_num);
			++layer_num;
		}
	}
	envelopeVol.setAttributes(lcdd,x_det.regionStr(), x_det.limitsStr(), "InvisibleWithDaughters");

	Volume motherVol = lcdd.pickMotherVolume(det);
	PlacedVolume phv = motherVol.placeVolume(envelopeVol, Position(x_pos,y_pos,z_pos+totWidth/2.0));
	phv.addPhysVolID("system", det.id());
	det.setPlacement(phv);

	return det;
}

DECLARE_DETELEMENT(topsideZDC, createDetector)
+5 −2
Original line number Diff line number Diff line
@@ -106,15 +106,18 @@
  </display>

  <!--
  <include ref="topside/vertex_tracker.xml"/>
  -->
  <include ref="topside/beampipe.xml"/>
  <include ref="topside/vertex_tracker.xml"/>
  <include ref="topside/silicon_tracker.xml"/>
  <include ref="topside/ecal.xml"/>
  <include ref="topside/hcal.xml"/>
  <include ref="topside/solenoid.xml"/>
  <include ref="topside/topside_rich.xml"/>
  <include ref="topside/forward_rich.xml"/>
  <include ref="topside/zero_degree_cal.xml"/>
  <!--
  <include ref="topside/roman_pots.xml"/>
  -->
  <include ref="eic/forward_ion_beamline.xml"/>
  <!--
  -->
Original line number Diff line number Diff line
  <display>

    <vis name="Argonne_Green"        alpha="1" r="119/255" g="179/255" b="0"/>
    <vis name="Argonne_Violet"       alpha="1" r="91/256" g="0" b="145/256"/>
    <vis name="Argonne_Process_Blue" alpha="1" r="0/256" g="130/256" b="202/256"/>
    <vis name="Argonne_Orange"       alpha="1" r="255/256" g="121/256" b="0"/>
    <vis name="Argonne_Red"          alpha="1" r="205/256" g="32/256" b="44/256"/>
    <vis name="Argonne_Gold"         alpha="1" r="248/256" g="178/256" b="0/256"/>
    <vis name="Argonne_Blue"         alpha="1" r="0/256" g="96/256" b="156/256"/>
    <vis name="Argonne_Teal"         alpha="1" r="0/256" g="161/256" b="156/256"/>
    <vis name="Argonne_Gray"         alpha="1" r="102/256" g="102/256" b="102/256"/>
    <vis name="Argonne_Light_Gray"   alpha="1" r="209/256" g="209/256" b="209/256"/>
    <vis name="Argonne_Off_White"    alpha="1" r="242/256" g="242/256" b="242/256"/>
    <vis name="Argonne_Delta_Red"    alpha="1" r="161/256" g="43/256" b="47/256"/>
    <vis name="Argonne_Delta_Green"  alpha="1" r="0" g="120/256" b="54/256"/>
    <vis name="Argonne_Delta_Blue"   alpha="1" r="11/256" g="31/256" b="143/256"/>

    <vis name="Argonne_Red_1"        alpha="0.5" r="205/256" g="32/256" b="44/256"/>

    <comment>Tracker_Layer_Vis is Argonne_Gold</comment>
    <vis name="Tracker_Layer_Vis"  alpha="0.5" r="248/256" g="178/256" b="0/256" showDaughters="true" />

    <vis name="InvisibleNoDaughters"      showDaughters="false" visible="false"/>
    <vis name="InvisibleWithDaughters"    showDaughters="true" visible="false"/>

    <vis name="SiVertexVis" alpha="0.9" r="1" g="0" b="1" showDaughters="true" />
    <vis name="SiTrackerBarrelVis" alpha="0.01" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="false"/>
    <vis name="SiTrackerVis" alpha="0.5" r="1.0" g="0.0" b="0.0" showDaughters="false" />
    <vis name="SiTrackerBarrelVis" alpha="0.5" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/>
    <vis name="SiTrackerVis" alpha="0.9" r="1.0" g="0.0" b="0.0" showDaughters="true" lineStyle="solid"  drawingStyle="solid" />
    <vis name="TrackerLayerVis" alpha="0.9" r="0.0" g="1.0" b="0.0" visible="true"  showDaughters="true" />

    <vis name="SiTrackerBarrelVis1" alpha="0.8" r="0.0" g="0.9" b="0.9" showDaughters="true" />
    <vis name="SiTrackerBarrelVis2" alpha="0.8" r="0.1" g="0.9" b="0.0" showDaughters="true" visible="true"/>
    <vis name="SiTrackerEndcapVis1" alpha="0.8" r="1.0" g="0.0" b="1.0" showDaughters="true" visible="true"/>
    <vis name="SiTrackerEndcapVis2" alpha="0.8" r="1.0" g="0.45" b="0.0" showDaughters="false" visible="true"/>
    <vis name="SiTrackerSubAssemblyVis" alpha="1" r="0.0" g="0.99" b="0.0" showDaughters="true" visible="true"/>
    <vis name="SiTrackerLayerVis" alpha="1" r="0.0" g="1" b="0.0" showDaughters="true" visible="true"  lineStyle="solid"  drawingStyle="solid" />

    <vis name="EcalVis" alpha="0.1" r="0.0" g="0.75" b="0.1" showDaughters="false"/>
    <vis name="EcalEndcapVis" alpha="1.0" r="0.0" g="0.99" b="0.0" showDaughters="false" visible="true" />
    <vis name="EcalBarrelVis" alpha="1.0" r="0.0" g="0.99" b="0.0" showDaughters="false" visible="true" />
    <vis name="HcalVis" alpha="0.9" r="0.75" g="0.0" b="0.0" showDaughters="false"/>
    <vis name="HcalBarrelVis" alpha="1.0" r="0.0" g="0.0" b="0.99" showDaughters="false" visible="true" />
    <vis name="HcalEndcapVis" alpha="1.0" r="0.0" g="0.0" b="0.99" showDaughters="false" visible="true" />

    <vis name="SolenoidCoilVis" alpha="1.0" r="0.55" g="0.55" b="0.7" showDaughters="true" visible="true" lineStyle="solid" drawingStyle="solid" />
    <vis name="SolenoidCryostatVis" alpha="0.4" r="0.55" g="0.55" b="0.7" showDaughters="true" visible="true" lineStyle="solid" drawingStyle="solid" />
    <vis name="SolenoidYokeVis" alpha="0.2" r="0.8" g="0.1" b="0.1" showDaughters="false" visible="true" lineStyle="solid"  drawingStyle="solid" />
    <vis name="RICHVis" alpha="0.5" r="1" g="0" b="1" showDaughters="false"/>
    <vis name="InvisibleNoDaughters"      showDaughters="false" visible="false"/>
    <vis name="InvisibleWithDaughters"    showDaughters="true" visible="false"/>
    <vis name="BeamPipeVis"    alpha="1"  r= "0.75" g="0.75" b="0.75" showDaughters="true" visible="true"/>


    <comment>
      Deprecated colors.
    </comment>
    <vis name="GreenVis"       alpha="0.2"  r= "0.0" g="1.0" b="0.0" showDaughters="true" visible="true"/>
    <vis name="RedVis"         alpha="0.2"  r= "1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
    <vis name="RPVis"          alpha="0.99"  r= "1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
@@ -28,5 +66,4 @@
    <vis name="RBG510"         alpha="0.5"  r= "1.0" g=".2"  b="0.0" showDaughters="true" visible="true"/>
    <vis name="RBG"            alpha="0.5"  r= "1.0" g="1.0" b="1.0" showDaughters="true" visible="true"/>
    <vis name="GrayVis"        alpha="0.5"  r= "0.75" g="0.75" b="0.75" showDaughters="true" visible="true"/>
    <vis name="BeamPipeVis"    alpha="1"  r= "0.75" g="0.75" b="0.75" showDaughters="true" visible="true"/>
  </display>
+22 −52
Original line number Diff line number Diff line
<lccdd>

  <define>

    <constant name="CrystalEndcap_rmin"  value="120.0*mm"/>
    <constant name="CrystalEndcap_rmin"  value="VertexTrackerInnerRadius"/>
    <constant name="CrystalEndcap_rmax"  value="EcalEndcapN_rmin"/>
    <constant name="CrystalBox_x_length" value="20.0*mm"/>
    <constant name="CrystalBox_y_length" value="20.0*mm"/>
    <constant name="CrystalBox_z_length" value="200.0*mm"/>
    <constant name="CrystalBox_offset"   value="0.000001*mm"/>
    <constant name="CrystalEndcap_x_pos" value="0.0*m"/>
    <constant name="CrystalEndcap_y_pos" value="0.0*m"/>
    <constant name="CrystalEndcap_z_pos" value="-EcalEndcap_zmin"/>
@@ -23,7 +23,15 @@
  <display>
  </display>

  <include ref="ecal_barrel.xml"/>

  <detectors>
    <comment>
    -------------------
    Dummy Plane Tracker
    -------------------
    Plane tracker that gives momentum of incident particles before crystal endcap calorimeter (backward)
    </comment>

    <comment>
      -------------------
@@ -34,53 +42,13 @@
    <detector 
      id="CrystalEndcap_ID" 
      name="ElectronECAL" 
      type="Crystal" 
      type="CrystalCalorimeterEndcap" 
      readout="CrystalEcalHits" 
      vis="GreenVis">
      <position x="CrystalEndcap_x_pos" y="CrystalEndcap_y_pos" z="CrystalEndcap_z_pos" />
      <dimensions rmin="CrystalEndcap_rmin" rmax="CrystalEndcap_rmax" x="CrystalBox_x_length" y="CrystalBox_y_length" z="CrystalBox_z_length"/>
      <dimensions rmin="CrystalEndcap_rmin" rmax="CrystalEndcap_rmax" x="CrystalBox_x_length" y="CrystalBox_y_length" z="CrystalBox_z_length" delta="CrystalBox_offset"/>
    </detector>

    <comment>
      ---------------------
      Barrel EM Calorimeter
      ---------------------
      A layered EM calorimeter with tungsten and silicon (or scintillator) strips
    </comment>
    <detector 
      id="ECalBarrel_ID"
      name="EcalBarrel"
      type="DD4hep_EcalBarrel"
      readout="EcalBarrelHits"
      calorimeterType="EM_BARREL">
      <dimensions 
        numsides="CaloSides" 
        rmin="EcalBarrel_rmin" 
        z="EcalBarrelLength"/>
      <staves vis="EcalBarrelVis"/>
      <layer repeat="1">
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Copper" thickness="EcalCopperThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Kapton" thickness="EcalKaptonThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      <layer repeat="EcalThinLayers">
        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Copper" thickness="EcalCopperThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Kapton" thickness="EcalKaptonThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      <layer repeat="EcalThickLayers">
        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"  sensitive="yes" limits="cal_limits"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Copper" thickness="EcalCopperThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Kapton" thickness="EcalKaptonThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
    </detector>

    <comment>
      -----------------------------
@@ -106,7 +74,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      <layer repeat="EcalThinLayers">
      <layer repeat="EcalEndcapThinLayers">
        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -114,7 +82,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      <layer repeat="EcalThickLayers">
      <layer repeat="EcalEndcapThickLayers">
        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -149,7 +117,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      <layer repeat="EcalThinLayers">
      <layer repeat="EcalEndcapThinLayers">
        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -157,7 +125,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      <layer repeat="EcalThickLayers">
      <layer repeat="EcalEndcapThickLayers">
        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -170,14 +138,16 @@

  <!--  Definition of the readout segmentation/definition  -->
  <readouts>
    <!--  
    <readout name="PlaneTrackerHits">
      <segmentation type="CartesianGridXY" grid_size_x="20.0*mm" grid_size_y="20.0*mm" />
      <id>system:5,module:4,x:32:-16,y:-16</id>
    </readout>
    -->
    <readout name="CrystalEcalHits">
      <segmentation type="CartesianGridXY" grid_size_x="CrystalBox_x_length" grid_size_y="CrystalBox_y_length" />
      <id>system:8,sector:4,module:20,x:48:-8,y:-8</id>
    </readout>
    <readout name="EcalBarrelHits">
      <segmentation type="CartesianGridXY" grid_size_x="3.5 * mm" grid_size_y="3.5 * mm"/>
      <id>system:8,barrel:3,module:4,layer:6,slice:5,x:32:-16,y:-16</id>
    </readout>
    <readout name="EcalEndcapHits">
      <segmentation type="CartesianGridXY" grid_size_x="3.5 * mm" grid_size_y="3.5 * mm"/>
      <id>system:8,barrel:3,module:4,layer:6,slice:5,x:32:-16,y:-16</id>
+53 −0
Original line number Diff line number Diff line
<lccdd>

  <define>
    <constant name="EcalBarrelLayers_nMax"  value="20"/>
  </define>

  <limits>
  </limits>

  <regions>
  </regions>

  <display>
  </display>

  <detectors>

    <comment>
      ---------------------
      Barrel EM Calorimeter
      ---------------------
      A layered EM calorimeter with tungsten and silicon (AstroPix)
    </comment>
    <detector
      id="ECalBarrelAstroPix_ID"
      name="EcalBarrel"
      type="DD4hep_EcalBarrel"
      readout="EcalBarrelHits"
      calorimeterType="EM_BARREL">
      <dimensions numsides="EcalBarrelAstroPix_ModRepeat" rmin="EcalBarrelAstroPix_RMin" z="EcalBarrelAstroPix_Length"/>
      <staves vis="EcalBarrelVis"/>
      <layer repeat="EcalBarrelAstroPix_ReadoutLayerNumber">
        <slice material="Silicon" thickness="EcalBarrelAstroPix_SiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Silicon" thickness="EcalBarrelAstroPix_ElectronicsThickness"/>
        <slice material="Copper" thickness="EcalBarrelAstroPix_CopperThickness"/>
        <slice material="Kapton" thickness="EcalBarrelAstroPix_KaptonThickness"/>
        <slice material="Epoxy" thickness="EcalBarrelAstroPix_EpoxyThickness"/>
        <slice material="CarbonFiber" thickness="EcalBarrelAstroPix_CarbonThickness"/>
        <slice material="TungstenDens24" thickness="EcalBarrelAstroPix_TungstenThickness"/>
        <slice material="Air" thickness="EcalBarrelAstroPix_LayerSpacing - EcalBarrelAstroPix_TungstenThickness"/>
      </layer>
    </detector>
  </detectors>

  <readouts>
    <readout name="EcalBarrelHits">
      <segmentation type="CartesianGridXY" grid_size_x="0.5 * mm" grid_size_y="0.5 * mm"/>
      <id>system:8,barrel:3,module:4,layer:10,slice:5,x:32:-16,y:-16</id>
    </readout>
  </readouts>


</lccdd>
Original line number Diff line number Diff line
@@ -5,18 +5,19 @@

  <detectors>
    <detector id="ForwardRICH_ID" name="ForwardRICH" type="ForwardRICH" readout="ForwardRICHHits" vis="BlueVis">
      <dimensions z0="RICHZMin" />
      <mcppmt zdiff="1.0*cm" rmin="RICHRMin" rmax="RICHRMin+60*cm" rtol="1.0*cm" vis="BlueVis"
              module_size="10*cm" module_gap="0.2*cm" thickness="1.0*cm" material="Quartz" />
      <dimensions z0="RICHZMin" length="RICHDepth+20*cm" rmin="RICHRMin" rmax1="RICHRMin+40*cm" rmax2="RICHRMin+80*cm"/>
      <radiator material="N2cherenkov" />
      <mcppmt zdiff="25.0*cm" rmin="SolenoidYokeEndcapP_rmin-10*cm" rmax="SolenoidYokeEndcapP_rmin+80*cm" rtol="1.0*cm"
              vis="BlueVis" module_size="10*cm" module_gap="0.2*cm" thickness="1.0*cm" material="Quartz" />
      <tank zdiff="5.0*cm" length="RICHDepth" gas="N2cherenkov" vis="GreenVis"
            rmin="RICHRMin" rmax1="RICHRMin+40*cm" rmax2="RICHRMin+80*cm" />
      <mirror zdiff="RICHDepth+7.0*cm" thickness="1*mm" material="PyrexGlass" vis="GrayVis">
        <slice focus="50*cm" curve="0" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="0*degree" />
        <slice focus="50*cm" curve="0" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="60*degree" />
        <slice focus="50*cm" curve="0" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="120*degree" />
        <slice focus="50*cm" curve="0" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="180*degree" />
        <slice focus="50*cm" curve="0" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="240*degree" />
        <slice focus="50*cm" curve="0" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="300*degree" />
      <mirror zdiff="RICHDepth+7.0*cm" thickness="1*mm" material="PyrexGlass" vis="GrayVis" env_length="40*cm">
        <slice focus="10*cm" curve="300*cm" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="0*degree" />
        <slice focus="10*cm" curve="300*cm" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="60*degree" />
        <slice focus="10*cm" curve="300*cm" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="120*degree" />
        <slice focus="10*cm" curve="300*cm" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="180*degree" />
        <slice focus="10*cm" curve="300*cm" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="240*degree" />
        <slice focus="10*cm" curve="300*cm" rmin="RICHRMin" rmax="RICHRMin+80*cm" phiw="59*degree" rotz="300*degree" />
      </mirror>
    </detector>
  </detectors>
@@ -24,7 +25,7 @@
  <readouts>
    <readout name="ForwardRICHHits">
      <segmentation type="CartesianGridXY" grid_size_x="3*mm" grid_size_y="3*mm" />
      <id>system:5,layer:4,module:14,x:32:-16,y:-16</id>
      <id>system:8,layer:4,piece:4,module:14,x:32:-16,y:-16</id>
    </readout>
  </readouts>

Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
        rmin="HcalBarrel_rmin" 
        z="HcalBarrelLength"/>
      <staves vis="HcalBarrelVis"/>
      <layer repeat="HcalLayers">
      <layer repeat="HcalBarrelLayers">
        <slice material="Steel235" thickness="HcalSteelThickness"/>
        <slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
        <slice material="RPCGasDefault" thickness="HcalRPCGasThickness" sensitive="yes" limits="cal_limits"/>
@@ -51,7 +51,7 @@
        zmin="HcalEndcap_zmin" 
        rmin="HcalEndcapP_rmin"
        rmax="HcalBarrel_rmax"/>
      <layer repeat="HcalLayers" vis="HcalEndcapVis" >
      <layer repeat="HcalEndcapLayers" vis="HcalEndcapVis" >
        <slice material="Steel235" thickness="HcalSteelThickness"/>
        <slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
        <slice material="RPCGasDefault" thickness="HcalRPCGasThickness" sensitive="yes" limits="cal_limits"/>
@@ -73,7 +73,7 @@
        zmin="HcalEndcap_zmin" 
        rmin="HcalEndcapN_rmin" 
        rmax="HcalBarrel_rmax"/>
      <layer repeat="HcalLayers" vis="HcalEndcapVis" >
      <layer repeat="HcalEndcapLayers" vis="HcalEndcapVis" >
        <slice material="Steel235" thickness="HcalSteelThickness"/>
        <slice material="PyrexGlass" thickness="HcalPyrexThickness"/>
        <slice material="RPCGasDefault" thickness="HcalRPCGasThickness" sensitive="yes" limits="cal_limits"/>
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@
    <vis name="GrayVis"        alpha="0.5"  r= "0.75" g="0.75" b="0.75" showDaughters="true" visible="true"/>
  </display>

  <include ref="topside/topside_rich.xml"/>
  <include ref="topside/forward_rich.xml"/>
  <!--
  <include ref="topside/vertex_tracker.xml"/>
  <include ref="topside/silicon_tracker.xml"/>
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
    <detector 
      id="ForwardRomanPot_ID" 
      name="RomanPot1" 
      type="RomanPot" 
      type="topside_RomanPot" 
      readout="ForwardRomanPotHits" 
      vis="RPVis">
      <position x="20.0*cm+ CrossingSlope*30.0*m" y="0.0" z="30.0*m" z_offset="0.0*m" rotation="true" vmax="5*cm" v="2*cm" />
@@ -23,7 +23,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="BlueVis" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+1" name = "RomanPot2" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+1" name = "RomanPot2" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="20.0*cm+ CrossingSlope*30.5*m" y="0.0" z="30.5*m" z_offset="0.0*m" rotation="true" vmax="10*cm" v="2*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
      <frame x="20.0*cm" y="20.0*cm" z="2*cm" />
@@ -33,7 +33,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+2" name = "RomanPot3" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+2" name = "RomanPot3" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="30.0*cm+ CrossingSlope*33.0*m" y="0.0" z="33.0*m" z_offset="0.0*m" rotation="true" vmax="10*cm" v="2.5*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
      <frame x="40.0*cm" y="30.0*cm" z="2*cm" />
@@ -43,7 +43,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+3" name = "RomanPot4" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+3" name = "RomanPot4" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="30.0*cm+ CrossingSlope*33.5*m" y="0.0" z="33.5*m" z_offset="0.0*m" rotation="true" vmax="10*cm" v="2.5*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
      <frame x="40.0*cm" y="30.0*cm" z="2*cm" />
@@ -53,7 +53,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+4" name = "RomanPot44" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+4" name = "RomanPot44" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="40.0*cm+ CrossingSlope*(B2PF_CenterPosition-B2PF_Length/2.0-0.6*m)" y="0.0" z="B2PF_CenterPosition-B2PF_Length/2.0-0.6*m" 
        z_offset="0.0*m" rotation="true" vmax="10*cm" v="2.0*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
@@ -64,7 +64,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+5" name = "RomanPot45" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+5" name = "RomanPot45" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="40.0*cm+ CrossingSlope*(B2PF_CenterPosition-B2PF_Length/2.0-0.3*m)" y="0.0" z="(B2PF_CenterPosition-B2PF_Length/2.0-0.3*m)" 
        z_offset="0.0*m" rotation="true" vmax="10*cm" v="2.0*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
@@ -75,7 +75,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+6" name = "RomanPot46" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+6" name = "RomanPot46" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="45.0*cm+ CrossingSlope*(QPFC1_CenterPosition-QPFC1_Length/2.0 - 0.3*m)" y="0.0" z="(QPFC1_CenterPosition-QPFC1_Length/2.0 - 0.3*m)" 
        z_offset="0.0*m" rotation="true" vmax="10*cm" v="3.0*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
@@ -86,7 +86,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+7" name = "RomanPot47" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+7" name = "RomanPot47" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="45.0*cm+ CrossingSlope*(QPFC1_CenterPosition-QPFC1_Length/2.0 - 0.6*m)" y="0.0" z="(QPFC1_CenterPosition-QPFC1_Length/2.0 - 0.6*m)" 
        z_offset="0.0*m" rotation="false" vmax="10*cm" v="5.0*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
@@ -97,7 +97,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+8" name = "RomanPot48" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+8" name = "RomanPot48" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="45.0*cm+ CrossingSlope*(QPFC2_CenterPosition-QPFC2_Length/2.0 - 0.6*m)" y="0.0" z="(QPFC2_CenterPosition-QPFC2_Length/2.0 - 0.6*m)" 
        z_offset="0.0*m" rotation="true" vmax="10*cm" v="1.0*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
@@ -108,7 +108,7 @@
        <slice material="Vacuum"  thickness="1.0*mm"  vis="InvisibleWithDaughters" />
      </layer>
    </detector>
    <detector id="ForwardRomanPot_ID+9" name = "RomanPot49" type="RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
    <detector id="ForwardRomanPot_ID+9" name = "RomanPot49" type="topside_RomanPot" readout="ForwardRomanPotHits" vis = "InvisibleWithDaughters">
      <position x="45.0*cm+ CrossingSlope*(QPFC2_CenterPosition-QPFC2_Length/2.0 - 0.3*m)" y="0.0" z="(QPFC2_CenterPosition-QPFC2_Length/2.0 - 0.3*m)" 
        z_offset="0.0*m" rotation="false" vmax="10*cm" v="1.0*cm" />
      <dimensions x="10.0*cm" y="10.0*cm" delta="0.005*cm" />
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@
  </detectors>

  <fields>
    <field type="solenoid" name="GlobalSolenoid" inner_field="2.5 * tesla" outer_field="0.5*tesla" 
    <field type="solenoid" name="GlobalSolenoid" inner_field="1.5 * tesla" outer_field="0.5*tesla" 
           zmin="-SolenoidCoil_zmax" zmax="SolenoidCoil_zmax" 
           inner_radius="SolenoidalFieldRadius" outer_radius="SolenoidalFieldRadius+20*cm"/>
  </fields>
Original line number Diff line number Diff line
@@ -11,88 +11,227 @@
    <constant name="world_y" value="world_side"/>
    <constant name="world_z" value="100*m"/>

    <constant name="mil" value="0.0254*mm"/>

    <comment>
      ------------
      Detector IDs
      ------------
      Note: The tracking surfaces need to be structured in a barrel + endcapP + endcapN where 

      Note about ACTS tracking geometry construction
      ----------------------------------------------

      The tracking surfaces need to be structured in a barrel + endcapP + endcapN where 
      endcapP/endcapN are the endcaps at positive/negative z values. 
      See https://acts.readthedocs.io/en/latest/plugins/dd4hep.html for more details.

      The tracking geometry needs to beconstructed from cylinders from the inside out. For this reason
      each layer needs its own subsystem assembly. This increases the number of top level system IDs. 
      For example the silicon tracker needs 3 IDs for each area (endcap+barrel+endcap) and a subassembly for each
      layer. Therefore it needs a minimum of 20 IDs. Therefore we will allocate blocks of ~25 for each major subsystem.
      Note, future improvements will likely include a more sophisticated ACTS-dd4hep plugin, 
      eliminating the need for so many system IDs at construction time.

      This barrel/endcap structure needs IDs to be in increasing order going outward. 
      The space of IDs for the subassemblies starts at (Subassembly_ID*10+101).

      The unused IDs below are saved for future use.
    </comment>

    <comment> Unused IDs: 1 </comment>

    <comment> Silicon Vertex Tracker
      SiVertex subsystem  ID: 2
      Barrel  subassembly ID: 121      
      EndcapP subassembly ID: 122      
      EndcapN subassembly ID: 123
    <comment> 
      ===================
      (1-9) Reserved IDs
      ===================
      Unused IDs: 1-9 

      ====================================
      (10-24) Interaction region beamline 
      ====================================

      Beampipe ID : 10
      Unused   IDs: 11-24

    </comment> 
    <constant name="BeamPipe_ID" value="10"/>


    <comment> 
      ===============================
      (25-49) Silicon Vertex Tracker
      ===============================
      SiVertex subsystem  ID: 25 
      Layer 1 subassembly ID: 26
      Layer 2 subassembly ID: 27
      Layer 3 subassembly ID: 28
      Layer 4 subassembly ID: 29
      Layer 5 subassembly ID: 30
    </comment>
    <constant name="SiVertexSubAssembly_ID" value="25"/>
    <comment>
      Unused values reserved for vertex:
      constant name="SiVertexSubAssemblyLayer1_ID" value="121"
      constant name="SiVertexSubAssemblyLayer2_ID" value="122"
      constant name="SiVertexSubAssemblyLayer3_ID" value="123"
      constant name="SiVertexSubAssemblyLayer4_ID" value="124"
      constant name="SiVertexSubAssemblyLayer5_ID" value="125"
    </comment>

    <comment>
      ===============================
      (50-74) Silicon Tracker System
      ===============================

      SiTracker subsystem  ID: 50
      Layer 1 subassembly  ID: 51      
      Layer 2 subassembly  ID: 52      
      Layer 3 subassembly  ID: 53
      Layer 4 subassembly  ID: 54
      Layer 5 subassembly  ID: 55

      (56-70) etc...

      Unused IDs: 71-74

    </comment>

    <constant name="SiTrackerSubAssembly_ID" value="50"/>
    <constant name="SiTrackerSubAssemblyLayer1_ID" value="51"/>
    <constant name="SiTrackerSubAssemblyLayer2_ID" value="52"/>
    <constant name="SiTrackerSubAssemblyLayer3_ID" value="53"/>
    <constant name="SiTrackerSubAssemblyLayer4_ID" value="54"/>
    <constant name="SiTrackerSubAssemblyLayer5_ID" value="55"/>

    <constant name="SiTrackerBarrel_Layer1_ID"      value="56"/>
    <constant name="SiTrackerEndcapP_Layer1_ID"     value="57"/>
    <constant name="SiTrackerEndcapN_Layer1_ID"     value="58"/>

    <constant name="SiTrackerBarrel_Layer2_ID"      value="59"/>
    <constant name="SiTrackerEndcapP_Layer2_ID"     value="60"/>
    <constant name="SiTrackerEndcapN_Layer2_ID"     value="61"/>

    <constant name="SiTrackerBarrel_Layer3_ID"      value="62"/>
    <constant name="SiTrackerEndcapP_Layer3_ID"     value="63"/>
    <constant name="SiTrackerEndcapN_Layer3_ID"     value="64"/>

    <constant name="SiTrackerBarrel_Layer4_ID"      value="65"/>
    <constant name="SiTrackerEndcapP_Layer4_ID"     value="66"/>
    <constant name="SiTrackerEndcapN_Layer4_ID"     value="67"/>

    <constant name="SiTrackerBarrel_Layer5_ID"      value="68"/>
    <constant name="SiTrackerEndcapP_Layer5_ID"     value="69"/>
    <constant name="SiTrackerEndcapN_Layer5_ID"     value="70"/>

    <comment> 
    ===================
    (75-99 Reserved IDs
    ===================

    Unused IDs: 75-99 
    TBD 
    </comment>
    <constant name="SiVertexSubAssembly_ID" value="2"/>
    <constant name="SiVertexBarrel_ID"      value="121"/>
    <constant name="SiVertexEndcapP_ID"     value="122"/>
    <constant name="SiVertexEndcapN_ID"     value="123"/>

    <comment> Silicon Tracker System
      SiTracker subsystem  ID: 3
      Barrel   subassembly ID: 131
      EndcapP  subassembly ID: 132
      EndcapN  subassembly ID: 133

    <comment> 
      =====================================
      (100-109) Electromagnetic Calorimeter
      =====================================

      ECal     subsystem  ID:  100
      Barrel   subassembly ID: 101
      EndcapP  subassembly ID: 102
      EndcapN  subassembly ID: 103
      Crystal  subassembly ID: 104

      Barrel AstroPix ID: 105
      Unused IDs: 106-109

    </comment>
    <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="ECalBarrelAstroPix_ID" value="105"/>

    <comment> 
      =====================================
      (110-119Hadronic Calorimeter
      =====================================

      HCal     subsystem  ID:  110
      Barrel   subassembly ID: 111
      EndcapP  subassembly ID: 112
      EndcapN  subassembly ID: 113

      Unused IDs: 114-119
    </comment>
    <constant name="HCalSubAssembly_ID" value="110"/>
    <constant name="HCalBarrel_ID"      value="111"/>
    <constant name="HCalEndcapP_ID"     value="112"/>
    <constant name="HCalEndcapN_ID"     value="113"/>

    <comment> 
      =====================================
      (120-129) (near) Forward reserved
      =====================================

      Forwardtracking ID: 120
      Forward RICH    ID: 121

      Unused IDs: 122-129
    </comment>
    <constant name="SiTrackerSubAssembly_ID" value="3"/>
    <constant name="SiTrackerBarrel_ID"      value="131"/>
    <constant name="SiTrackerEndcapP_ID"     value="132"/>
    <constant name="SiTrackerEndcapN_ID"     value="133"/>

    <comment> Unused ID: 4 </comment>

    <comment> Electromagnetic Calorimeter
      ECal     subsystem  ID:  5
      Barrel   subassembly ID: 151
      EndcapP  subassembly ID: 152
      EndcapN  subassembly ID: 153
    <constant name="ForwardTracking_ID" value="120"/>
    <constant name="ForwardRICH_ID"     value="121"/>

    <comment> 
      =====================================
      (130-139) Backward reserved
      =====================================

      TBD

    </comment>
    <constant name="ECalSubAssembly_ID" value="5"/>
    <constant name="ECalBarrel_ID"      value="151"/>
    <constant name="ECalEndcapP_ID"     value="152"/>
    <constant name="ECalEndcapN_ID"     value="153"/>
    <constant name="CrystalEndcap_ID"   value="154"/>

    <comment> Hadronic Calorimeter
      HCal     subsystem  ID:  6
      Barrel   subassembly ID: 601
      EndcapP  subassembly ID: 602
      EndcapN  subassembly ID: 603

    <comment> 
      =====================================
      (140-149) Central Magnet
      =====================================

      Solenoid         ID: 140
      Solenoid support ID: 141
      Solenoid Yoke    ID: 142

      Unused IDs: 143-149

    </comment>
    <constant name="HCalSubAssembly_ID" value="6"/>
    <constant name="HCalBarrel_ID"      value="161"/>
    <constant name="HCalEndcapP_ID"     value="162"/>
    <constant name="HCalEndcapN_ID"     value="163"/>
    <constant name="Solenoid_ID"             value="140"/>
    <constant name="SolenoidSupport_ID"      value="141"/>
    <constant name="SolenoidYoke_ID"         value="142"/>

    <comment> Unused IDs: 7 - 9 </comment>
    <comment> 
      =====================================
      (150-169) Far Forward  Detectors
      =====================================

    <constant name="ForwardTracking_ID" value="10"/>
    <constant name="ForwardRICH_ID"     value="11"/>
    <comment> Unused IDs: 12-14 </comment>
      Forward Roman Pot ID: 150
      Zero Degree Cal.  ID: 160

    <constant name="BeamPipe_ID" value="15"/>
    <comment> Unused IDs: 16-19 </comment>
    </comment>
    <constant name="ForwardRomanPot_ID" value="150"/>
    <constant name="ZDC_lt_ID"          value="160"/>

    <constant name="ForwardRomanPot_ID" value="20"/>
    <comment> Unused IDs: 21-29 </comment>
    <comment> 
      =====================================
      (170-189) Forward Beamline Magnets
      =====================================
    </comment>

    <constant name="ZDC_ID"             value="30"/>
    <comment> Unused IDs: 31-39 </comment>
    <comment> 
      =====================================
      (190-199) Backward Beamline Magnets
      =====================================
    </comment>

    <constant name="Solenoid_ID"             value="40"/>
    <constant name="SolenoidSupport_ID"      value="41"/>
    <constant name="SolenoidYoke_ID"         value="42"/>
    <comment> Unused IDs: 43-49 </comment>


    <comment> 
@@ -178,30 +317,100 @@
    <constant name="SiliconTrackerOuterBarrelLength" value="SiliconTrackerOuterRadius*2"/>

    <comment>
      -------------------------
      EM Calorimeter Parameters
      -------------------------
      ------------
      Calorimeters
      ------------
    </comment>
    <constant name="CaloSides"                  value="12"/>
    <constant name="EcalBarrelThickness"        value="250.0*mm"/>
    <constant name="EcalBarrel_rmin"                       value="SiliconTrackerOuterRadius + 3.0 * cm"/>
    <constant name="EcalBarrel_rmax"            value="EcalBarrel_rmin + EcalBarrelThickness"/>
    <constant name="EcalBarrelLength"           value="SiliconTrackerOuterBarrelLength+50.0*cm"/>
    <constant name="HcalBarrel_rmax"                       value="Solenoid_rmin - 5.0 *cm "/>
    <constant name="AvailTotalBarrelCalorimetryThickness"  value="HcalBarrel_rmax - EcalBarrel_rmin"/>
    <constant name="CalBarrelDivider"                      value="0.5"/> <!-- Ecal and Hcal have the same thickness -->
    <constant name="EcalBarrelAvailTotalThickness"         value="AvailTotalBarrelCalorimetryThickness * CalBarrelDivider"/>
    <constant name="HcalBarrelAvailTotalThickness"         value="AvailTotalBarrelCalorimetryThickness * (1.0 - CalBarrelDivider)"/>

    <constant name="EcalBarrelLength"                      value="SiliconTrackerOuterBarrelLength+50.0*cm"/>
    <constant name="EcalEndcap_zmin"                       value="EcalBarrelLength/2.0"/>
    <constant name="EcalEndcapThickness"        value="EcalBarrelThickness"/>

    <constant name="AvailTotalEndcapCalorimetryThickness"  value="(SolenoidYokeEndcap_zmin - 10.0 * mm) - (EcalEndcap_zmin + 10.0 * mm)"/>
    <constant name="CalEndcapDivider"                      value="0.5"/> <!-- Ecal and Hcal have the same thickness -->
    <constant name="EcalEndcapAvailTotalThickness"         value="AvailTotalEndcapCalorimetryThickness * CalEndcapDivider"/>
    <constant name="HcalEndcapAvailTotalThickness"         value="AvailTotalEndcapCalorimetryThickness * (1.0 - CalEndcapDivider)"/>

    <constant name="EcalEndcapP_rmin"                      value="250.0*mm"/>
    <constant name="EcalEndcapN_rmin"                      value="350.0*mm"/>

    <constant name="EcalThinLayers"             value="10"/>
    <constant name="EcalThickLayers"            value="10"/>
    <constant name="EcalSiliconThickness"       value="0.32 * mm"/>
    <constant name="HcalEndcapP_rmin"                      value="250.0 * mm"/>
    <constant name="HcalEndcapN_rmin"                      value="350.0 * mm"/>

    <comment>
      -------------------------
      EM Calorimeter Parameters
      -------------------------
    </comment>
    <constant name="CaloSides"                  value="12"/>
	    
    <!-- Material Thickness --> 
    <constant name="EcalSiliconThickness"       value="9.00 * mm"/>
    <constant name="EcalCopperThickness"        value="0.05 * mm"/>
    <constant name="EcalKaptonThickness"        value="0.3 * mm"/>
    <constant name="EcalKaptonThickness"        value="0.30 * mm"/>
    <constant name="EcalAir1Thickness"          value="0.33 * mm"/>
    <constant name="EcalAir2Thickness"          value="0.25 * mm"/>
    <constant name="EcalThinTungstenThickness"  value="2.5 * mm"/>
    <constant name="EcalThickTungstenThickness" value="10 * mm"/>
    <constant name="EcalThinTungstenThickness"  value="2.50 * mm"/>
    <constant name="EcalThickTungstenThickness" value="5.00 * mm"/>
	    
    <!-- Layer Thickness  -->
    <constant name="EcalFirstLayerThickness"
	    value="EcalSiliconThickness + EcalCopperThickness + EcalKaptonThickness + EcalAir1Thickness"/>
    <constant name="EcalThinOneLayerThickness"   
	    value="EcalThinTungstenThickness + EcalAir2Thickness + EcalSiliconThickness + EcalCopperThickness + EcalKaptonThickness + EcalAir1Thickness"/>
    <constant name="EcalThickOneLayerThickness"   
	    value="EcalThickTungstenThickness + EcalAir2Thickness + EcalSiliconThickness + EcalCopperThickness + EcalKaptonThickness + EcalAir1Thickness"/>
	    
    <!-- EM Barrel N Layer; same number of layers for EcalThin and EcalThick -->
    <constant name="EcalBarrelLayers" 
	    value="floor((EcalBarrelAvailTotalThickness - EcalFirstLayerThickness) / (EcalThinOneLayerThickness + EcalThickOneLayerThickness))"/>
    <constant name="EcalBarrelThinLayers"       value="EcalBarrelLayers"/>
    <constant name="EcalBarrelThickLayers"      value="EcalBarrelLayers"/>
    <!-- EM Barrel Thickness -->
    <constant name="EcalBarrelThickness"
	    value="EcalFirstLayerThickness + (EcalBarrelThinLayers * EcalThinOneLayerThickness) + (EcalBarrelThickLayers * EcalThickOneLayerThickness)"/>
    <constant name="EcalBarrel_rmax"            value="EcalBarrel_rmin + EcalBarrelThickness"/>

    <!-- EM Endcap N Layer; same number of layers for EcalThin and EcalThick -->
    <constant name="EcalEndcapLayers" 
	    value="floor((EcalEndcapAvailTotalThickness - EcalFirstLayerThickness) / (EcalThinOneLayerThickness + EcalThickOneLayerThickness))"/>
    <constant name="EcalEndcapThinLayers"       value="EcalEndcapLayers"/>
    <constant name="EcalEndcapThickLayers"      value="EcalEndcapLayers"/>
    <!-- EM Endcap Thickness -->
    <constant name="EcalEndcapThickness"        
	    value="EcalFirstLayerThickness + (EcalEndcapThinLayers * EcalThinOneLayerThickness) + (EcalEndcapThickLayers * EcalThickOneLayerThickness)"/>

    <comment>
      ---------------------------------------
      EM Calorimeter Parameters with AstroPix
      ---------------------------------------
    </comment>
    <constant name="EcalBarrelAstroPix_RMin" value="EcalBarrel_rmin" />
    <constant name="EcalBarrelAstroPix_Length" value="EcalBarrelLength"/>

    <constant name="EcalBarrelAstroPix_SiliconThickness" value="500*um"/>
    <constant name="EcalBarrelAstroPix_ElectronicsThickness" value="150*um"/>
    <constant name="EcalBarrelAstroPix_CopperThickness" value="100*um"/>
    <constant name="EcalBarrelAstroPix_KaptonThickness" value="200*um"/>
    <constant name="EcalBarrelAstroPix_EpoxyThickness" value="100*um"/>
    <constant name="EcalBarrelAstroPix_CarbonThickness" value="0.5*mm"/>
    <constant name="EcalBarrelAstroPix_CarbonSpacerWidth" value="4*mm"/>
    <constant name="EcalBarrelAstroPix_LayerSpacing" value="10.0*mm"/>
    <constant name="EcalBarrelAstroPix_TungstenThickness" value="4.0*mm"/>

    <constant name="EcalBarrelAstroPix_ModRepeat" value="CaloSides"/> <comment> originally it was set to 8 </comment>
    <constant name="EcalBarrelAstroPix_ModLength" value="0.5*m"/>
    <constant name="EcalBarrelAstroPix_ModWidth" value="0.5*m"/>
    <constant name="EcalBarrelAstroPix_AvailThickness" value="EcalBarrelAvailTotalThickness"/>
    <constant name="EcalBarrelAstroPix_ReadoutLayerThickness"
	    value="EcalBarrelAstroPix_SiliconThickness+EcalBarrelAstroPix_ElectronicsThickness+EcalBarrelAstroPix_CopperThickness+EcalBarrelAstroPix_KaptonThickness+
	    EcalBarrelAstroPix_EpoxyThickness+EcalBarrelAstroPix_CarbonThickness+EcalBarrelAstroPix_LayerSpacing" />
    <constant name="EcalBarrelAstroPix_ReadoutLayerNumber" value="floor(EcalBarrelAstroPix_AvailThickness/EcalBarrelAstroPix_ReadoutLayerThickness)"/>

    <comment>
      -------------------------------
@@ -209,26 +418,29 @@
      -------------------------------
    </comment>
    <constant name="HcalBarrel_rmin"          value="EcalBarrel_rmax+10.0*mm"/>
    <constant name="HcalBarrel_rmax"     value="Solenoid_rmin - 10.0*mm "/>
    <constant name="HcalBarrelThickness" value="HcalBarrel_rmax - HcalBarrel_rmin "/>
    <constant name="HcalBarrelAvailThickness" value="HcalBarrel_rmax - HcalBarrel_rmin"/>
    <constant name="HcalBarrelLength"         value="EcalBarrelLength+2.0*EcalEndcapThickness + 10.0*mm "/>

    <constant name="HcalEndcap_zmin"          value="HcalBarrelLength/2.0"/>
    <constant name="HcalEndcapThickness" value="HcalBarrelThickness"/>
    <constant name="HcalEndcapP_rmin"           value="250.0*mm"/>
    <constant name="HcalEndcapN_rmin"           value="350.0*mm"/>
    <constant name="HcalEndcapAvailThickness" value="(SolenoidYokeEndcap_zmin - 10.0 * mm) - HcalEndcap_zmin"/>

    <constant name="HcalLayers" value="8"/>
    <!-- Material Thickness -->
    <constant name="HcalSteelThickness"       value="1.89 * cm"/>
    <constant name="HcalPyrexThickness" value="1.1 * mm"/>
    <constant name="HcalRPCGasThickness" value="1.2 * mm"/>
    <constant name="HcalG10Thickness" value="3 * mm"/>
    <constant name="HcalAirThickness" value="1.6 * mm"/>

    <constant name="HcalBarrelThickness" value="HcalBarrel_rmax - HcalBarrel_rmin"/>
    <constant name="HcalEndcapThickness" value="HcalBarrelThickness"/>
    <constant name="HcalThickness"       value="HcalBarrelThickness"/>

    <constant name="HcalPyrexThickness"       value="1.10 * mm"/>
    <constant name="HcalRPCGasThickness"      value="1.20 * mm"/>
    <constant name="HcalG10Thickness"         value="3.00 * mm"/>
    <constant name="HcalAirThickness"         value="1.60 * mm"/>

    <!-- Layer Thickness -->
    <constant name="HcalOneLayerThickness"
	    value="HcalSteelThickness + (2 * HcalPyrexThickness) + HcalRPCGasThickness + HcalG10Thickness + HcalAirThickness"/>
	    
    <!-- H Barrel Layers and Thickness -->
    <constant name="HcalBarrelLayers" value="floor(HcalBarrelAvailThickness / HcalOneLayerThickness)"/>
    <constant name="HcalBarrelThickness" value="HcalBarrelLayers * HcalOneLayerThickness"/>

    <!-- H Endcap Layers and Thickness -->
    <constant name="HcalEndcapLayers" value="floor(HcalEndcapAvailThickness / HcalOneLayerThickness)"/>
    <constant name="HcalEndcapThickness" value="HcalEndcapLayers * HcalOneLayerThickness"/>

    <comment>
      -----------------------
+66 −0
Original line number Diff line number Diff line
<lccdd>
  <define>
    <constant name="offset_ZDC"    value="5.0*mm"/>
    <constant name="lt_length"     value="400.0*mm"/>
    <constant name="total_length"  value="210.0*mm"/>
    <constant name="lt_ZDC_z_pos"  value="B2PF_CenterPosition - B2PF_Length/2.0 - total_length - 12.0*cm"/>
    <constant name="lt_ZDC_x_pos"  value="lt_ZDC_z_pos * ionCrossingAngle"/>
    <constant name="lt_ZDC_y_pos"  value="0.0*mm"/>
  </define>

  <detectors>
    <detector id="ZDC_lt_ID" name="largeZDC" type="topsideZDC" readout="ZDCHits" vis="RedVis">
      <position x="lt_ZDC_x_pos" y="lt_ZDC_y_pos" z="lt_ZDC_z_pos"/>
      <dimensions x = "lt_length" y = "lt_length"/>
      <layer repeat="2">
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
        <slice name="Scint_slice"    material="PlasticScint"   thickness="3*mm" vis = "BlueVis" sensitive = "true"/>
      </layer>
      <layer repeat="1">
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
        <slice name="SciFi_belt"     material="PlasticScint"   thickness="1*mm" vis = "RedVis"  sensitive = "true"/>
        <slice name="SciFi_belt"     material="PlasticScint"   thickness="1*mm" vis = "RedVis"  sensitive = "true"/>
      </layer>
      <layer repeat="2">
        <slice name="Scint_slice"    material="PlasticScint"   thickness="3*mm" vis = "BlueVis" sensitive = "true"/>
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
      </layer>
      <layer repeat="2">
        <slice name="SciFi_belt"     material="PlasticScint"   thickness="1*mm" vis = "RedVis"  sensitive = "true"/>
      </layer>
      <layer repeat="7">
        <slice name="Scint_slice"    material="PlasticScint"   thickness="3*mm" vis = "BlueVis" sensitive = "true"/>
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
      </layer>
      <layer repeat="1">
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
        <slice name="Scint_slice"    material="PlasticScint"   thickness="3*mm" vis = "BlueVis" sensitive = "true"/>
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
      </layer>
      <layer repeat="2">
        <slice name="SciFi_belt"     material="PlasticScint"   thickness="1*mm" vis = "RedVis"  sensitive = "true"/>
      </layer>
      <layer repeat="3">
        <slice name="Scint_slice"    material="PlasticScint"   thickness="3*mm" vis = "BlueVis" sensitive = "true"/>
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
      </layer>
      <layer repeat="2">
        <slice name="SciFi_belt"     material="PlasticScint"   thickness="1*mm" vis = "RedVis"  sensitive = "true"/>
      </layer>
      <layer repeat="1">
        <slice name="Scint_slice"    material="PlasticScint"   thickness="3*mm" vis = "BlueVis" sensitive = "true"/>
        <slice name="Tungsten_slice" material="TungstenDens24" thickness="7*mm" vis = "GrayVis"/>
      </layer>
    </detector>		
  </detectors>
  
  <readouts>
    <readout name="ZDCHits">
      <segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
        <id>system:8,layer:12,slice:12,x:48:-8,y:-8</id>  
    </readout>
  </readouts>

</lccdd>

views/config.yml

0 → 100644
+8 −0
Original line number Diff line number Diff line
#dawn_view_13:detector:
#  extends: .views
#  script:
#    - ./bin/make_dawn_views -t view13 -d scripts/view13 -D
#dawn_view_14:detector:
#  extends: .views
#  script:
#    - ./bin/make_dawn_views -t view14 -d scripts/view14 -D
+448 −0

File added.

Preview size limit exceeded, changes collapsed.

views/view1.yml

0 → 100644
+32 −0
Original line number Diff line number Diff line
dawn_view_01:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view01 -d scripts/view1 -D
dawn_view_01:ev001:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 1
dawn_view_01:ev002:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 2

view_01:
  stage: test
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - job: dawn_view_01:detector
      optional: false
    - job: dawn_view_01:ev001
      optional: true
    - job: dawn_view_01:ev002
      optional: true
  script:
    - ls -lrth *
    - ls -lrth images/*

views/view11.yml

0 → 100644
+54 −0
Original line number Diff line number Diff line
dawn_view_11:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view11 -d scripts/view11 -D
dawn_view_11:ev000:
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  extends: .views
  script:
    - ./bin/make_dawn_views -t view11_ev000 -d scripts/view11
dawn_view_11:ev001:
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  extends: .views
  script:
    - ./bin/make_dawn_views -t view11_ev001 -d scripts/view11 -s 1
dawn_view_11:ev002:
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  extends: .views
  script:
    - ./bin/make_dawn_views -t view11_ev002 -d scripts/view11 -s 2
dawn_view_11:ev003:
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  extends: .views
  script:
    - ./bin/make_dawn_views -t view11_ev003 -d scripts/view11 -s 3
dawn_view_11:ev004:
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  extends: .views
  script:
    - ./bin/make_dawn_views -t view11_ev004 -d scripts/view11 -s 4

view_11:
  stage: test
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - job: dawn_view_11:detector
      optional: false
    - job: dawn_view_11:ev001
      optional: true
    - job: dawn_view_11:ev002
      optional: true
    - job: dawn_view_11:ev003
      optional: true
    - job: dawn_view_11:ev004
      optional: true
  script:
    - ls -lrth *
    - ls -lrth images/*

views/view12.yml

0 → 100644
+17 −0
Original line number Diff line number Diff line
dawn_view_12:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view12 -d scripts/view12 -D

view_12:
  stage: test
  image: eicweb.phy.anl.gov:4567/eic/detectors/topside/imagemagick:latest
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - ["dawn_view_12:detector"]
  script:
    - convert -delay 50 -loop 0 images/view12a*.png  images/view12a.gif
    - ls -lrth *
    - ls -lrth images/*

views/view13.yml

0 → 100644
+15 −0
Original line number Diff line number Diff line
dawn_view_13:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view13 -d scripts/view13 -D

view_13:
  stage: test
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - ["dawn_view_13:detector"]
  script:
    - ls -lrth *
    - ls -lrth images/*

views/view14.yml

0 → 100644
+17 −0
Original line number Diff line number Diff line
dawn_view_14:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view14 -d scripts/view14 -D

view_14:
  stage: test
  image: eicweb.phy.anl.gov:4567/eic/detectors/topside/imagemagick:latest
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - ["dawn_view_14:detector"]
  script:
    - convert -delay 50 -loop 0 images/view14a*.png  images/view14a.gif
    - ls -lrth *
    - ls -lrth images/*

views/view15.yml

0 → 100644
+17 −0
Original line number Diff line number Diff line
dawn_view_15:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view15 -d scripts/view15 -D

view_15:
  stage: test
  image: eicweb.phy.anl.gov:4567/eic/detectors/topside/imagemagick:latest
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - ["dawn_view_15:detector"]
  script:
    - convert -delay 50 -loop 0 images/view15a*.png  images/view15a.gif
    - ls -lrth *
    - ls -lrth images/*

views/view2.yml

0 → 100644
+41 −0
Original line number Diff line number Diff line
dawn_view_02:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view02 -d scripts/view2 -D
dawn_view_02:ev001:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1
dawn_view_02:ev002:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2
dawn_view_02:ev003:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev003 -d scripts/view2 -s 3

view_02:
  stage: test
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - job: dawn_view_02:detector
      optional: false
    - job: dawn_view_02:ev001
      optional: true
    - job: dawn_view_02:ev002
      optional: true
    - job: dawn_view_02:ev003
      optional: true
    #- ["dawn_view_02:detector", "dawn_view_02:ev001", "dawn_view_02:ev002", "dawn_view_02:ev003"]
  script:
    - ls -lrth *
    - ls -lrth images/*

views/view3.yml

0 → 100644
+33 −0
Original line number Diff line number Diff line
dawn_view_03:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view02 -d scripts/view2 -D
dawn_view_03:ev001:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1
dawn_view_03:ev002:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2

view_03:
  stage: test
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - job: dawn_view_03:detector
      optional: false
    - job: dawn_view_03:ev001
      optional: true
    - job: dawn_view_03:ev002
      optional: true
    #- ["dawn_view_03:detector", "dawn_view_03:ev001", "dawn_view_03:ev002"]
  script:
    - ls -lrth *
    - ls -lrth images/*

views/view6.yml

0 → 100644
+49 −0
Original line number Diff line number Diff line
dawn_view_06:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view02 -d scripts/view2 -D
dawn_view_06:ev001:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1
dawn_view_06:ev002:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2
dawn_view_06:ev003:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev003 -d scripts/view2 -s 3
dawn_view_06:ev004:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view02_ev004 -d scripts/view2 -s 4

view_06:
  stage: test
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - job: dawn_view_06:detector
      optional: false
    - job: dawn_view_06:ev001
      optional: true
    - job: dawn_view_06:ev002
      optional: true
    - job: dawn_view_06:ev003 
      optional: true
    - job: dawn_view_06:ev004
      optional: true
    #- ["dawn_view_06:detector", "dawn_view_06:ev001", "dawn_view_06:ev002", "dawn_view_06:ev003", "dawn_view_06:ev004"]
  script:
    - ls -lrth *
    - ls -lrth images/*

views/view7.yml

0 → 100644
+32 −0
Original line number Diff line number Diff line
dawn_view_07:detector:
  extends: .views
  script:
    - ./bin/make_dawn_views -t view07 -d scripts/view7 -D
dawn_view_07:ev002:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view07_ev002 -d scripts/view7 -s 2
dawn_view_07:ev003:
  extends: .views
  rules:
    - if: '$DETECTOR_EVENT_VIEWS == "ON"'
  script:
    - ./bin/make_dawn_views -t view07_ev003 -d scripts/view7 -s 3

view_07:
  stage: test
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
    - job: dawn_view_07:detector
      optional: false
    - job: dawn_view_07:ev002
      optional: true
    - job: dawn_view_07:ev003
      optional: true
  script:
    - ls -lrth *
    - ls -lrth images/*