100TestTree.sh
Go to the documentation of this file.
1 #!/bin/sh
2 #
3 # Write a ROOT file in the default geometry. This output file should
4 # be tested to make sure that all of the fields are readable.
5 
6 OUTPUT=100TestTree.root
7 
8 if [ -f ${OUTPUT} ]; then
9  rm ${OUTPUT}
10 fi
11 
12 cat > 100TestTree.mac <<EOF
13 #######################################
14 # Set the hit segment.
15 #######################################
16 /edep/hitSagitta drift 1.0 mm
17 /edep/hitLength drift 1.0 mm
18 /edep/update
19 
20 # Make sure that the GPS generator is it's default state.
21 /gps/source/clear
22 
23 # Enable generating multiple particle guns per event.
24 /gps/source/multiplevertex true
25 
26 #######################################
27 # The first particle source
28 #######################################
29 /gps/source/add 1
30 
31 # Create the first particle source. This source will be used to
32 # specify the position of the vertex. The any of the GPS direction
33 # and energy commands can be used.
34 /gps/particle mu+
35 /gps/energy 700 MeV
36 
37 # This generates the position of the particle gun. It can be
38 # used for the other particle guns to create a multi particle event. The
39 # /gps/position command must come first.
40 /gps/position 0.0 0.0 -0.50 m
41 /gps/pos/type Volume
42 /gps/pos/shape Para
43 /gps/pos/halfx 20 cm
44 /gps/pos/halfy 20 cm
45 /gps/pos/halfz 20 cm
46 
47 # This generates the direction of the muon.
48 /gps/ang/type iso
49 # /gps/ang/maxtheta 15 deg
50 /gps/ang/rot1 1 0 0
51 /gps/ang/rot2 0 -1 0
52 
53 #########################################
54 # Create the second particle source.
55 #########################################
56 /gps/source/add 2
57 /gps/particle proton
58 /gps/energy 200 MeV
59 
60 # This generates the direction of the second particle gun.
61 /gps/ang/type iso
62 # /gps/ang/maxtheta 25 deg
63 /gps/ang/rot1 0 0 1
64 /gps/ang/rot2 0 1 0
65 
66 # Create the GPS particle generator so it exists.
67 /generator/add
68 
69 # Copy the vertex position of the first particle into the second particle.
70 /generator/combine 0 1
71 
72 EOF
73 
74 edep-sim -o ${OUTPUT} -C -e 100 100TestTree.mac