Jpp  master_rocky-37-gf0c5bc59d
the software that should make you happy
JSirene.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Auxiliary script to run JSirene.
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 if [ -z $JPP_DIR ]; then
14  echo "Variable JPP_DIR undefined."
15  exit
16 fi
17 
18 source $JPP_DIR/setenv.sh $JPP_DIR
19 
20 set_variable: DEBUG SIRENE_DEBUG 1
21 set_variable+ WRITE_EMSHOWERS SIRENE_WRITE_EMSHOWERS -s
22 set_variable: NUMBER_OF_HITS SIRENE_NUMBER_OF_HITS 1
23 set_variable: SEED SIRENE_SEED 0
24 set_variable: FACTOR SIRENE_FACTOR 1.0
25 set_variable: CDF SIRENE_CDF $JPP_DATA/I%p.dat
26 
27 if do_usage $*; then
28  usage "$script <detector file> (input file)+ <output file>"\
29  "\nAuxiliary script for simulation of detector response."
30 fi
31 
32 if (( $# < 3 )); then
33  fatal "Wrong number of arguments."
34 fi
35 
36 set_variable DETECTOR $argv[1]
37 set_variable INPUT_FILE $argv[2,-2]
38 set_variable OUTPUT_FILE $argv[-1]
39 
40 # Sanity checks
41 
42 for TYPE in 1 2 5 6 13 14; do
43  if [[ ! -f ${CDF/\%/${TYPE}} ]]; then
44  error "Missing CDF files."
45  error "Run: JMakePDF.sh"
46  JMakePDF.sh -h
47  exit
48  fi
49 done
50 
51 timer_start
52 
53 JSirene \
54  -F $CDF \
55  -a $DETECTOR \
56  -f $INPUT_FILE \
57  -o $OUTPUT_FILE \
58  -@ "Tmax_ns = 2.0;" \
59  -@ "Nmax_PMT = 1000000;" \
60  -U $FACTOR \
61  $WRITE_EMSHOWERS \
62  -N $NUMBER_OF_HITS \
63  -S $SEED \
64  -d $DEBUG --!
65 
66 timer_stop
67 timer_print
68 
69 JPrintMeta \
70  -f $OUTPUT_FILE
71 
72 JPrintSirene \
73  -f $OUTPUT_FILE
74 
75 JPrintTree \
76  -f $OUTPUT_FILE