Jpp  master_rocky
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+ KEEP SIRENE_KEEP -k
22 set_variable+ WRITE_EMSHOWERS SIRENE_WRITE_EMSHOWERS -s
23 set_variable: NUMBER_OF_HITS SIRENE_NUMBER_OF_HITS 1
24 set_variable: SEED SIRENE_SEED 0
25 set_variable: FACTOR SIRENE_FACTOR 1.0
26 set_variable: CDF SIRENE_CDF $JPP_DATA/I%p.dat
27 
28 if do_usage $*; then
29  usage "$script <detector file> (input file)+ <output file>"\
30  "\nAuxiliary script for simulation of detector response."
31 fi
32 
33 if (( $# < 3 )); then
34  fatal "Wrong number of arguments."
35 fi
36 
37 set_variable DETECTOR $argv[1]
38 set_variable INPUT_FILE $argv[2,-2]
39 set_variable OUTPUT_FILE $argv[-1]
40 
41 # Sanity checks
42 
43 for TYPE in 1 2 5 6 13 14; do
44  if [[ ! -f ${CDF/\%/${TYPE}} ]]; then
45  error "Missing CDF files."
46  error "Run: JMakePDF.sh"
47  JMakePDF.sh -h
48  exit
49  fi
50 done
51 
52 timer_start
53 
54 JSirene \
55  -F $CDF \
56  -a $DETECTOR \
57  -f $INPUT_FILE \
58  -o $OUTPUT_FILE \
59  -@ "Tmax_ns = 2.0;" \
60  -@ "Nmax_PMT = 1000000;" \
61  -U $FACTOR \
62  $KEEP \
63  $WRITE_EMSHOWERS \
64  -N $NUMBER_OF_HITS \
65  -S $SEED \
66  -d $DEBUG --!
67 
68 timer_stop
69 timer_print
70 
71 JPrintMeta \
72  -f $OUTPUT_FILE
73 
74 JPrintSirene \
75  -f $OUTPUT_FILE
76 
77 JPrintTree \
78  -f $OUTPUT_FILE