Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
software/JAcoustics/JToA.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 
30 let "NUMBER_OF_ERRORS = 0"
31 
32 expand_array RUNS
33 
34 set_variable DETECTOR_ID `getDetector -D $DETID -O int`
35 
36 BUFFER=(`JRuns -D $DETECTOR_ID -F RUN`)
37 
38 for RUN in ${RUNS:*BUFFER}; do
39 
40  set_variable OUTPUT_FILE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_toa.root
41 
42  if [[ ! -f $OUTPUT_FILE ]]; then
43 
44  JToA \
45  -@ "detid = `getDetector -D $DETID -O string`" \
46  -@ "minrun = $RUN" \
47  -@ "maxrun = $RUN" \
48  -@ "QUALITYFACTOR >= $QUALITY_FACTOR" \
49  -o $OUTPUT_FILE \
50  -d $DEBUG --!
51 
52  if (( $? != 0 )); then
53  let "NUMBER_OF_ERRORS = $NUMBER_OF_ERRORS + 1"
54  fi
55  fi
56 done
57 
58 if (( $NUMBER_OF_ERRORS != 0 )); then
59  error "Number of errors $NUMBER_OF_ERRORS"
60 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
esac done BUFFER
Definition: JMakePDF.sh:83
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
exit
Definition: JPizza.sh:36
then
Definition: datalogs.sh:34
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
Definition: JDBToolkit.hh:378
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then fatal Missing detector file $DETECTOR fi eval JPrintDetector a $DETECTOR O IDENTIFIER RUNS
then set_variable DETID
Definition: JEditTuneHV.sh:63
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
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
&set_variable OUTPUT_FILE
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonStart.sh:47
then usage $script[energy[distance[z of PMT]]] fi case set_variable z
Definition: JDrawPDF.sh:45
do set_variable INPUT_FILE $WORKDIR KM3NeT_
then fatal The output file must have the wildcard in the e g root fi 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:48
then fatal Wrong number of arguments fi set_variable ARCHIVE $argv[1] set_variable VERSION $argv[2] set_variable DIR $argv[3] source JAcousticsToolkit sh set_variable DETECTOR $DIR $ACOUSTICS_DETECTOR if[[!-f $DETECTOR]]
then JHobbit a $DETECTOR f
then eval ls $DIR $ID $TYPE _
Definition: getArchive.sh:108
then echo
Definition: JQAQC.sh:92
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
then getFile sh $JPP_ARCHIVE $DETECTOR_ID $RUNS[1] $KEY $VERSION $WORKDIR
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62