Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JPrintTDC.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4if [ -z $JPP_DIR ]; then
5 echo "Variable JPP_DIR undefined."
6 exit
7fi
8
9source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10
11set_variable DIR $JPP_DIR/examples/JDB
12set_variable WORKDIR ${TMPDIR:-/tmp}
13
14if do_usage $*; then
15 usage "$script <detector file> <TDC file>"
16fi
17
18case $# in
19 2) set_variable DETECTOR $1;
20 set_variable TDC $2;;
21 *) fatal "Wrong number of arguments."
22esac
23
24kill_child_processes_at_exit
25
26attach getLocation -a $DETECTOR
27
28rm -f ${TMPDIR:-/tmp}/TDC.txt
29
30exec 3<>$TDC
31
32while read MODULE PMT <& 3; do
33
34 sput $MODULE
35 sget STRING FLOOR
36
37 echo $STRING $FLOOR $PMT >> ${TMPDIR:-/tmp}/TDC.txt
38
39done
40
41detach
42
43sort -k1n -k2n -k3n ${TMPDIR:-/tmp}/TDC.txt
44