Commit 6d04f912 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: .gitlab-ci.yml

	modified:   bin/make_dawn_views
parent 1b4273d7
......@@ -8,3 +8,5 @@
*.root
build/*
.DAWN*
*/*.pyc
**.pyc
......@@ -10,6 +10,7 @@ stages:
- build
- docs
- test
- finalize
compile:
stage: build
......@@ -18,7 +19,7 @@ compile:
script:
- echo "Build successful."
dawn_views:
.views:
stage: docs
needs:
- ["compile"]
......@@ -28,8 +29,46 @@ dawn_views:
paths:
- images/
- doc/
dawn_view1:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view1 -d scripts/view1 -D
dawn_view1:ev1:
extends: .views
script:
- ./bin/make_dawn_views -t view1_ev1 -d scripts/view1 -s 2
dawn_view2:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view2 -d scripts/view2 -D
dawn_view2:ev1:
extends: .views
script:
- ./bin/make_dawn_views -t view2_ev1 -d scripts/view2 -s 2
dawn_view3:detector:
extends: .views
script:
- ./bin/make_dawn_views
- ./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
report:
stage: test
needs:
- ["dawn_view1:detector","dawn_view2:detector","dawn_view3:detector", "dawn_view1:ev1","dawn_view2:ev1","dawn_view3:ev1"]
tags:
- silicon
artifacts:
paths:
- images/
- doc/
script:
- pip3 install jinja2 && ls -lrth
- ./bin/make_images > doc/dawn_views.md
overlap_check:
stage: test
......
......@@ -111,3 +111,47 @@ Looking at the detector
https://ma.ttias.be/socks-proxy-linux-ssh-bypass-content-filters/
## a test
<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 \>
......@@ -3,26 +3,116 @@
#git clone --depth 1 https://eicweb.phy.anl.gov/EIC/datasets.git
export DAWN_PS_PREVIEWER="ls"
./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
function print_the_help {
echo "USAGE: ${0} [-s <skip_events>] -d <dawn_run_dir> "
echo " OPTIONS: "
echo " -D,--detector-only Only generate the prim files for the detector geometry."
echo " -s,--skip <skip_events> Required run number"
echo " -i,--input <input_file> Input hepmc file"
echo " -d,--dawn-dir <dawn_run_dir> Directory with the .DAWN files and a generate script "
echo " -t,--tag <file_tag> Output file tag"
exit
}
function yes_or_no {
while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) echo "No entered" ; return 1 ;;
esac
done
}
if [[ $# -eq 0 ]] ; then
print_the_help
exit
fi
SKIP_EVENTS=0
DETECTOR_ONLY=0
FILE_TAG="view"
DAWN_RUN_DIR="scripts/view1"
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
shift # past argument
print_the_help
;;
-s|--skip)
SKIP_EVENTS="$2"
shift # past argument
shift # past value
;;
-i|--input)
INPUT_FILE="$2"
shift # past argument
shift # past value
;;
-o|--ouput-dir)
OUTPUT_DIR="$2"
shift # past argument
shift # past value
;;
-D|--detector-only)
DETECTOR_ONLY=1
shift # past argument
#shift # past value
;;
-d|--dawn-dir)
DAWN_RUN_DIR=$2
shift # past argument
shift # past value
;;
-t|--tag)
FILE_TAG=$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
if [ "${DETECTOR_ONLY}" -eq "1" ] ; then
./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
-o derp.root -n 1 \
--ui csh --vis -b -m macro/dawn_picture.mac &
sleep 10
kill %1
else
echo " Running simulation for tracks"
./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
-o derp.root -s 1 -n 1 \
-o derp.root -s ${SKIP_EVENTS} -n 1 \
--ui csh --vis -b -m macro/dawn_picture2.mac &
sleep 20
sleep 40
kill %1
./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
-o derp.root -s 2 -n 1 \
--ui csh --vis -b -m macro/dawn_picture2.mac &
fi
sleep 20
kill %1
#./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
# -o derp.root -s 2 -n 1 \
# --ui csh --vis -b -m macro/dawn_picture2.mac &
#
#sleep 20
#kill %1
#./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
# -o derp.root -s 5 -n 1 \
......@@ -50,96 +140,106 @@ echo "simulating done"
ls -lrth
mkdir -p images
mkdir images
pushd scripts/view1
./generate_eps -t view1 -i ../../g4_0000.prim
./generate_eps -t view1_ev1 -i ../../g4_0001.prim
./generate_eps -t view1_ev2 -i ../../g4_0002.prim
#./generate_eps -t view1_ev3 -i ../../g4_0003.prim
#./generate_eps -t view1_ev4 -i ../../g4_0004.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd scripts/view2
./generate_eps -t view2 -i ../../g4_0000.prim
#./generate_eps -t view2_ev1 -i ../../g4_0001.prim
#./generate_eps -t view2_ev2 -i ../../g4_0002.prim
#./generate_eps -t view2_ev3 -i ../../g4_0003.prim
#./generate_eps -t view2_ev4 -i ../../g4_0004.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd ${DAWN_RUN_DIR}
pushd scripts/view3
./generate_eps ../../g4_0000.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd scripts/view4
./generate_eps ../../g4_0000.prim
cp *.eps ../../images/.
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd scripts/view5
./generate_eps ../../g4_0000.prim
cp *.eps ../../images/.
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd scripts/view6
./generate_eps -t view6 -i ../../g4_0000.prim
#./generate_eps -t view6_ev1 -i ../../g4_0001.prim
#./generate_eps -t view6_ev2 -i ../../g4_0002.prim
#./generate_eps -t view6_ev3 -i ../../g4_0003.prim
#./generate_eps -t view6_ev4 -i ../../g4_0004.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd scripts/view7
./generate_eps -t view7 -i ../../g4_0000.prim
#./generate_eps -t view7_ev1 -i ../../g4_0001.prim
#./generate_eps -t view7_ev2 -i ../../g4_0002.prim
#./generate_eps -t view7_ev3 -i ../../g4_0003.prim
#./generate_eps -t view7_ev4 -i ../../g4_0004.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
if [ "${DETECTOR_ONLY}" -eq "1" ] ; then
./generate_eps -t ${FILE_TAG} -i ../../g4_0000.prim
else
./generate_eps -t ${FILE_TAG} -i ../../g4_0000.prim
fi
ls -lrth
pushd scripts/view11
./generate_eps -t view11 -i ../../g4_0000.prim
./generate_eps -t view11_ev1 -i ../../g4_0001.prim
#./generate_eps -t view11_ev2 -i ../../g4_0002.prim
#./generate_eps -t view11_ev3 -i ../../g4_0003.prim
#./generate_eps -t view11_ev4 -i ../../g4_0004.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd scripts/view12
./generate_eps -t view12 -i ../../g4_0000.prim
./generate_eps -t view12_ev1 -i ../../g4_0001.prim
./generate_eps -t view12_ev2 -i ../../g4_0002.prim
#./generate_eps -t view12_ev3 -i ../../g4_0003.prim
#./generate_eps -t view12_ev4 -i ../../g4_0004.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
pushd scripts/view13
./generate_eps -t view13 -i ../../g4_0000.prim
./generate_eps -t view13_ev1 -i ../../g4_0001.prim
#./generate_eps -t view13_ev2 -i ../../g4_0002.prim
#./generate_eps -t view13_ev3 -i ../../g4_0003.prim
#./generate_eps -t view13_ev4 -i ../../g4_0004.prim
cp *.pdf ../../images/.
cp *.png ../../images/.
popd
#./generate_eps -t view1_ev2 -i ../../g4_0002.prim
#./generate_eps -t view1_ev3 -i ../../g4_0003.prim
#./generate_eps -t view1_ev4 -i ../../g4_0004.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#
#pushd scripts/view2
#./generate_eps -t view2 -i ../../g4_0000.prim
##./generate_eps -t view2_ev1 -i ../../g4_0001.prim
##./generate_eps -t view2_ev2 -i ../../g4_0002.prim
##./generate_eps -t view2_ev3 -i ../../g4_0003.prim
##./generate_eps -t view2_ev4 -i ../../g4_0004.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view3
#./generate_eps ../../g4_0000.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view4
#./generate_eps ../../g4_0000.prim
#cp *.eps ../../images/.
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view5
#./generate_eps ../../g4_0000.prim
#cp *.eps ../../images/.
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view6
#./generate_eps -t view6 -i ../../g4_0000.prim
##./generate_eps -t view6_ev1 -i ../../g4_0001.prim
##./generate_eps -t view6_ev2 -i ../../g4_0002.prim
##./generate_eps -t view6_ev3 -i ../../g4_0003.prim
##./generate_eps -t view6_ev4 -i ../../g4_0004.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view7
#./generate_eps -t view7 -i ../../g4_0000.prim
##./generate_eps -t view7_ev1 -i ../../g4_0001.prim
##./generate_eps -t view7_ev2 -i ../../g4_0002.prim
##./generate_eps -t view7_ev3 -i ../../g4_0003.prim
##./generate_eps -t view7_ev4 -i ../../g4_0004.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view11
#./generate_eps -t view11 -i ../../g4_0000.prim
#./generate_eps -t view11_ev1 -i ../../g4_0001.prim
##./generate_eps -t view11_ev2 -i ../../g4_0002.prim
##./generate_eps -t view11_ev3 -i ../../g4_0003.prim
##./generate_eps -t view11_ev4 -i ../../g4_0004.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view12
#./generate_eps -t view12 -i ../../g4_0000.prim
#./generate_eps -t view12_ev1 -i ../../g4_0001.prim
#./generate_eps -t view12_ev2 -i ../../g4_0002.prim
##./generate_eps -t view12_ev3 -i ../../g4_0003.prim
##./generate_eps -t view12_ev4 -i ../../g4_0004.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#
#pushd scripts/view13
#./generate_eps -t view13 -i ../../g4_0000.prim
#./generate_eps -t view13_ev1 -i ../../g4_0001.prim
##./generate_eps -t view13_ev2 -i ../../g4_0002.prim
##./generate_eps -t view13_ev3 -i ../../g4_0003.prim
##./generate_eps -t view13_ev4 -i ../../g4_0004.prim
#cp *.pdf ../../images/.
#cp *.png ../../images/.
#popd
#!/usr/bin/env python
from jinja2 import Environment, FileSystemLoader, select_autoescape
env = Environment(
loader=FileSystemLoader('reports/templates'),
#loader=PackageLoader('reports', 'templates'),
autoescape=select_autoescape(['html', 'xml'])
)
import glob
base_url = "https://eicweb.phy.anl.gov/api/v4/projects/390/jobs/artifacts/master/raw"
#images = ["images/view2a.png","images/view2b.png", "images/view1.png"]
images = glob.glob("images/*.png")
template = env.get_template('detector_views.md')
print(template.render(base_url=base_url, images=images))
#TOPSiDE
{% for image_path in images %}
<img src="{{ base_url }}/{{ image_path }}?job=report" width="400px" />
<br \>
{% endfor %}
......@@ -116,9 +116,9 @@
<include ref="topside/topside_rich.xml"/>
<!--
-->
<!--
<include ref="topside/roman_pots.xml"/>
<include ref="eic/forward_ion_beamline.xml"/>
<!--
-->
<detectors>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment