Jpp test-rotations-old-533-g2bdbdb559
the software that should make you happy
Loading...
Searching...
No Matches
coelacanth.sh
Go to the documentation of this file.
1#!/bin/env zsh
2#
3# \author mdejong
4#
5script=${0##*/}
6
7source $JPP_DIR/setenv.sh $JPP_DIR
8
9set_variable STDEV 10.0
10
11if do_usage $*; then
12 usage "$script (input file)+"
13fi
14
15if (( $# == 0 )); then
16 fatal "Wrong number of arguments."
17fi
18
19set_array INPUT_FILES $argv[1,-1]
20
21DETECTOR_ID=-1
22
23RUNS=()
24
25for INPUT_FILE in $INPUT_FILES[*]; do
26
27 JPrintDAQHeader -f $INPUT_FILE | read ID RUN FRAME_INDEX UTC
28
29 if (( $DETECTOR_ID == -1 )); then
30 DETECTOR_ID=$ID
31 elif (( $DETECTOR_ID != $ID )); then
32 fatal "Inconsistent detector identifier $DETECTOR_ID != $ID."
33 fi
34
35 RUNS+=($RUN)
36done
37
38set_variable DETID $(getDetector -D $DETECTOR_ID -O string)
39set_variable DETECTOR $DETID.datx
40
41if [[ ! -f $DETECTOR ]]; then
42 JDetectorDB -D $DETID -r $RUNS[1] -o $DETECTOR
43fi
44
45for INPUT_FILE in $INPUT_FILES[*]; do
46
47 JPrintDAQHeader -f $INPUT_FILE | read ID RUN FRAME_INDEX UTC
48
49 echo "Processing $INPUT_FILE (1)" >& $DETID.$RUN.log
50
51 rm -f ${DETID}.trigger.root #>& /dev/null
52
53 JTriggerReprocessor \
54 -a $DETECTOR \
55 -f $INPUT_FILE \
56 -US \
57 -o ${DETID}.trigger.root \
58 -C -\.\* \
59 -d1 #>& /dev/null
60
61 JConvertDetectorFormat \
62 -a $DETECTOR \
63 -o ${DETID}.detector.datx #>& /dev/null
64
65 JCoelacanth \
66 -a ${DETID}.detector.datx \
67 -f $INPUT_FILE \
68 -f ${DETID}.trigger.root \
69 -S $STDEV \
70 -A \
71 -d1 >>& $DETID.$RUN.log
72
73 echo "Processing $INPUT_FILE (2)" >>& $DETID.$RUN.log
74
75 rm -f ${DETID}.trigger.root #>& /dev/null
76
77 JTriggerReprocessor \
78 -a ${DETID}.detector.datx \
79 -f $INPUT_FILE \
80 -US \
81 -o ${DETID}.trigger.root \
82 -C -\.\* \
83 -d0 #>& /dev/null
84
85 JCoelacanth \
86 -a ${DETID}.detector.datx \
87 -f $INPUT_FILE \
88 -f ${DETID}.trigger.root \
89 -S $STDEV \
90 -d1 >>& $DETID.$RUN.log
91
92 echo >>& $DETID.$RUN.log
93done