Jpp  17.3.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
archive-put-offline-detectors.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: DEBUG ARCHIVE_DEBUG 2
12 set_variable: WORKDIR ARCHIVE_WORKDIR ${TMPDIR:-/tmp}/
13 set_variable TYPE offline
14 
15 if do_usage $*; then
16  usage "$script <archive> <version> <detector identifier> (run[-run])+"\
17  "\nAuxiliary script to download online detector files from database and to store these in archive."
18 fi
19 
20 if (( $# > 3 )); then
21  set_variable ARCHIVE $argv[1]
24  set_array RUNS $argv[4,-1]
25 else
26  fatal "Wrong number of arguments."
27 fi
28 
29 JCookie.sh
30 
31 set_variable DETECTOR_ID $(getDetector -D $DETECTOR_ID -O int)
33 
34 for RANGE in $RUNS[*]; do
35 
36  let "MINRUN = ${RANGE%%-*}"
37  let "MAXRUN = ${RANGE##*-}"
38 
39  for (( i0 = $MINRUN; $i0 <= $MAXRUN; )); do
40 
41  JRunCalibration \
42  -D $DETECTOR_ID \
43  -r $i0 \
44  -R 1 \
45  -F RUN \
46  -F PMT_T0_CALIBRATION \
47  -F DOM_POSITION_CALIBRATION \
48  -F DOM_ROTATION_CALIBRATION \
49  -F ACOUSTIC_T0_CALIBRATION \
50  -F COMPASS_CALIBRATION \
51  -F STATUS_CALIBRATION | read RUN_0 TCAL_0 PCAL_0 RCAL_0 ACAL_0 CCAL_0 SCAL_0
52 
53  if (( $? != 0 )); then
54  continue
55  fi
56 
57  notice "Run $RUN_0 $TCAL_0 $PCAL_0 $RCAL_0 $ACAL_0 $CCAL_0 $SCAL_0"
58 
59  for (( i1 = $i0 + 1; $i1 <= $MAXRUN; i1 += 1 )); do
60 
61  JRunCalibration \
62  -D $DETECTOR_ID \
63  -r $i1 \
64  -R 1 \
65  -F RUN \
66  -F PMT_T0_CALIBRATION \
67  -F DOM_POSITION_CALIBRATION \
68  -F DOM_ROTATION_CALIBRATION \
69  -F ACOUSTIC_T0_CALIBRATION \
70  -F COMPASS_CALIBRATION \
71  -F STATUS_CALIBRATION | read RUN_1 TCAL_1 PCAL_1 RCAL_1 ACAL_1 CCAL_1 SCAL_1
72 
73  if (( $? != 0 )); then
74  break
75  fi
76 
77  notice "Run $RUN_1 $TCAL_1 $PCAL_1 $RCAL_1 $ACAL_1 $CCAL_1 $SCAL_1"
78 
79  if [[ "$TCAL_0" != "$TCAL_1" || "$PCAL_0" != "$PCAL_1" || "$RCAL_0" != "$RCAL_1" || "$ACAL_0" != "$ACAL_1" || "$CCAL_0" != "$CCAL_1" || "$SCAL_0" != "$SCAL_1" ]] then
80  break
81  fi
82  done
83 
84  JDetectorDB \
85  -D $DETECTOR_ID \
86  -@ "tcal = $TCAL_0" \
87  -@ "pcal = $PCAL_0" \
88  -@ "rcal = $RCAL_0" \
89  -@ "acal = $ACAL_0" \
90  -@ "ccal = $CCAL_0" \
91  -@ "scal = $SCAL_0" \
92  -o $DETECTOR --!
93 
94  putFile.sh $DETECTOR $ARCHIVE $DETECTOR_ID $i0 $(($i1 - 1)) $TYPE $VERSION
95 
96  if (( $? == 0 )); then
97  rm -f $DETECTOR
98  else
99  fatal "$DETECTOR not stored in archive $ARCHIVE."
100  fi
101 
102  let "i0 = $i1"
103  done
104 done
then usage $script< detector identifier >< startdate\"YYYY-MM-DDHH:MM:SS\"><finaldate\"YYYY-MM-DDHH:MM:SS\"><QA/QCfile> fi case set_variable QAQC_TXT $argv[4]
Definition: JDataMonitor.sh:24
set_array RUNS
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O SUMMARY JPrintDAQHeader f $INPUT_FILE read A DAQ_HEADER set_variable DETECTOR_ID
Definition: JSquid.sh:28
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition: JDataQuality.sh:76
usr share Modules init zsh export TMPDIR
exit
Definition: JPizza.sh:36
data_type r[M+1]
Definition: JPolint.hh:779
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
Definition: JDBToolkit.hh:378
then echo
then fatal Detector file should be binary format fi eval JPrintDetector a $DETECTOR O IDENTIFIER typeset a INPUT_FILES for RANGE in $RUNS[*]
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
then rm i $OUTPUT_FILE fi let RUN
#define VERSION
Definition: elog-version.h:27
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
Definition: JLegolas.sh:20
then awk F
* usage
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable TRIPOD $argv[2] set_variable TX $argv[3] set_variable TY $argv[4] if[[!-f $DETECTOR]]
Definition: JFootprint.sh:28
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
then display $WORKDIR
Definition: plot-Domino.sh:128
do echo n Creating graphics for string $STRING for((FLOOR=$FIRST_FLOOR;$FLOOR<=$LAST_FLOOR;FLOOR+=1))
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
script
Definition: JAcoustics.sh:2
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
then fatal Invalid detector identifier $DETECTOR_ID fi set_variable RUNSETUPID typeset a RANGE RANGE[1]
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62