Jpp  debug
the software that should make you happy
archive-get-Detector.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 WORKDIR ${TMPDIR:-/tmp}/
12 set_variable: DEBUG ARCHIVE_DEBUG 2
13 set_variable VERSION "*"
14 
15 if do_usage $*; then
16  usage "$script <archive> <detector identifier> <run> <type> <output file> [version]"\
17  "\nGet detector file from archive."
18 fi
19 
20 case $# in
21  6) set_variable VERSION $argv[6];&
22  5) set_variable OUTPUT_FILE $argv[5];
23  set_variable TYPE $argv[4];
24  set_variable RUN $argv[3];
25  set_variable DETECTOR_ID $argv[2];
26  set_variable ARCHIVE $argv[1];;
27  *) fatal "Wrong number of arguments.";;
28 esac
29 
30 
31 set_variable DETECTOR `mktemp $WORKDIR/detectorXXXXXX`
32 
33 getFile.sh $ARCHIVE $DETECTOR_ID $RUN $TYPE $VERSION $DETECTOR
34 
35 CHECK_EXIT_CODE
36 
37 JConvertDetectorFormat -a $DETECTOR.* -o $OUTPUT_FILE --!
38 
39 CHECK_EXIT_CODE
40 
41 rm -f $DETECTOR $DETECTOR.* >& /dev/null