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 Original line Diff line number Diff line
image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:latest
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:
default:
  before_script:
  before_script:
    - mkdir -p images && mkdir -p doc/
    - source .local/bin/env.sh
    - 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 ..
  artifacts:
  artifacts:
    expire_in: 72 hours 
    paths:
    paths:
      - images/
      - .local/detector
      - doc/
      - .local/lib
      - .local/bin
      - .local/include
      - .local/share
      - results
      - config
      - images
      - doc
      - juggler.env
    reports:
      dotenv: juggler.env


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


compile:
common:setup:
  stage: build
  stage: config
  tags:
  rules:
    - silicon
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  script:
  before_script:
    - echo "Build successful."
    - 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:
.views:
  stage: docs
  stage: docs
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs:
  needs:
    - ["compile"]
    - ["common:detector"]
  tags:
    - silicon
  artifacts:
    paths:
      - images/
      - doc/


dawn_view1:detector:
include:
  extends: .views
  - local: 'views/view1.yml'
  script:
  - local: 'views/view2.yml'
    - ./bin/make_dawn_views -t view1 -d scripts/view1 -D
  - local: 'views/view3.yml'
dawn_view1:ev1:
  - local: 'views/view6.yml'
  extends: .views
  - local: 'views/view7.yml'
  script:
  - local: 'views/view11.yml'
    - ./bin/make_dawn_views -t view1_ev1 -d scripts/view1 -s 2
  - local: 'views/view12.yml'
dawn_view2:detector:
  - local: 'views/view13.yml'
  extends: .views
  - local: 'views/view14.yml'
  script:
  - local: 'views/view15.yml'
    - ./bin/make_dawn_views -t view2 -d scripts/view2 -D
    #  - local: 'views/config.yml'
dawn_view2:ev1:
    #
  extends: .views

  script:
dump_constants:
    - ./bin/make_dawn_views -t view2_ev1 -d scripts/view2 -s 2
  stage: test
dawn_view3:detector:
  needs: 
  extends: .views
    - ["common:detector"]
  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
  script:
  script:
    - ./bin/make_dawn_views -t view13 -d scripts/view13 -D
    - npdet_info dump ${DETECTOR_PATH}/topside.xml  | tee doc/constants.out 
dawn_view14:detector:

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




overlap_check:
overlap_check:
  stage: test
  stage: test
  tags:
  rules:
    - silicon
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  needs: 
  needs: 
    - ["compile"]
    - ["common:detector"]
  script:
  script:
    #- $(exit $(checkOverlaps -c topside.xml  | tee doc/overlap_check.out | wc -l ))
    - checkOverlaps -c ${DETECTOR_PATH}/topside.xml  | tee doc/overlap_check.out 
    - checkOverlaps -c topside.xml  | tee doc/overlap_check.out | wc -l
    - echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
    - cat doc/overlap_check.out
    - if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi
  allow_failure: true



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


benchmarks:reconstruction:

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




