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