Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
getMechanics.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4#
5script=${0##*/}
6
7if [ -z $JPP_DIR ]; then
8 echo "Variable JPP_DIR undefined."
9 exit
10fi
11
12source $JPP_DIR/setenv.sh $JPP_DIR
13
14if do_usage $*; then
15 usage "$script (detector file|detector identifier)"\
16 "\nAuxiliary script to locally install file with mechanical parameters for dynamical calibrations."
17fi
18
19if (( $# != 1 )); then
20 fatal "Wrong number of arguments."
21fi
22
23set_variable DETECTOR $1
24
25if [[ -f $DETECTOR ]]; then
26 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER` # detector identifier from file
27else
28 set_variable DETECTOR_ID `getDetector -D $DETECTOR -O int` # detector identifier as number
29fi
30
31let "RUN = 1" # arbitrary run number
32set_variable TYPE mechanics # type
33set_variable VERSION \* # any version
34
35if [[ ! -f ${TYPE}_${(l:8::0::0:)DETECTOR_ID}.txt ]]; then
36 getFile.sh $JPP_ARCHIVE $DETECTOR_ID $RUN $TYPE $VERSION ${TYPE}_${(l:8::0::0:)DETECTOR_ID}
37fi