Jpp  17.3.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
software/JAcoustics/JToAshort.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 ACOUSTICS_DEBUG 2
12 set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13 set_variable: QUALITY_FACTOR ACOUSTICS_QUALITYFACTOR 2.0e3
14 
15 if do_usage $*; then
16  usage "$script <detector identifier> (run[-run])+"\
17  "\nAuxiliary script to download acoustic data from database."
18 fi
19 
20 if (( $# > 1 )); then
22  set_array RUNS $argv[2,-1]
23 else
24  fatal "Wrong number of arguments."
25 fi
26 
27 JCookie.sh
28 
29 let "NUMBER_OF_ERRORS = 0"
30 
31 for RANGE in $RUNS[*]; do
32 
33  for (( RUN = ${RANGE%%-*}; $RUN <= ${RANGE##*-}; RUN += 1 )); do
34 
35  set_variable OUTPUT_FILE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_toashort.root
36 
37  if [[ ! -f $OUTPUT_FILE ]]; then
38 
39  JConvertDB \
40  -q toashort \
41  -@ "detid = `getDetector -D $DETECTOR_ID`" \
42  -@ "minrun = $RUN" \
43  -@ "maxrun = $RUN" \
44  -@ "QUALITYFACTOR >= $QUALITY_FACTOR" \
45  -o $OUTPUT_FILE \
46  -d $DEBUG --!
47 
48  if (( $? != 0 )); then
49  let "NUMBER_OF_ERRORS = $NUMBER_OF_ERRORS + 1"
50  fi
51  fi
52  done
53 done
54 
55 if (( $NUMBER_OF_ERRORS != 0 )); then
56  fatal "Number of errors $NUMBER_OF_ERRORS"
57 fi
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
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
exit
Definition: JPizza.sh:36
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then echo
do JPrintDAQHeader f $INPUT_FILE d read DETECTOR_ID RUN FRAME_INDEX TIMESLICE_START set_variable OUTPUT_FILE $WORKDIR KM3NeT_
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
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
* usage
&set_variable OUTPUT_FILE
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 JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then display $WORKDIR
Definition: plot-Domino.sh:128
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
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