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

modified: bin/make_dawn_views

	new file:   scripts/view6/.DAWN_1.default
	new file:   scripts/view6/.DAWN_1.history
	new file:   scripts/view6/generate_eps
	modified:   src/SiTrackerEndcap_geo.cpp
parent 963fb8ba
......@@ -93,3 +93,13 @@ 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
1.34392e+07
0
180
0
0
0
0
8.6
1
0.001
0
1
1
1
0.5
0.5
0.5
19
71
0.01
0.01
0.01
3
70
0.01
1
1
1
evince
0
0
1
n
1.34392e+07
0
180
0
0
0
0
8.6
1
0.001
0
1
1
1
0.5
0.5
0.5
19
71
0.01
0.01
0.01
3
70
0.01
1
1
1
evince
0
0
#!/bin/bash
echo "view6 produces a series of XY slices a different z locations."
function print_the_help {
echo "USAGE: $0 <PRIM_FILE> "
echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)"
exit
}
FILE_TAG="view6"
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
#
#SiTracker Endcap layer 1 zstart = 200mm ( 30 mm thick )
#SiTracker Endcap layer 2 zstart = 365mm ( 70 mm thick )
#SiTracker Endcap layer 3 zstart = 530mm ( 70 mm thick )
#SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
#SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick )
# 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
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
#SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick )
dawncut 0 0 1 945 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
dawncut 0 0 -1 -865 ${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
#SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
dawncut 0 0 1 780 ${INPUT_FILE} ${FILE_TAG}c_temp0.prim
dawncut 0 0 -1 -700 ${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
#SiTracker Endcap layer 3 zstart = 530mm ( 70 mm thick )
# slice at z = -1m
dawncut 0 0 1 595 ${INPUT_FILE} ${FILE_TAG}d_temp0.prim
dawncut 0 0 -1 -535 ${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
#SiTracker Endcap layer 2 zstart = 365mm ( 70 mm thick )
# slice at z = -2m
dawncut 0 0 1 430 ${INPUT_FILE} ${FILE_TAG}e_temp0.prim
dawncut 0 0 -1 -370 ${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
#SiTracker Endcap layer 1 zstart = 200mm ( 30 mm thick )
dawncut 0 0 1 225 ${INPUT_FILE} ${FILE_TAG}f_temp0.prim
dawncut 0 0 -1 205 ${FILE_TAG}f_temp0.prim ${FILE_TAG}f.prim
dawn -d ${FILE_TAG}f.prim
ps2pdf ${FILE_TAG}f.eps ${FILE_TAG}f_full.pdf
gs -o ${FILE_TAG}f.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
-f ${FILE_TAG}f_full.pdf
pdftoppm ${FILE_TAG}f.pdf ${FILE_TAG}f -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).
......@@ -96,13 +96,14 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
int l_id = x_layer.id();
xml_comp_t l_env = x_layer.child(_U(envelope));
string layer_name = std::string("endcap_layer") + std::to_string(l_id);
string layer_name = std::string("siTracker_endcap_layer") + std::to_string(l_id);
std::string layer_vis = l_env.attr<std::string>(_Unicode(vis));
double layer_rmin = l_env.attr<double>(_Unicode(rmin));
double layer_rmax = l_env.attr<double>(_Unicode(rmax));
double layer_length = l_env.attr<double>(_Unicode(length));
double layer_zstart = l_env.attr<double>(_Unicode(zstart));
std::cout << "SiTracker Endcap layer " << l_id << " zstart = " << layer_zstart/dd4hep::mm << "mm ( " << layer_length/dd4hep::mm << " mm thick )\n";
//Assembly layer_assembly(layer_name);
//assembly.placeVolume(layer_assembly);
......
Supports Markdown
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