Jpp  17.3.1
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 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  JRuns \
42  -D $DETECTOR_ID \
43  -@ "run = $i0" \
44  -F RUN \
45  -F T0_CALIBSETID \
46  -F POS_CALIBSETID \
47  -F ROT_CALIBSETID | read RUN_0 TCAL_0 PCAL_0 RCAL_0
48 
49  if (( $? != 0 )); then
50  continue
51  fi
52 
53  notice "Run $RUN_0 $TCAL_0 $PCAL_0 $RCAL_0"
54 
55  for (( i1 = $i0 + 1; $i1 <= $MAXRUN; i1 += 1 )); do
56 
57  JRuns \
58  -D $DETECTOR_ID \
59  -@ "run = $i1" \
60  -F RUN \
61  -F T0_CALIBSETID \
62  -F POS_CALIBSETID \
63  -F ROT_CALIBSETID | read RUN_1 TCAL_1 PCAL_1 RCAL_1
64 
65  if (( $? != 0 )); then
66  continue
67  fi
68 
69  notice "Run $RUN_1 $TCAL_1 $PCAL_1 $RCAL_1"
70 
71  if [[ "$TCAL_0" != "$TCAL_1" || "$PCAL_0" != "$PCAL_1" || "$RCAL_0" != "$RCAL_1" ]] then
72  break
73  fi
74  done
75 
76  JDetectorDB \
77  -D $DETECTOR_ID \
78  -@ "tcal = $TCAL_0" \
79  -@ "pcal = $PCAL_0" \
80  -@ "rcal = $RCAL_0" \
81  -V "" \
82  -o $DETECTOR --!
83 
84  putFile.sh $DETECTOR $ARCHIVE $DETECTOR_ID $i0 $(($i1 - 1)) $TYPE $VERSION
85 
86  if (( $? == 0 )); then
87  rm -f $DETECTOR
88  else
89  fatal "$DETECTOR not stored in archive $ARCHIVE."
90  fi
91 
92  let "i0 = $i1"
93  done
94 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
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
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 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