Commit d08bb1df authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: ../view11/generate_eps

	modified:   .DAWN_1.default
	modified:   .DAWN_1.history
	modified:   generate_eps
parent 8f588ad8
......@@ -71,6 +71,10 @@ dawn_view13:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view13 -d scripts/view13 -D
dawn_view14:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view14 -d scripts/view14 -D
report:
stage: test
......
#!/bin/bash
#git clone --depth 1 https://eicweb.phy.anl.gov/EIC/datasets.git
export DAWN_PS_PREVIEWER="ls"
OUT_FILE=".DAWN_1.history"
function print_the_help {
echo "USAGE: ${0} [-s <skip_events>] -d <dawn_run_dir> "
echo " OPTIONS: "
echo " -x targeted x coordinate position"
echo " -y targeted x coordinate position"
echo " -z targeted x coordinate position"
echo " --theta viewing angle"
echo " --phi viewing angle"
echo " -m,--mag magnification"
echo " -d,--dawn-dir <dawn_run_dir> Directory with the .DAWN files and a generate script "
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="."
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
shift # past argument
print_the_help
;;
-x)
echo "updating x coordinate to ${2}"
sed -i '5d' ${DAWN_RUN_DIR}/${OUT_FILE}
sed -i '5i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
shift # past argument
shift # past value
;;
-y)
echo "updating y coordinate to ${2}"
sed -i '6d' ${DAWN_RUN_DIR}/${OUT_FILE}
sed -i '6i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
shift # past argument
shift # past value
;;
-z)
echo "updating z coordinate to ${2}"
sed -i '7d' ${DAWN_RUN_DIR}/${OUT_FILE}
sed -i '7i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
shift # past argument
shift # past value
;;
--theta)
echo "updating theta angle to ${2}"
sed -i '3d' ${DAWN_RUN_DIR}/${OUT_FILE}
sed -i '3i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
shift # past argument
shift # past value
;;
--phi)
echo "updating phi angle to ${2}"
sed -i '2d' ${DAWN_RUN_DIR}/${OUT_FILE}
sed -i '2i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
shift # past argument
shift # past value
;;
--mag)
echo "updating magnification to ${2}"
sed -i '8d' ${DAWN_RUN_DIR}/${OUT_FILE}
sed -i '8i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
shift # past argument
shift # past value
;;
-i|--input)
OUT_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
#!/bin/bash
#trignometry
sin ()
{
echo "scale=5;s($1)" | bc -l
}
cos ()
{
echo "scale=5;c($1)" | bc -l
}
tan ()
{
echo "scale=5;s($1)/c($1)" | bc -l
}
#export DAWN_PS_PREVIEWER="derp"
function print_the_help {
......@@ -43,19 +59,29 @@ do
done
set -- "${POSITIONAL[@]}" # restore positional parameters
echo "view11 produces a series of slightly rotated XY slices a different z locations. Along beamline"
#dawncut 1 0 0 100 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
#dawncut -1 0 0 100 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
#cp ${INPUT_FILE} ${FILE_TAG}.prim
dawncut 1 0 -0.01666 200 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
dawncut -1 0 0.01666 200 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
dawn -d ${FILE_TAG}.prim
ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
-f ${FILE_TAG}_full.pdf
pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox
dawncut 1 0 -0.01666 200 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim
dawncut -1 0 0.01666 200 ${FILE_TAG}a_temp0.prim ${FILE_TAG}a.prim
dawn -d ${FILE_TAG}a.prim
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
-f ${FILE_TAG}a_full.pdf
pdftoppm ${FILE_TAG}a.pdf ${FILE_TAG}a -png -singlefile -cropbox
......@@ -4,9 +4,9 @@
0
0
0
20000
1.5
3
25000
2.0
1
0.001
0
1
......@@ -17,14 +17,14 @@
0.5
19
71
0.01
0.01
0.01
0.001
0.001
0.001
3
70
0.01
1
1
71
0.001
0
0
1
evince
0
......
1.34392e+07
180
90
90
0
0
0
20000
1.5
3
0
29
1
0.001
0
1
......@@ -17,14 +17,14 @@
0.5
19
71
0.01
0.01
0.01
3
70
0.01
1
0.001
0.001
0.001
1
71
0.001
0
0
1
evince
0
......
#!/bin/bash
echo "view2 produces a series of XY slices a different z locations."
#trignometry
sin ()
{
echo "scale=5;s($1)" | bc -l
}
cos ()
{
echo "scale=5;c($1)" | bc -l
}
tan ()
{
echo "scale=5;s($1)/c($1)" | bc -l
}
function print_the_help {
echo "USAGE: $0 -i <PRIM_FILE> "
......@@ -10,7 +25,7 @@ function print_the_help {
}
FILE_TAG="view12"
INPUT_FILE="g4_0000.prim"
INPUT_FILE="../../g4_0000.prim"
POSITIONAL=()
......@@ -43,21 +58,14 @@ do
done
set -- "${POSITIONAL[@]}" # restore positional parameters
# units are mm
#dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim
#dawncut 0 0 1 1 ${FILE_TAG}a_temp0.prim ${FILE_TAG}a.prim
cp ${INPUT_FILE} ${FILE_TAG}a.prim
dawn -d ${FILE_TAG}a.prim
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
-f ${FILE_TAG}a_full.pdf
pdftoppm ${FILE_TAG}a.pdf ${FILE_TAG}a -png -singlefile -cropbox
echo "view12 produces a series of slightly rotated XY slices a different z locations. Along beamline"
# slice at z = 2m
dawncut 1 0 0.01666 100 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
dawncut -1 0 -0.01666 0 ${FILE_TAG}b_temp0.prim ${FILE_TAG}b.prim
# note the offset has to change with sign of the direction to cut in the opposite direction.
dawncut 0 0 1 2005 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
dawncut 0 0 -1 -2000 ${FILE_TAG}b_temp0.prim ${FILE_TAG}b.prim
dawn -d ${FILE_TAG}b.prim
ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
......@@ -65,6 +73,31 @@ gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
-f ${FILE_TAG}b_full.pdf
pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
original_file_tag="${FILE_TAG}"
make_slice(){
local zpos="$1"
local tagnum=$(printf "%04d" ${zpos})
local FILE_TAG="${original_file_tag}a${tagnum}"
dawncut 0 0 1 ${zpos}1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
dawncut 0 0 -1 -${zpos}0 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
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 50 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
......
1.34392e+07
72.5
189.5
0
0
0
11500
55
5
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
#!/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="view14"
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 "view14 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 -d ${FILE_TAG}b.prim
ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
-f ${FILE_TAG}b_full.pdf
pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
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
cp ${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).
......@@ -113,8 +113,8 @@
<include ref="topside/ecal.xml"/>
<include ref="topside/hcal.xml"/>
<include ref="topside/solenoid.xml"/>
<include ref="topside/topside_rich.xml"/>
<!--
<include ref="topside/topside_rich.xml"/>
-->
<include ref="topside/roman_pots.xml"/>
<include ref="eic/forward_ion_beamline.xml"/>
......
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