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