benchmarks:physics:
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
  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


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 Original line 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)
[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">
[Detector views](views/detector_views.md)
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view1.png?job=report" width="600px" />


<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>
</a>
<br \>

<br />
<br />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2a.pdf?job=report">
<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/view2a.png?job=report" width="400px" />
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view02a.png?job=report" width="400px" />
</a>
</a>
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view2e.pdf?job=report">
<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/view2e.png?job=report" width="400px" />
<img src="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view02e.png?job=report" width="400px" />
</a>
</a>
<br />
<br />
<a href="https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw/images/view11.pdf?job=report">
<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 
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 Original line Diff line number Diff line
@@ -6,7 +6,7 @@ export DAWN_PS_PREVIEWER="ls"
OUT_FILE=".DAWN_1.history"
OUT_FILE=".DAWN_1.history"


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


if [  "${DETECTOR_ONLY}" -eq "1" ] ; then
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 \
    -o derp.root -n 1 \
    --ui csh --vis -b -m macro/dawn_picture.mac & 
    --ui csh --vis -b -m macro/dawn_picture.mac & 


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


  echo " Running simulation for tracks"
  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 \
  -o derp.root -s ${SKIP_EVENTS} -n 1 \
  --ui csh --vis -b -m macro/dawn_picture2.mac & 
  --ui csh --vis -b -m macro/dawn_picture2.mac & 


+10 −1
Original line number Original line 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")
images = glob.glob("images/*.png")


template = env.get_template('detector_views.md')
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 Original line 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 Original line 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/open DAWNFILE
/vis/viewer/set/lineSegmentsPerCircle 24
/vis/viewer/set/lineSegmentsPerCircle 24
/vis/scene/create
/vis/scene/create
/vis/scene/add/volume
/vis/scene/add/volume
/vis/sceneHandler/attach
/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 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/scale 2 m z 1 0 0 manual 0 -2 0 m
#/vis/scene/add/magneticField 6 lightArrow
#/vis/scene/add/magneticField 6 lightArrow
/vis/viewer/flush
/vis/viewer/flush
/vis/scene/add/trajectories
/vis/scene/add/trajectories rich smooth
/vis/scene/add/hits
/vis/scene/add/hits
/tracking/storeTrajectory 1
/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
/run/beamOn 5


exit
exit
Original line number Original line 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/open DAWNFILE
/vis/scene/create
/vis/scene/create
/vis/scene/add/volume
/vis/scene/add/volume
/vis/sceneHandler/attach
/vis/sceneHandler/attach
#/vis/viewer/flush
/vis/scene/add/trajectories rich smooth
/vis/scene/add/trajectories
#/vis/scene/add/hits
/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 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/scale 2 m z 1 0 0 manual 0 -2 0 m
/tracking/storeTrajectory 1
/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
/run/beamOn 1


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


    outputfile = args.output
    outputfile = args.output
    if outputfile is None:
    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 = DDG4.EventAction(kernel, 'Geant4Output2Podio/RootOutput', True)
    podio.HandleMCTruth = False
    podio.HandleMCTruth = False
+25 −0
Original line number Original line 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 Original line 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 Original line Diff line number Diff line
@@ -214,9 +214,21 @@ def run():
    #seq, act = geant4.setupDetector('HeavyGasCherenkov','PhotoMultiplierSDAction')
    #seq, act = geant4.setupDetector('HeavyGasCherenkov','PhotoMultiplierSDAction')
    #act.adopt(f3)
    #act.adopt(f3)


    seq, act = geant4.setupTracker('SiTrackerBarrel')
    seq, act = geant4.setupTracker('SiTrackerBarrel_Layer1')
    seq, act = geant4.setupTracker('SiTrackerEndcapP')
    seq, act = geant4.setupTracker('SiTrackerEndcapP_Layer1')
    seq, act = geant4.setupTracker('SiTrackerEndcapN')
    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('SiVertexBarrel')
    #seq, act = geant4.setupTracker('SiTrackerForward')
    #seq, act = geant4.setupTracker('SiTrackerForward')
    #seq, act = geant4.setupCalorimeter('EcalBarrel')
    #seq, act = geant4.setupCalorimeter('EcalBarrel')
Original line number Original line Diff line number Diff line
@@ -9,8 +9,8 @@ function print_the_help {
  exit 
  exit 
}
}


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




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




