Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JLegolas.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2
3version=1.0
4script=${0##*/}
5
6# ------------------------------------------------------------------------------------------
7#
8# Utility script to create PDF and CDF of transition-time distribution.
9#
10# ------------------------------------------------------------------------------------------
11
12if [ -z $JPP_DIR ]; then
13 echo "Variable JPP_DIR undefined."
14 exit
15fi
16
17source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
18
19set_variable DEBUG 2
20set_variable WORKDIR ${TMPDIR:-/tmp}/
21set_variable DAQ_TIMESLICE JDAQTimeslice
22set_variable: FORMAT GRAPHICS_FORMAT gif
23set_variable+ BATCH GRAPHICS_BATCH -B
24
25if do_usage $*; then
26 usage "$script <detector file> <input file> [time slice [working directory]]"\
27 "\nUtility script to create PDF and CDF of transition-time distribution."
28fi
29
30case $# in
31 4) set_variable WORKDIR $4;&
32 3) set_variable DAQ_TIMESLICE $3;&
33 2) set_variable INPUT_FILE $2;
34 set_variable DETECTOR $1;;
35 *) fatal "Wrong number of arguments."
36esac
37
38cp -v $DETECTOR $WORKDIR/detector.detx
39
40for (( i = 0; $i != 2; ++i )); do
41
42 timer_start
43
44 JPulsar \
45 -f $INPUT_FILE \
46 -C $DAQ_TIMESLICE \
47 -a $WORKDIR/detector.detx \
48 -A \
49 -! "-1 7" \
50 -! "-1 15" \
51 -o $WORKDIR/pulsar.root \
52 -d $DEBUG --!
53
54 timer_stop
55 timer_print
56
57done
58
59
60JLegolas \
61 -f $WORKDIR/pulsar.root \
62 -P $WORKDIR/pdf.txt \
63 -C $WORKDIR/cdf.txt \
64 -o $WORKDIR/legolas.root \
65 -d $DEBUG --!
66
67JPlot1D \
68 -f $WORKDIR/legolas.root:pmt \
69 -f $WORKDIR/legolas.root:g1 \
70 -> "#Deltat [ns]" \
71 -CC \
72 -y "1e-6 1e-0" -Y \
73 -T "PMT" \
74 -o $WORKDIR/tts.$FORMAT $BATCH