diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e411837dae730e738ce4cd5581976b3cf944d7f5..2ddb4c503866180d3aab9cfadab88b3e7eee7bc3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,7 +84,11 @@ include: - local: 'views/view3.yml' - local: 'views/view6.yml' - local: 'views/view7.yml' - - local: 'views/config.yml' + - local: 'views/view11.yml' + - local: 'views/view12.yml' + - local: 'views/view13.yml' + - local: 'views/view14.yml' + - local: 'views/view15.yml' report: stage: finalize diff --git a/scripts/view14/generate_eps b/scripts/view14/generate_eps index c9fa64857b85962c207db05437d3d5a1e7c97e9f..492bd3f379f40df6dd59e7508a1429a8a20eac7e 100755 --- a/scripts/view14/generate_eps +++ b/scripts/view14/generate_eps @@ -1,25 +1,25 @@ #!/bin/bash #trignometry -sin () -{ - echo "scale=5;s($1)" | bc -l -} - -add () -{ - echo "scale=5;$1 + $2" | bc -l -} - -cos () -{ - echo "scale=5;c($1)" | bc -l -} - -tan () -{ - echo "scale=5;s($1)/c($1)" | bc -l -} +#sin () +#{ +# echo "scale=5;s($1)" | bc -l +#} +# +#add () +#{ +# echo "scale=5;$1 + $2" | bc -l +#} +# +#cos () +#{ +# echo "scale=5;c($1)" | bc -l +#} +# +#tan () +#{ +# echo "scale=5;s($1)/c($1)" | bc -l +#} function print_the_help { diff --git a/scripts/view15/generate_eps b/scripts/view15/generate_eps new file mode 100755 index 0000000000000000000000000000000000000000..09ac01ad1e9c6dbf8dd642b07f157cf979c446c2 --- /dev/null +++ b/scripts/view15/generate_eps @@ -0,0 +1,166 @@ +#!/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). diff --git a/views/config.yml b/views/config.yml index 21d6d1e8031bc2b0cc920b4290bec3ad3a32245d..2650bccec5a14da7d58ee89dd1e2ac2cf9d927d8 100644 --- a/views/config.yml +++ b/views/config.yml @@ -1,36 +1,8 @@ -dawn_view_11:detector: - extends: .views - script: - - ./bin/make_dawn_views -t view11 -d scripts/view11 -D -dawn_view_11:ev000: - extends: .views - script: - - ./bin/make_dawn_views -t view11 -d scripts/view11 -dawn_view_11:ev001: - extends: .views - script: - - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 1 -dawn_view_11:ev002: - extends: .views - script: - - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 2 -dawn_view_11:ev003: - extends: .views - script: - - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 3 -dawn_view_11:ev004: - extends: .views - script: - - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 4 -dawn_view_12:detector: - extends: .views - script: - - ./bin/make_dawn_views -t view12 -d scripts/view12 -D -dawn_view_13:detector: - extends: .views - script: - - ./bin/make_dawn_views -t view13 -d scripts/view13 -D -dawn_view_14:detector: - extends: .views - script: - - ./bin/make_dawn_views -t view14 -d scripts/view14 -D +#dawn_view_13:detector: +# extends: .views +# script: +# - ./bin/make_dawn_views -t view13 -d scripts/view13 -D +#dawn_view_14:detector: +# extends: .views +# script: +# - ./bin/make_dawn_views -t view14 -d scripts/view14 -D diff --git a/views/view1.yml b/views/view1.yml index 9f92c437ea7ac3ddbc3410e85ffaed01f73487fb..75475fa983a6f76be99cd34277994f04105660f2 100644 --- a/views/view1.yml +++ b/views/view1.yml @@ -4,17 +4,28 @@ dawn_view_01:detector: - ./bin/make_dawn_views -t view01 -d scripts/view1 -D dawn_view_01:ev001: extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 1 dawn_view_01:ev002: extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 2 view_01: stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' needs: - - ["dawn_view_01:detector", "dawn_view_01:ev001","dawn_view_01:ev002"] + - job: dawn_view_01:detector + optional: false + - job: dawn_view_01:ev001 + optional: true + - job: dawn_view_01:ev002 + optional: true script: - ls -lrth * - ls -lrth images/* diff --git a/views/view11.yml b/views/view11.yml new file mode 100644 index 0000000000000000000000000000000000000000..9b3b384fc458c00a9cd21e0f65877c1fe5875bd6 --- /dev/null +++ b/views/view11.yml @@ -0,0 +1,56 @@ +dawn_view_11:detector: + extends: .views + script: + - ./bin/make_dawn_views -t view11 -d scripts/view11 -D +dawn_view_11:ev000: + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + extends: .views + script: + - ./bin/make_dawn_views -t view11 -d scripts/view11 +dawn_view_11:ev001: + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + extends: .views + script: + - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 1 +dawn_view_11:ev002: + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + extends: .views + script: + - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 2 +dawn_view_11:ev003: + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + extends: .views + script: + - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 3 +dawn_view_11:ev004: + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + extends: .views + script: + - ./bin/make_dawn_views -t view11 -d scripts/view11 -s 4 + +view_11: + stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' + needs: + - job: compile + optional: false + - job: dawn_view_11:detector + optional: false + - job: dawn_view_11:ev001 + optional: true + - job: dawn_view_11:ev002 + optional: true + - job: dawn_view_11:ev003 + optional: true + - job: dawn_view_11:ev004 + optional: true + script: + - ls -lrth * + - ls -lrth images/* + diff --git a/views/view12.yml b/views/view12.yml new file mode 100644 index 0000000000000000000000000000000000000000..4f7d6ccd2130712276a88ca9661cc240b4ef1f2d --- /dev/null +++ b/views/view12.yml @@ -0,0 +1,15 @@ +dawn_view_12:detector: + extends: .views + script: + - ./bin/make_dawn_views -t view12 -d scripts/view12 -D + +view_12: + stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' + needs: + - ["dawn_view_12:detector"] + script: + - ls -lrth * + - ls -lrth images/* + diff --git a/views/view13.yml b/views/view13.yml new file mode 100644 index 0000000000000000000000000000000000000000..c5d4f4860d7043d2877be49d7a2d98771356fcab --- /dev/null +++ b/views/view13.yml @@ -0,0 +1,15 @@ +dawn_view_13:detector: + extends: .views + script: + - ./bin/make_dawn_views -t view13 -d scripts/view13 -D + +view_13: + stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' + needs: + - ["dawn_view_13:detector"] + script: + - ls -lrth * + - ls -lrth images/* + diff --git a/views/view14.yml b/views/view14.yml new file mode 100644 index 0000000000000000000000000000000000000000..9cd9a365a02196aeea4a4a782bc9f24b0813b590 --- /dev/null +++ b/views/view14.yml @@ -0,0 +1,15 @@ +dawn_view_14:detector: + extends: .views + script: + - ./bin/make_dawn_views -t view14 -d scripts/view14 -D + +view_14: + stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' + needs: + - ["dawn_view_14:detector"] + script: + - ls -lrth * + - ls -lrth images/* + diff --git a/views/view15.yml b/views/view15.yml new file mode 100644 index 0000000000000000000000000000000000000000..124ca01b4710ef247ea1f1862e7a54e88544cee6 --- /dev/null +++ b/views/view15.yml @@ -0,0 +1,15 @@ +dawn_view_15:detector: + extends: .views + script: + - ./bin/make_dawn_views -t view15 -d scripts/view15 -D + +view_15: + stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' + needs: + - ["dawn_view_15:detector"] + script: + - ls -lrth * + - ls -lrth images/* + diff --git a/views/view2.yml b/views/view2.yml index 047e51dbadeb1a990d711538dbd34518aa295554..1c9fc241debfab2d47483a1ab9ea724cd49ab35d 100644 --- a/views/view2.yml +++ b/views/view2.yml @@ -2,15 +2,35 @@ dawn_view_02:detector: extends: .views script: - ./bin/make_dawn_views -t view02 -d scripts/view2 -D +#dawn_view_02:ev001: +# extends: .views +# script: +# - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1 dawn_view_02:ev002: extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2 +dawn_view_02:ev003: + extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + script: + - ./bin/make_dawn_views -t view02_ev003 -d scripts/view2 -s 3 view_02: stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' needs: - - ["dawn_view_02:detector", "dawn_view_02:ev002"] + - job: dawn_view_02:detector + optional: false + - job: dawn_view_02:ev002 + optional: true + - job: dawn_view_02:ev003 + optional: true + #- ["dawn_view_02:detector", "dawn_view_02:ev001", "dawn_view_02:ev002", "dawn_view_02:ev003"] script: - ls -lrth * - ls -lrth images/* diff --git a/views/view3.yml b/views/view3.yml index 69f11876f273d841caa104de86f80a21185548f0..4aef66f34d6fc6331629e241f32e12aec3645a8b 100644 --- a/views/view3.yml +++ b/views/view3.yml @@ -2,15 +2,27 @@ dawn_view_03:detector: extends: .views script: - ./bin/make_dawn_views -t view02 -d scripts/view2 -D +#dawn_view_03:ev001: +# extends: .views +# script: +# - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1 dawn_view_03:ev002: extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2 view_03: stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' needs: - - ["dawn_view_03:detector", "dawn_view_03:ev002"] + - job: dawn_view_03:detector + optional: false + - job: dawn_view_03:ev002 + optional: true + #- ["dawn_view_03:detector", "dawn_view_03:ev001", "dawn_view_03:ev002"] script: - ls -lrth * - ls -lrth images/* diff --git a/views/view6.yml b/views/view6.yml index f0fda5c581028881c8838958c1d91d9d845611fe..1ad761c1f7b4a3df25e54fdcdfad68345b1559ce 100644 --- a/views/view6.yml +++ b/views/view6.yml @@ -2,15 +2,43 @@ dawn_view_06:detector: extends: .views script: - ./bin/make_dawn_views -t view02 -d scripts/view2 -D +#dawn_view_06:ev001: +# extends: .views +# script: +# - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1 +dawn_view_06:ev002: + extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + script: + - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2 +dawn_view_06:ev003: + extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + script: + - ./bin/make_dawn_views -t view02_ev003 -d scripts/view2 -s 3 dawn_view_06:ev004: extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - ./bin/make_dawn_views -t view02_ev004 -d scripts/view2 -s 4 view_06: stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' needs: - - ["dawn_view_06:detector", "dawn_view_06:ev004"] + - job: dawn_view_06:detector + optional: false + - job: dawn_view_06:ev002 + optional: true + - job: dawn_view_06:ev003 + optional: true + - job: dawn_view_06:ev004 + optional: true + #- ["dawn_view_06:detector", "dawn_view_06:ev001", "dawn_view_06:ev002", "dawn_view_06:ev003", "dawn_view_06:ev004"] script: - ls -lrth * - ls -lrth images/* diff --git a/views/view7.yml b/views/view7.yml index 0e308a3e5a19c02c82afae919e52c67573694bf8..c59d1a42bf31e965fe80e44cdfe38b49bedd7d74 100644 --- a/views/view7.yml +++ b/views/view7.yml @@ -1,16 +1,31 @@ dawn_view_07:detector: extends: .views script: - - ./bin/make_dawn_views -t view02 -d scripts/view2 -D + - ./bin/make_dawn_views -t view07 -d scripts/view2 -D dawn_view_07:ev002: extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' script: - - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2 + - ./bin/make_dawn_views -t view07_ev002 -d scripts/view2 -s 2 +dawn_view_07:ev003: + extends: .views + rules: + - if: '$DETECTOR_EVENT_VIEWS == "ON"' + script: + - ./bin/make_dawn_views -t view07_ev003 -d scripts/view2 -s 3 view_07: stage: test + rules: + - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' needs: - - ["dawn_view_07:detector", "dawn_view_07:ev002"] + - job: dawn_view_07:detector + optional: false + - job: dawn_view_07:ev002 + optional: true + - job: dawn_view_07:ev003 + optional: true script: - ls -lrth * - ls -lrth images/*