Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #!/usr/bin/env bash
0002 
0003 echo "view7 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="view7"
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 # units are mm
0054 dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim
0055 dawncut 0 0 1 1  ${FILE_TAG}a_temp0.prim  ${FILE_TAG}a.prim
0056 dawn -d ${FILE_TAG}a.prim
0057 ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
0058 gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
0059   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0060   -f ${FILE_TAG}a_full.pdf
0061 pdftoppm ${FILE_TAG}a.pdf ${FILE_TAG}a -png -singlefile -cropbox
0062 
0063 #SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick )
0064 dawncut 0 0 1 225 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
0065 dawncut 0 0 -1 205 ${FILE_TAG}b_temp0.prim  ${FILE_TAG}b.prim
0066 dawn -d ${FILE_TAG}b.prim
0067 ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
0068 gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
0069   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0070   -f ${FILE_TAG}b_full.pdf
0071 pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
0072 
0073 
0074 #https://geant4.kek.jp/~tanaka/DAWN/About_DAWNCUT.html
0075 # % dawncut a b c d input-file [output-file]
0076 #
0077 #       input-file : Source DAWN-format file describing a 3D scene.
0078 #
0079 #       output-file: Output DAWN-format file describing a plane-clipped
0080 #                    3D scene.  The default output stream is stdout.
0081 #
0082 #       a, b, c, d : Parameters  a, b, c, and d  are double values to
0083 #                    define a clipping plane described with the following
0084 #                    equation:
0085 #
0086 #                       ax + by + cz + d = 0.
0087 #
0088 #                    Vector (a,b,c) defines the normal vector of
0089 #                    the clipping plane.
0090 #                    3D scene data in the half space at the front side
0091 #                    of the clipping plane are clipped out and erased.
0092 #                    The normal vector (a,b,c) needs not be a unit vector.
0093 #                    If it is a unit vector, parameter "d" gives distance
0094 #                    between the clipping plane and origin (0,0,0).