# Side  view
dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim 
dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim 
dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim  ${FILE_TAG}.prim
dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim  ${FILE_TAG}.prim
dawn -d ${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
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 Original line 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
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 ${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.prim
  ../../bin/dawn_tweak  --draw 5
dawn -d ${FILE_TAG}a.prim 
dawn -d ${FILE_TAG}a.prim 
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
Original line number Original line Diff line number Diff line
1.34392e+07
0.0
180
180
90
90
0
0
0
0
0
0
0
0
29
40
1
1
0.001
0.001
0
0
Original line number Original line Diff line number Diff line
#!/bin/bash
#!/bin/bash


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

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

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




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


original_file_tag="${FILE_TAG}"
original_file_tag="${FILE_TAG}"


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


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

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

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

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




function print_the_help {
function print_the_help {
@@ -102,7 +102,7 @@ make_slice(){
  rm "${FILE_TAG}_temp0.prim"
  rm "${FILE_TAG}_temp0.prim"
  rm "${FILE_TAG}.prim"
  rm "${FILE_TAG}.prim"
}
}
for zzz in $(seq 150 50 2000) ;
for zzz in $(seq 150 100 1000) ;
do
do
  make_slice ${zzz} 
  make_slice ${zzz} 
done
done
+31 −0
Original line number Original line 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 Original line 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 Original line Diff line number Diff line
@@ -29,5 +29,5 @@
evince
evince
0
0
0
0
1
3
n
n
Original line number Original line Diff line number Diff line
1.34392e+07
1.34392e+07
0
19
180
185.5
0
0
0
0
0
0
0
0
8
16
1
1
0.001
0.001
0
0
@@ -17,12 +17,12 @@
0.5
0.5
19
19
71
71
0.01
0.001
0.01
0.001
0.01
0.001
3
1
70
70
0.01
0.001
1
1
1
1
1
1
Original line number Original line Diff line number Diff line
@@ -9,8 +9,8 @@ function print_the_help {
  exit 
  exit 
}
}


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




POSITIONAL=()
POSITIONAL=()
@@ -43,10 +43,15 @@ do
done
done
set -- "${POSITIONAL[@]}" # restore positional parameters
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
# units are mm
dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
dawncut 0 0 -1 2 ${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  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
dawn -d ${FILE_TAG}a.prim 
dawn -d ${FILE_TAG}a.prim 
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@
0
0
0
0
8
8
1
5
0.001
0.001
0
0
1
1
Original line number Original line Diff line number Diff line
@@ -9,8 +9,8 @@ function print_the_help {
  exit 
  exit 
}
}


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




POSITIONAL=()
POSITIONAL=()
@@ -50,6 +50,12 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
#SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
#SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
#SiTracker Endcap layer 5 zstart = 860mm ( 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
# units are mm
dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim 
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 1  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@ function print_the_help {
  exit 
  exit 
}
}


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




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




// check if a square in a ring
// 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) {
    if (pt.r() > rmax || pt.r() < rmin) {
        return false;
        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.),
        Point(pt.x() + side/2., pt.y() + side/2.),
    };
    };
    for (auto &p : pts) {
    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;
            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
// 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
    // 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;
        return;
    }
    }


    res.emplace_back(p);
    res.emplace_back(p);


    // check adjacent squares
    // 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, phmin, phmax);
    add_square(Point(p.x() - lside, p.y()), res, lside, rmin, rmax);
    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);
    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);
    add_square(Point(p.x(), p.y() - lside), res, lside, rmin, rmax, phmin, phmax);
}
}


// fill squares
// 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
    // start with a seed square and find one in the ring
    // move to center
    // move to center
    ref = ref - Point(int(ref.x()/lside)*lside, int(ref.y()/lside)*lside);
    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 ix = -n; ix < n; ++ix) {
            for (int iy = -n; iy < n; ++iy) {
            for (int iy = -n; iy < n; ++iy) {
                Point pt(ref.x() + ix*side, ref.y() + iy*side);
                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;
                    return pt;
                }
                }
            }
            }
@@ -95,8 +97,8 @@ std::vector<Point> fill_squares(Point ref, double lside, double rmin, double rma
    };
    };


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


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


    DetElement det(detName, detID);
    DetElement det(detName, detID);
    xml::Component dims = detElem.dimensions();
    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 mir = detElem.child(_Unicode(mirror));
    xml::Component mcp = detElem.child(_Unicode(mcppmt));
    xml::Component mcp = detElem.child(_Unicode(mcppmt));


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

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


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


    // materials
    // materials
    auto mirMat = desc.material(mir.materialStr());
    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());
    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
    // an envelope for the detector
    // use a complicated shape to avoid conflict with the other parts
    // use a complicated shape to avoid conflict with the other parts
    // cone for radiator and the first set of mirrors
    // cone for radiator
    double halfLength = 0.5 * (mirZ + 5.0*cm);
    double halfLength = length/2.;
    double rmin = tRmin;
    Cone env1(halfLength, rmin, rmax1, rmin, rmax2);
    double rmax = tRmax2;
    // 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) {
    for (xml::Collection_t sl(mir, _Unicode(slice)); sl; ++sl) {
        auto mRmin = sl.attr<double>(_Unicode(rmin));
        auto mr = sl.attr<double>(_Unicode(rmax));
        auto mRmax = sl.attr<double>(_Unicode(rmax));
        rMirEnv = mr > rMirEnv ? mr: rMirEnv;
        if (mRmin < rmin) { rmin = mRmin; }
        if (mRmax > rmax) { rmax = mRmax; }
    }
    }
    rmin = std::max(0., rmin - 0.1*cm);
    Tube env3(rmin, rMirEnv + 1.0*cm, mir.attr<double>(_Unicode(env_length))/2., 0., 2*M_PI);
    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);


    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"));
    Volume envVol(detName + "_envelope", envShape, gasMat);
    // envVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
    envVol.setVisAttributes(desc.visAttributes(detElem.visStr()));


    // ---------------
    // ---------------
    // Gas radiator container and spherical mirrors inside it
    // spherical mirrors inside it
    int ilayer = 1;
    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
    // optical surface
    OpticalSurfaceManager surfMgr = desc.surfaceManager();
    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
            Transform3D tr = Translation3D(0., 0., mirZ - halfLength)   // move for z position
                           * RotationZ(rotZ)                            // rotate phi angle
                           * RotationZ(rotZ)                            // rotate phi angle
                           * RotationY(rotY)                            // rotate for focus point
                           * RotationY(rotY)                            // rotate for focus point
                           * RotationX(180*degree)
                           * Translation3D(0., 0., -curve)              // move spherical shell to origin
                           * Translation3D(0., 0., -curve)              // move spherical shell to origin
                           * RotationZ(-wphi/2.);                       // center phi angle to 0. (-wphi/2., wphi/2.)
                           * RotationZ(-wphi/2.);                       // center phi angle to 0. (-wphi/2., wphi/2.)
            mirPV = envVol.placeVolume(mirVol, tr);
            mirPV = envVol.placeVolume(mirVol, tr);
