Jpp
JSampler.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 version=1.0
6 script=${0##*/}
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Utility script to test JSampler.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 
15 if [ -z $JPP_DIR ]; then
16  echo "Variable JPP_DIR undefined."
17  exit
18 fi
19 
20 
21 source $JPP_DIR/setenv.sh $JPP_DIR
22 
23 
24 set_variable DEBUG 0
25 set_variable WORKDIR /tmp/
26 
27 if ( do_usage $* ); then
28  usage "$script [working directory]"
29 fi
30 
31 case $# in
32  1) WORKDIR=$1;;
33 esac
34 
35 
36 set_variable detectorType 1
37 set_variable numberOfLines 1
38 set_variable numberOfFloors 1
39 
40 set_variable numberOfSlices 10
41 set_variable singlesRate_Hz 500.0
42 
43 set_variable DETECTOR $WORKDIR/detector.dat
44 set_variable INPUT_FILE $WORKDIR/timeslice.dat
45 set_variable OUTPUT_FILE $WORKDIR/trigger_processor.dat
46 set_variable SAMPLING 5 5
47 
48 
49 if (( 1 )); then
50 
51  JDetector \
52  -D 1 \
53  -@detectorType=$detectorType \
54  -@numberOfLines=$numberOfLines \
55  -@numberOfFloors=$numberOfFloors \
56  -o $DETECTOR -V V2 \
57  -d $DEBUG
58 
59 fi
60 
61 if (( 1 )); then
62 
63  JRandomTimesliceWriter \
64  -a $DETECTOR \
65  -o $INPUT_FILE \
66  -n $numberOfSlices \
67  -B "$singlesRate_Hz" \
68  -d $DEBUG
69 
70 fi
71 
72 if (( 1 )); then
73 
74  JTriggerProcessor \
75  -a $DETECTOR \
76  -f $INPUT_FILE \
77  -o $OUTPUT_FILE \
78  -@"writeSummary=1" \
79  -d $DEBUG
80 
81 fi
82 
83 if (( 1 )); then
84 
85  echo "Default sampling."
86 
87  $JPP_DIR/examples/JSupport/JSampler \
88  -f $OUTPUT_FILE \
89  -n 100
90 
91 fi
92 
93 if (( 1 )); then
94 
95  echo "Random sampling ${SAMPLING}."
96 
97  JSampler \
98  -f $OUTPUT_FILE \
99  -R $SAMPLING \
100  -n 100
101 
102 fi