Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
software/JCompass/JAHRSMonitor.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author mdejong
5 #
6 version=1.0
7 script=${0##*/}
8 
9 if [ -z $JPP_DIR ]; then
10  echo "Variable JPP_DIR undefined."
11  exit
12 fi
13 
14 source $JPP_DIR/setenv.sh $JPP_DIR
15 
16 set_variable DEBUG ${COMPASS_DEBUG:-2}
17 set_variable WORKDIR ${COMPASS_WORKDIR:-./}
18 
19 if ( do_usage $* ); then
20  usage "$script <detector file> <run>"
21 fi
22 
23 if (( $# != 2 )); then
24  fatal "Wrong number of parameters."
25 fi
26 
29 
30 set_variable AHRS_CALIBRATION_FILE $WORKDIR/ahrs_calibration.txt
31 
32 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
33 
34 typeset -a INPUT_FILES
35 
36 set_variable INPUT_FILE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_ahrs.root
37 
38 if [[ ! -f $INPUT_FILE ]]; then
39 
40  echo -n "Writing $INPUT_FILE... "
41 
42  JConvertDB \
43  -q "ahrs" \
44  -@ "detid = $DETECTOR_ID" \
45  -@ "minrun = $RUN" \
46  -@ "maxrun = $RUN" \
47  -o $INPUT_FILE \
48  -d $DEBUG --
49 
50  if (( $? == 0 )); then
51  echo "OK"
52  else
53  fatal "No AHRS data"
54  fi
55 fi
56 
57 if [[ ! -f $AHRS_CALIBRATION_FILE ]]; then
58 
59  JAHRSCalibration \
60  -D $DETECTOR_ID \
61  -o $AHRS_CALIBRATION_FILE \
62  -d $DEBUG
63 fi
64 
65 JAHRSMonitor \
66  -a $DETECTOR \
67  -c $AHRS_CALIBRATION_FILE \
68  -f $INPUT_FILE \
69  -q "0.1 0.2 0.3" \
70  -Q 1 \
71  -d $DEBUG --!
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
set_variable INPUT_FILE
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:79
then echo
then rm i $OUTPUT_FILE fi let RUN
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then fatal Not enough arguments fi set_variable DETECTOR $argv[1] INPUT_FILES
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
*set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2,-2] set_variable OUTPUT_FILE $argv[-1]
Definition: JDomino.sh:39
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
then JCalibrateToT a
Definition: JTuneHV.sh:108
alias put_queue eval echo n
Definition: qlib.csh:19
then display $WORKDIR
Definition: plot-Domino.sh:127
set_variable DETECTOR
do set_variable INPUT_FILE $WORKDIR KM3NeT_
version
Definition: JCalibratePMT.sh:7
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
do if[[!-f $ACOUSTICS_WORKDIR/${KEY}.txt]]
Definition: JAcoustics.sh:38
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62