@@ -227,6 +222,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
    ilayer++;
    ilayer++;


    // ---------------
    // ---------------
    // photo-detector unit
    // Fill the photo-detection plane with square shape MCP-PMTs
    // Fill the photo-detection plane with square shape MCP-PMTs
    Box mcpShape1(pSize/2.0, pSize/2.0, pThick/2.0);
    Box mcpShape1(pSize/2.0, pSize/2.0, pThick/2.0);
    Volume mcpVol1("mcppmt_v_material", mcpShape1, mcpMat);
    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");
    sens.setType("photoncounter");
    mcpVol.setSensitiveDetector(sens);
    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) {
        for (size_t i = 0; i < points.size(); ++i) {
            auto pt = points[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);
            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);
            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);
    Volume motherVol = desc.pickMotherVolume(det);
    PlacedVolume envPV = motherVol.placeVolume(envVol, Position(0, 0, z0 + halfLength));
    PlacedVolume envPV = motherVol.placeVolume(envVol, Position(0, 0, z0 + halfLength));
    envPV.addPhysVolID("system", detID);
    envPV.addPhysVolID("system", detID);
Original line number Original line 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/Helper.h"
#include "XML/Layering.h"


using namespace dd4hep;
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;
  xml::DetElement detElem = handle;


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

src/RomanPot_geo.cpp

0 → 100644
+287 −0
Original line number Original line 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 Original line Diff line number Diff line
@@ -26,7 +26,7 @@
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Utilities/Units.hpp"
#include "Acts/Definitions/Units.hpp"




