100TestGDML.sh
Go to the documentation of this file.
1 #!/bin/sh
2 #
3 # Generate events using a non-trivial GDML geometry.
4 #
5 
6 OUTPUT=100TestGDML.root
7 
8 if [ -f ${OUTPUT} ]; then
9  rm ${OUTPUT}
10 fi
11 
12 cat > 100TestGDML.mac <<EOF
13 #######################################
14 # Set the hit segment.
15 #######################################
16 /edep/hitLength LArTracker 1.0 mm
17 /edep/update
18 
19 # Create the first particle source. This source will be used to
20 # specify the position of the vertex. The any of the GPS direction
21 # and energy commands can be used.
22 /gps/particle mu+
23 /gps/energy 10000 MeV
24 
25 # This generates the position of the particle gun. It can be
26 # used for the other particle guns to create a multi particle event. The
27 # /gps/position command must come first.
28 /gps/position 0.0 0.0 0.0 m
29 /gps/pos/type Volume
30 /gps/pos/shape Para
31 /gps/pos/halfx 50 cm
32 /gps/pos/halfy 50 cm
33 /gps/pos/halfz 50 cm
34 
35 # This generates the direction of the muon. This aims
36 # the particle downstream with the directions uniformly distributed in
37 # a 10 deg cone around the Z axis.
38 /gps/ang/type iso
39 /gps/ang/rot1 1 0 0
40 /gps/ang/rot2 0 -1 0
41 
42 /generator/count/fixed/number 300
43 /generator/count/set fixed
44 
45 /generator/add
46 EOF
47 
48 edep-sim -o ${OUTPUT} -g ${EDEP_ROOT}/inputs/example.gdml \
49  -e 1 100TestGDML.mac
50 
51