Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
examples/JTimeslice/JRandomTimesliceWriter.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3#
4# \author mdejong
5#
6version=1.0
7script=${0##*/}
8
9# ------------------------------------------------------------------------------------------
10#
11# Utility script to test JRadomTimesliceWriter.
12#
13# ------------------------------------------------------------------------------------------
14
15if [ -z $JPP_DIR ]; then
16 echo "Variable JPP_DIR undefined."
17 exit
18fi
19
20source $JPP_DIR/setenv.sh $JPP_DIR
21
22set_variable DEBUG 2
23set_variable DIR $JPP_DIR/examples/JTimeslice/
24set_variable WORKDIR ${TMPDIR:-/tmp}/
25
26if do_usage $*; then
27 usage "$script [working directory]"
28fi
29
30case $# in
31 1) set_variable WORKDIR $1;;
32esac
33
34set_variable BACKGROUND_HZ 10e3
35set_variable numberOfSlices 1000
36set_variable RECYCLING 5 100e3
37
38if ( ! reuse_file $WORKDIR/timeslice.root); then
39
40 $DIR/JRandomTimesliceWriter \
41 -o $WORKDIR/timeslice.root \
42 -B "$BACKGROUND_HZ" \
43 -n $numberOfSlices \
44 -N "$RECYCLING" \
45 -d $DEBUG --!
46fi
47
48for (( N = 1; $N <= $RECYCLING[1]; ++N )); do
49
50 JPlot1D \
51 -w 1200x600 \
52 -f "$WORKDIR/timeslice.root:h0\[0\]" \
53 -f "$WORKDIR/timeslice.root:h0\[${N}\]" \
54 -> "time [ns]" \
55 -\^ "number of hits [a.u.]" \
56 -T "$N"
57done