-
Notifications
You must be signed in to change notification settings - Fork 5
/
search_compact_params.sh
executable file
·55 lines (47 loc) · 1.09 KB
/
search_compact_params.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# return parameter value(s) from compact files, given search term
set -e
# check environment
if [ -z "$DETECTOR_PATH" ]; then
echo "ERROR: source environ.sh first"
exit 1
fi
# usage
function usage {
echo """
USAGE:
$0 [CONFIGURATION]
CONFIGURATIONS: (one required)
-e default EPIC detector
-a arches (mRICH)
-b brycecanyon (pfRICH)
-c <compact_file>
custom compact file
For -e,-a,-b, compact files are assumed to be at
\$DETECTOR_PATH = $DETECTOR_PATH
(rendered by build.sh epic)
Use grep to search the output
"""
exit 2
}
if [ $# -eq 0 ]; then usage; fi
# parse options
while getopts "heabc:" opt; do
case $opt in
h|\?) usage ;;
e) compactFile="${DETECTOR_PATH}/${DETECTOR}.xml" ;;
a) compactFile="${DETECTOR_PATH}/${DETECTOR}_arches.xml" ;;
b) compactFile="${DETECTOR_PATH}/${DETECTOR}_brycecanyon.xml" ;;
c) compactFile=$OPTARG ;;
esac
done
echo """
compactFile = $compactFile
"""
if [ -z "$compactFile" ]; then
echo "ERROR: specify CONFIGURATION"
usage
exit 1
fi
# dump table
npdet_info dump $compactFile