Jpp  18.6.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDynamics.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 DYNAMICS_DEBUG 2
12 set_variable: WORKDIR DYNAMICS_WORKDIR ./
13 set_variable: PERIOD DYNAMICS_PERIOD 100 # range of runs per output file
14 set_variable: MARGIN DYNAMICS_MARGIN 5 # overlap of runs at edges between output files
15 set_variable RANGE 1-99999999
16 
17 if do_usage $*; then
18  usage "$script <archive> <detector identifier|detector file> <version> [run-run]"\
19  "\nAuxiliary script to process dynamical positions and orientations data."\
20  "\nThe static and dynamic data are stored in the archive with the given version."
21 fi
22 
23 case $# in
27  set_variable ARCHIVE $argv[1];;
28  *) fatal "Wrong number of arguments."
29 esac
30 
31 JCookie.sh
32 
33 CHECK_EXIT_CODE
34 
35 if [[ -f $DETECTOR ]]; then
36  eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
37 else
40 fi
41 
42 if [[ ! -f $DETECTOR ]]; then
43  fatal "Missing file $DETECTOR"\
44  "\nYou may want to execute archive-get-calibration.sh beforehand."
45 fi
46 
47 JAcoustics.sh $DETECTOR_ID
48 
49 CHECK_EXIT_CODE
50 
51 archive-put-calibration.sh $ARCHIVE $VERSION ./
52 
53 CHECK_EXIT_CODE
54 
55 RUNS=(`JRuns -D $DETECTOR_ID -F RUN -@ "RUN >= ${RANGE%%-*}" -@ "RUN <= ${RANGE##*-}" | sort -g`)
56 
57 for (( L = 1; $L <= ${#RUNS}; L += $PERIOD )); do
58 
59  let "R = $L + $PERIOD - 1"
60 
61  if (( $R > ${#RUNS} )); then
62  let "R = ${#RUNS}"
63  fi
64 
65  let "LS = $L - $MARGIN"
66  let "RS = $R + $MARGIN"
67 
68  if (( $LS < 1 )); then
69  let "LS = 1"
70  fi
71  if (( $RS > ${#RUNS} )); then
72  let "RS = ${#RUNS}"
73  fi
74 
75  echo "\n\nProcessing runs $RUNS[$L]-$RUNS[$R]\n"
76 
77 
78  set_variable TYPE positions
79  set_variable OUTPUT_FILE katoomba_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUNS[$L]}.root
80 
81  INPUT_FILES=()
82 
83  for (( i = $LS; $i <= $RS; i += 1 )); do
84 
85  set_variable INPUT_FILE KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUNS[$i]}_event.root
86 
87  if [[ ! -f $INPUT_FILE ]]; then
88  JAcousticsEventBuilder.sh $DETECTOR $RUNS[$i]
89  fi
90 
91  if [[ -f $INPUT_FILE ]]; then
93  fi
94  done
95 
96  if [[ ! -f $OUTPUT_FILE ]]; then
97 
98  if (( ${#INPUT_FILES} != 0 )); then
99 
100  set_variable ACOUSTICS_STRIP
101 
102  JKatoomba.sh $DETECTOR $INPUT_FILES[*] $OUTPUT_FILE
103 
104  putFile.sh $OUTPUT_FILE $ARCHIVE $DETECTOR_ID $RUNS[$L] $RUNS[$R] $TYPE $VERSION
105 
106  else
107  error "No input files for $OUTPUT_FILE"
108  fi
109  fi
110 
111 
112  set_variable TYPE orientations
113  set_variable OUTPUT_FILE ballarat_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUNS[$L]}.root
114 
115  if [[ ! -f $OUTPUT_FILE ]]; then
116 
117  JBallarat.sh $DETECTOR $RUNS[$LS,$RS] $OUTPUT_FILE
118 
119  putFile.sh $OUTPUT_FILE $ARCHIVE $DETECTOR_ID $RUNS[$L] $RUNS[$R] $TYPE $VERSION
120  fi
121 done
122 
&set_variable TYPE
Definition: getLs.sh:22
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
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
Definition: JDataQuality.sh:19
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 usage $script< input file > nFor possible input files
Definition: JMechanics.sh:24
then
Definition: datalogs.sh:34
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
Definition: JDBToolkit.hh:378
do JPlot2D f $WORKDIR canberra[${EMITTER}\] root
then fatal Missing detector file $DETECTOR fi eval JPrintDetector a $DETECTOR O IDENTIFIER RUNS
then fatal Invalid path $argv[1] fi setopt extendedglob typeset Z8 ID function archive()
Definition: getArchive.sh:42
then JCalibrateToT a
Definition: JTuneHV.sh:107
&set_variable VERSION
Definition: getLs.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 set_variable DEBUG set_variable WORKDIR if do_usage *then usage for INPUT_FILE in $INPUT_FILES[*]
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
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
&set_variable OUTPUT_FILE
set_variable INPUT_FILE
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
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 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 sput $STRING $FLOOR sget MODULE INPUT_FILES
then fatal Abort fi fi done for RUN in $RUNS[*]
bool overlap(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Test overlap between ranges.
Definition: JRange.hh:641
then eval ls $DIR $ID $TYPE _
Definition: getArchive.sh:108
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
then echo
Definition: JQAQC.sh:92
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
do alias $i