using namespace std;
using namespace std;
Original line number Original line 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 x_mod = mi;
    xml_comp_t m_env = x_mod.child(_U(module_envelope));
    xml_comp_t m_env = x_mod.child(_U(module_envelope));
    string     m_nam = x_mod.nameStr();
    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;
    int        ncomponents = 0, sensor_number = 1;


    if (volumes.find(m_nam) != volumes.end()) {
    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_pos  = x_comp.position(false);
      xml_comp_t x_rot  = x_comp.rotation(false);
      xml_comp_t x_rot  = x_comp.rotation(false);
      string     c_nam  = _toString(ncomponents, "component%d");
      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()));
      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) {
      if (x_pos && x_rot) {
        Position    c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0));
        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));
        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) {
      } 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) {
      } 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 {
      } else {
        pv = m_vol.placeVolume(c_vol);
        c_pv = m_vol.placeVolume(c_vol);
      }
      }
      c_vol.setRegion(description, x_comp.regionStr());
      c_vol.setRegion(description, x_comp.regionStr());
      c_vol.setLimitSet(description, x_comp.limitsStr());
      c_vol.setLimitSet(description, x_comp.limitsStr());
      c_vol.setVisAttributes(description, x_comp.visStr());
      c_vol.setVisAttributes(description, x_comp.visStr());
      if (x_comp.isSensitive()) {
      if (x_comp.isSensitive()) {
        pv.addPhysVolID(_U(sensor), sensor_number++);
        c_pv.addPhysVolID(_U(sensor), sensor_number++);
        c_vol.setSensitiveDetector(sens);
        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();
    Acts::ActsExtension* layerExtension = new Acts::ActsExtension();
    layerExtension->addType("sensitive cylinder", "layer");
    layerExtension->addType("sensitive cylinder", "layer");
    //layerExtension->addValue(10. * Acts::UnitConstants::mm, "r", "envelope");
    lay_elt.addExtension<Acts::ActsExtension>(layerExtension);
    lay_elt.addExtension<Acts::ActsExtension>(layerExtension);


    Placements& sensVols = sensitives[m_nam];
    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));
        //         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
        // NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the
        // outside
        // 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 = lay_vol.placeVolume(m_env, tr);
        pv.addPhysVolID("module", module);
        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];
          PlacedVolume sens_pv = sensVols[ic];
          DetElement   comp_elt(mod_elt, sens_pv.volume().name(), module);
          DetElement   comp_elt(mod_elt, sens_pv.volume().name(), module);
          comp_elt.setPlacement(sens_pv);
          comp_elt.setPlacement(sens_pv);
          Acts::ActsExtension* moduleExtension = new Acts::ActsExtension();
          Acts::ActsExtension* moduleExtension = new Acts::ActsExtension("YZX");
          comp_elt.addExtension<Acts::ActsExtension>(moduleExtension);
          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());
  assembly.setVisAttributes(description.invisible());
  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
  pv = description.pickMotherVolume(sdet).placeVolume(assembly);
  pv.addPhysVolID("system", det_id); // Set the subdetector system ID.
  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);
  sdet.setPlacement(pv);
  return sdet;
  return sdet;
}
}
Original line number Original line Diff line number Diff line
@@ -18,10 +18,11 @@
#include <map>
#include <map>


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

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


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


  for(xml_coll_t mi(x_det,_U(module)); mi; ++mi, ++m_id)  {
  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;
    y1 = y2 = total_thickness / 2;
    Volume  m_volume(m_nam, Trapezoid(x1, x2, y1, y2, z), vacuum);
    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()));
    m_volume.setVisAttributes(description.visAttributes(x_mod.visStr()));


    for(ci.reset(), n_sensor=1, c_id=0, posY=-y1; ci; ++ci, ++c_id)  {
    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());
      Material   c_mat   = description.material(c.materialStr());
      string     c_name  = _toString(c_id,"component%d");
      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, 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()));
      c_vol.setVisAttributes(description.visAttributes(c.visStr()));
      pv = m_volume.placeVolume(c_vol,Position(0,posY+c_thick/2,0));
      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_rmax   = l_env.attr<double>(_Unicode(rmax));
    double      layer_length = l_env.attr<double>(_Unicode(length));
    double      layer_length = l_env.attr<double>(_Unicode(length));
    double      layer_zstart = l_env.attr<double>(_Unicode(zstart));
    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    layer_assembly(layer_name);
    //assembly.placeVolume(layer_assembly);
    //assembly.placeVolume(layer_assembly);
@@ -114,7 +118,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
    PlacedVolume layer_pv;
    PlacedVolume layer_pv;
    if (reflect) {
    if (reflect) {
      layer_pv = assembly.placeVolume(layer_vol, Position(0,0,-layer_zstart-layer_length/2));
      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";
      layer_name += "_N";
    } else {
    } else {
      layer_pv = assembly.placeVolume(layer_vol, Position(0, 0, +layer_zstart + layer_length / 2));
      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);
    layer_element.setPlacement(layer_pv);
    Acts::ActsExtension* layerExtension = new Acts::ActsExtension();
    Acts::ActsExtension* layerExtension = new Acts::ActsExtension();
    layerExtension->addType("layer", "layer");
    layerExtension->addType("layer", "layer");
    //layerExtension->addType("axes", "definitions", "XZY");
    layer_element.addExtension<Acts::ActsExtension>(layerExtension);
    layer_element.addExtension<Acts::ActsExtension>(layerExtension);


    int mod_num = 1;
    int mod_num = 1;
@@ -175,7 +180,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
        }
        }
        if (reflect) {
        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 = 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);
          DetElement r_module(layer_element,m_base+"_N",mod_num);
          r_module.setPlacement(pv);
          r_module.setPlacement(pv);
          for(size_t ic=0; ic<sensVols.size(); ++ic)  {
          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;
      ++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);
  pv.addPhysVolID("system",det_id);
  sdet.setPlacement(pv);
  sdet.setPlacement(pv);
  return sdet;
  return sdet;
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/RectangleBounds.hpp"
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Utilities/Units.hpp"
#include "Acts/Definitions/Units.hpp"




using namespace std;
using namespace std;
+30 −23
Original line number Original line 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>
#include <XML/Helper.h>


using namespace dd4hep;
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;
  xml::DetElement detElem = handle;


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

src/topsideZDC.cpp

