Jpp
JRandomTimesliceWriterRunByRun.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Example script to run JRandomTimesliceWriter.
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 ${TIMESLICE_DEBUG:-2}
21 set_variable WORKDIR ./
22 set_variable OUTPUT_FILE $WORKDIR/timeslice.root
23 set_variable DETECTOR $JPP_DATA/km3net_reference.detx
24 set_variable PMT_FILE $JPP_DATA/PMT_parameters.txt
25 set_variable BACKGROUND_HZ ${TIMESLICE_BACKGROUND_HZ:-${BACKGROUND_HZ:-5e3 500 50 5 0.5}}
26 set_variable NUMBER_OF_EVENTS 10
27 set_variable SEED ${TIMESLICE_SEED:-0}
28 
29 if ( do_usage $* ); then
30  usage "$script <detector file> <output file> <DAQ file> [PMT parameters file [number of events]]"
31 fi
32 
33 case $# in
34  5) set_variable NUMBER_OF_EVENTS $5;&
35  4) set_variable PMT_FILE $4;&
36  3) set_variable DAQ_FILE $3;
37  set_variable OUTPUT_FILE $2;
38  set_variable DETECTOR $1;;
39  *) fatal "Wrong number of arguments.";;
40 esac
41 
42 RUNBYRUN="file=$DAQ_FILE; sampler=1 1000; range_Hz=1e3 1e5"
43 
44 JRandomTimesliceWriter \
45  -a ${DETECTOR} \
46  -o ${OUTPUT_FILE} \
47  -P ${PMT_FILE} \
48  -B "$BACKGROUND_HZ" \
49  -r "${RUNBYRUN}" \
50  -n ${NUMBER_OF_EVENTS} \
51  -d ${DEBUG} \
52  --!