Jpp  18.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
archive-put-online-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 online
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  JRuns \
42  -D $DETECTOR_ID \
43  -@ "run = $i0" \
44  -F T0_CALIBSETID \
45  -F POS_CALIBSETID \
46  -F ROT_CALIBSETID \
47  -F RUN | read TCAL_0 PCAL_0 RCAL_0 RUN_0
48 
49  if (( $? != 0 )) || [[ "$RUN_0" == "" ]] || (( $RUN_0 != $i0 )); then
50 
51  let "i0 = $i0 + 1"
52 
53  continue
54  fi
55 
56  notice "Run $RUN_0 $TCAL_0 $PCAL_0 $RCAL_0"
57 
58  for (( i1 = $i0 + 1; $i1 <= $MAXRUN; i1 += 1 )); do
59 
60  JRuns \
61  -D $DETECTOR_ID \
62  -@ "run = $i1" \
63  -F T0_CALIBSETID \
64  -F POS_CALIBSETID \
65  -F ROT_CALIBSETID \
66  -F RUN | read TCAL_1 PCAL_1 RCAL_1 RUN_1
67 
68  if (( $? != 0 )) || [[ "$RUN_1" == "" ]] || (( $RUN_1 != $i1 )); then
69  continue
70  fi
71 
72  notice "Run $RUN_1 $TCAL_1 $PCAL_1 $RCAL_1"
73 
74  if [[ "$TCAL_0" != "$TCAL_1" || "$PCAL_0" != "$PCAL_1" || "$RCAL_0" != "$RCAL_1" ]] then
75  break
76  fi
77  done
78 
79  JDetectorDB \
80  -D $DETECTOR_ID \
81  -@ "tcal = $TCAL_0" \
82  -@ "pcal = $PCAL_0" \
83  -@ "rcal = $RCAL_0" \
84  -V "" \
85  -o $DETECTOR --!
86 
87  if (( $? == 0 )); then
88  putFile.sh $DETECTOR $ARCHIVE $DETECTOR_ID $i0 $(($i1 - 1)) $TYPE $VERSION
89  else
90  error "Failure in downloading detector from database."
91  fi
92 
93  if (( $? == 0 )); then
94  rm -f $DETECTOR
95  else
96  fatal "$DETECTOR not stored in archive $ARCHIVE."
97  fi
98 
99  let "i0 = $i1"
100  done
101 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
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
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
&set_variable RUNS
Definition: datalogs.sh:21
then
Definition: datalogs.sh:31
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
Definition: JDBToolkit.hh:378
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then fatal Invalid path $argv[1] fi setopt extendedglob typeset Z8 ID function archive()
Definition: getArchive.sh:42
then rm
Definition: sftpput.zsh:30
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
fi set_variable FILENAME $WORKDIR
Definition: datalogs.sh:34
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
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 echo
Definition: JQAQC.sh:90
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
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
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