Back to home page

EIC code displayed by LXR

 
 

    


Warning, /epic/scripts/view6/generate_eps is written in an unsupported language. File is not indexed.

0001 #!/usr/bin/env bash
0002 
0003 echo "view6 produces a series of XY slices  a different z locations."
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="view06"
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 #SiTracker Endcap layer 1 zstart = 200mm ( 30 mm thick )
0048 #SiTracker Endcap layer 2 zstart = 365mm ( 70 mm thick )
0049 #SiTracker Endcap layer 3 zstart = 530mm ( 70 mm thick )
0050 #SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
0051 #SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick )
0052 
0053 dawncut 0 0 -1 1000 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim
0054 dawncut 0 0 1 1000  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}_input.prim
0055 
0056 INPUT_FILE=${FILE_TAG}_input.prim
0057 
0058 
0059 # units are mm
0060 dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim
0061 dawncut 0 0 1 1  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
0062 ../../bin/dawn_tweak --mag 14
0063 dawn -d ${FILE_TAG}a.prim
0064 ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
0065 gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
0066   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0067   -f ${FILE_TAG}a_full.pdf
0068 pdftoppm ${FILE_TAG}a.pdf ${FILE_TAG}a -png -singlefile -cropbox
0069 
0070 #SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick )
0071 dawncut 0 0 1   945   ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
0072 dawncut 0 0 -1 -865 ${FILE_TAG}b_temp0.prim  ${FILE_TAG}b.prim
0073 ../../bin/dawn_tweak --mag 14
0074 dawn -d ${FILE_TAG}b.prim
0075 ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
0076 gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
0077   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0078   -f ${FILE_TAG}b_full.pdf
0079 pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
0080 
0081 #SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
0082 dawncut 0 0 1 780   ${INPUT_FILE} ${FILE_TAG}c_temp0.prim
0083 dawncut 0 0 -1 -700 ${FILE_TAG}c_temp0.prim  ${FILE_TAG}c.prim
0084 ../../bin/dawn_tweak --mag 14
0085 dawn -d ${FILE_TAG}c.prim
0086 ps2pdf ${FILE_TAG}c.eps ${FILE_TAG}c_full.pdf
0087 gs -o ${FILE_TAG}c.pdf -sDEVICE=pdfwrite \
0088   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0089   -f ${FILE_TAG}c_full.pdf
0090 pdftoppm ${FILE_TAG}c.pdf ${FILE_TAG}c -png -singlefile -cropbox
0091 
0092 #SiTracker Endcap layer 3 zstart = 530mm ( 70 mm thick )
0093 # slice at z = -1m
0094 dawncut 0 0 1 595 ${INPUT_FILE} ${FILE_TAG}d_temp0.prim
0095 dawncut 0 0 -1 -535 ${FILE_TAG}d_temp0.prim  ${FILE_TAG}d.prim
0096 dawn -d ${FILE_TAG}d.prim
0097 ps2pdf ${FILE_TAG}d.eps ${FILE_TAG}d_full.pdf
0098 gs -o ${FILE_TAG}d.pdf -sDEVICE=pdfwrite \
0099   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0100   -f ${FILE_TAG}d_full.pdf
0101 pdftoppm ${FILE_TAG}d.pdf ${FILE_TAG}d -png -singlefile -cropbox
0102 
0103 #SiTracker Endcap layer 2 zstart = 365mm ( 70 mm thick )
0104 # slice at z = -2m
0105 dawncut 0 0 1 430 ${INPUT_FILE} ${FILE_TAG}e_temp0.prim
0106 dawncut 0 0 -1 -370 ${FILE_TAG}e_temp0.prim  ${FILE_TAG}e.prim
0107 ../../bin/dawn_tweak --mag 14
0108 dawn -d ${FILE_TAG}e.prim
0109 ps2pdf ${FILE_TAG}e.eps ${FILE_TAG}e_full.pdf
0110 gs -o ${FILE_TAG}e.pdf -sDEVICE=pdfwrite \
0111   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0112   -f ${FILE_TAG}e_full.pdf
0113 pdftoppm ${FILE_TAG}e.pdf ${FILE_TAG}e -png -singlefile -cropbox
0114 
0115 #SiTracker Endcap layer 1 zstart = 200mm ( 30 mm thick )
0116 dawncut 0 0 1 225 ${INPUT_FILE} ${FILE_TAG}f_temp0.prim
0117 dawncut 0 0 -1 205 ${FILE_TAG}f_temp0.prim  ${FILE_TAG}f.prim
0118 ../../bin/dawn_tweak --mag 14
0119 dawn -d ${FILE_TAG}f.prim
0120 ps2pdf ${FILE_TAG}f.eps ${FILE_TAG}f_full.pdf
0121 gs -o ${FILE_TAG}f.pdf -sDEVICE=pdfwrite \
0122   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0123   -f ${FILE_TAG}f_full.pdf
0124 pdftoppm ${FILE_TAG}f.pdf ${FILE_TAG}f -png -singlefile -cropbox
0125 
0126 #https://geant4.kek.jp/~tanaka/DAWN/About_DAWNCUT.html
0127 # % dawncut a b c d input-file [output-file]
0128 #
0129 #       input-file : Source DAWN-format file describing a 3D scene.
0130 #
0131 #       output-file: Output DAWN-format file describing a plane-clipped
0132 #                    3D scene.  The default output stream is stdout.
0133 #
0134 #       a, b, c, d : Parameters  a, b, c, and d  are double values to
0135 #                    define a clipping plane described with the following
0136 #                    equation:
0137 #
0138 #                       ax + by + cz + d = 0.
0139 #
0140 #                    Vector (a,b,c) defines the normal vector of
0141 #                    the clipping plane.
0142 #                    3D scene data in the half space at the front side
0143 #                    of the clipping plane are clipped out and erased.
0144 #                    The normal vector (a,b,c) needs not be a unit vector.
0145 #                    If it is a unit vector, parameter "d" gives distance
0146 #                    between the clipping plane and origin (0,0,0).