Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
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 
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
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
set_variable DETECTOR
Definition: JLegolas.sh:31
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
exit
Definition: JPizza.sh:36
&set_variable INPUT_FILE
Definition: JLegolas.sh:30
fi JEventTimesliceWriter a
then JPizza f
Definition: JPizza.sh:46
then echo
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JPath.sh:52
* usage
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
alias put_queue eval echo n
Definition: qlib.csh:19
then display $WORKDIR
Definition: plot-Domino.sh:142
version
Definition: JCalibratePMT.sh:7
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62