Warning, /epic/scripts/view20/generate_eps is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env bash
0002
0003 #export DAWN_PS_PREVIEWER="derp"
0004
0005 function print_the_help {
0006 echo "USAGE: $0 <PRIM_FILE> "
0007 echo " OPTIONS: "
0008 echo " -t,--tag filename tag (default: view1)"
0009 exit
0010 }
0011
0012 FILE_TAG="view20"
0013 INPUT_FILE="../../g4_0000.prim"
0014
0015
0016 POSITIONAL=()
0017 while [[ $# -gt 0 ]]
0018 do
0019 key="$1"
0020
0021 case $key in
0022 -h|--help)
0023 shift # past argument
0024 print_the_help
0025 ;;
0026 -t|--tag)
0027 FILE_TAG="$2"
0028 shift # past argument
0029 shift # past value
0030 ;;
0031 -i|--input)
0032 INPUT_FILE="$2"
0033 shift # past argument
0034 shift # past value
0035 ;;
0036 *) # unknown option
0037 #POSITIONAL+=("$1") # save it in an array for later
0038 echo "unknown option $1"
0039 print_the_help
0040 shift # past argument
0041 ;;
0042 esac
0043 done
0044 set -- "${POSITIONAL[@]}" # restore positional parameters
0045
0046
0047 # Top view with a thin slice down the middle
0048 dawncut 0 1 0 1 ${INPUT_FILE} ${FILE_TAG}_top_temp0.prim
0049 dawncut 0 -1 0 1 ${FILE_TAG}_top_temp0.prim ${FILE_TAG}_top.prim
0050 ../../bin/dawn_tweak --mag 2 --draw 1 --theta 90 --phi 90
0051 dawn -d ${FILE_TAG}_top.prim
0052 ps2pdf ${FILE_TAG}_top.eps ${FILE_TAG}_top_full.pdf
0053 gs -o ${FILE_TAG}_top.pdf -sDEVICE=pdfwrite \
0054 -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
0055 -f ${FILE_TAG}_top_full.pdf
0056 pdftoppm ${FILE_TAG}_top.pdf ${FILE_TAG}_top -png -singlefile -cropbox -thinlinemode solid -aaVector yes
0057
0058 # Side view (lines)
0059 dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
0060 dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
0061 ../../bin/dawn_tweak --mag 1 --draw 1 --theta 180 --phi 90
0062 dawn -d ${FILE_TAG}.prim
0063 ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
0064 gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
0065 -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
0066 -f ${FILE_TAG}_full.pdf
0067 pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox -thinlinemode solid -aaVector yes
0068
0069 #npdet_info print EcalEndcapN_z0 --value-only ../../${DETECTOR}.xml
0070 #180.5 cm
0071 zcut=$(npdet_info print EcalEndcapN_z0 --value-only ${DETECTOR_PATH}/${DETECTOR}.xml )
0072 NMOD1=$(npdet_info print EcalEndcapN_NModules_Sector1 --value-only ${DETECTOR_PATH}/calorimeters.xml )
0073 NMOD2=$(npdet_info print EcalEndcapN_NModules_Sector2 --value-only ${DETECTOR_PATH}/calorimeters.xml )
0074
0075 echo "NMOD1 = ${NMOD1}"
0076 echo "NMOD2 = ${NMOD2}"
0077 echo "zcut = ${zcut}"
0078
0079 # Top view with a thin slice down the middle
0080 dawncut 0 0 1 -1800 ${INPUT_FILE} ${FILE_TAG}_endcapN_temp0.prim
0081 dawncut 0 0 -1 2200 ${FILE_TAG}_endcapN_temp0.prim ${FILE_TAG}_endcapN.prim
0082 ../../bin/dawn_tweak --mag 5 --draw 3 --theta 180 --phi 0
0083 dawn -d ${FILE_TAG}_endcapN.prim
0084 ps2pdf ${FILE_TAG}_endcapN.eps ${FILE_TAG}_endcapN_full.pdf
0085 gs -o ${FILE_TAG}_endcapN.pdf -sDEVICE=pdfwrite \
0086 -c "[/CropBox [50 170 550 670] /PAGES pdfmark" \
0087 -f ${FILE_TAG}_endcapN_full.pdf
0088 pdftoppm ${FILE_TAG}_endcapN.pdf ${FILE_TAG}_endcapN -png -singlefile -cropbox -thinlinemode solid \
0089 -aaVector yes -r 1200
0090 convert -pointsize 180 -fill black -draw "text 200,200 \"$NMOD1 Crystals\"" \
0091 ${FILE_TAG}_endcapN.png ${FILE_TAG}_endcapN.png
0092 convert -pointsize 180 -fill black -draw "text 200,400 \"$NMOD2 Glasses\"" \
0093 ${FILE_TAG}_endcapN.png ${FILE_TAG}_endcapN.png