0 → 100644
+117 −0
Original line number Original line 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 Original line Diff line number Diff line
@@ -106,15 +106,18 @@
  </display>
  </display>


  <!--
  <!--
  <include ref="topside/vertex_tracker.xml"/>
  -->
  -->
  <include ref="topside/beampipe.xml"/>
  <include ref="topside/beampipe.xml"/>
  <include ref="topside/vertex_tracker.xml"/>
  <include ref="topside/silicon_tracker.xml"/>
  <include ref="topside/silicon_tracker.xml"/>
  <include ref="topside/ecal.xml"/>
  <include ref="topside/ecal.xml"/>
  <include ref="topside/hcal.xml"/>
  <include ref="topside/hcal.xml"/>
  <include ref="topside/solenoid.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="topside/roman_pots.xml"/>
  -->
  <include ref="eic/forward_ion_beamline.xml"/>
  <include ref="eic/forward_ion_beamline.xml"/>
  <!--
  <!--
  -->
  -->
Original line number Original line Diff line number Diff line
  <display>
  <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="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="SiTrackerBarrelVis" alpha="0.5" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/>
    <vis name="SiTrackerVis" alpha="0.5" r="1.0" g="0.0" b="0.0" showDaughters="false" />
    <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="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="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="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="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="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="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="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="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="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="RICHVis" alpha="0.5" r="1" g="0" b="1" showDaughters="false"/>
    <vis name="InvisibleNoDaughters"      showDaughters="false" visible="false"/>
    <vis name="BeamPipeVis"    alpha="1"  r= "0.75" g="0.75" b="0.75" showDaughters="true" visible="true"/>
    <vis name="InvisibleWithDaughters"    showDaughters="true" visible="false"/>


    <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="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="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"/>
    <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="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="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="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>
  </display>
+22 −52
Original line number Original line Diff line number Diff line
<lccdd>
<lccdd>


  <define>
  <define>

    <constant name="CrystalEndcap_rmin"  value="VertexTrackerInnerRadius"/>
    <constant name="CrystalEndcap_rmin"  value="120.0*mm"/>
    <constant name="CrystalEndcap_rmax"  value="EcalEndcapN_rmin"/>
    <constant name="CrystalEndcap_rmax"  value="EcalEndcapN_rmin"/>
    <constant name="CrystalBox_x_length" value="20.0*mm"/>
    <constant name="CrystalBox_x_length" value="20.0*mm"/>
    <constant name="CrystalBox_y_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_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_x_pos" value="0.0*m"/>
    <constant name="CrystalEndcap_y_pos" value="0.0*m"/>
    <constant name="CrystalEndcap_y_pos" value="0.0*m"/>
    <constant name="CrystalEndcap_z_pos" value="-EcalEndcap_zmin"/>
    <constant name="CrystalEndcap_z_pos" value="-EcalEndcap_zmin"/>
@@ -23,7 +23,15 @@
  <display>
  <display>
  </display>
  </display>


  <include ref="ecal_barrel.xml"/>

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


    <comment>
    <comment>
      -------------------
      -------------------
@@ -34,53 +42,13 @@
    <detector 
    <detector 
      id="CrystalEndcap_ID" 
      id="CrystalEndcap_ID" 
      name="ElectronECAL" 
      name="ElectronECAL" 
      type="Crystal" 
      type="CrystalCalorimeterEndcap" 
      readout="CrystalEcalHits" 
      readout="CrystalEcalHits" 
      vis="GreenVis">
      vis="GreenVis">
      <position x="CrystalEndcap_x_pos" y="CrystalEndcap_y_pos" z="CrystalEndcap_z_pos" />
      <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>
    </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>
    <comment>
      -----------------------------
      -----------------------------
@@ -106,7 +74,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      </layer>
      <layer repeat="EcalThinLayers">
      <layer repeat="EcalEndcapThinLayers">
        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -114,7 +82,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      </layer>
      <layer repeat="EcalThickLayers">
      <layer repeat="EcalEndcapThickLayers">
        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -149,7 +117,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      </layer>
      <layer repeat="EcalThinLayers">
      <layer repeat="EcalEndcapThinLayers">
        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -157,7 +125,7 @@
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Kapton" thickness="EcalKaptonThickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
        <slice material="Air" thickness="EcalAir1Thickness"/>
      </layer>
      </layer>
      <layer repeat="EcalThickLayers">
      <layer repeat="EcalEndcapThickLayers">
        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Air" thickness="EcalAir2Thickness"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
@@ -170,14 +138,16 @@


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


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