Jpp  18.4.0
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 fi
21 
22 case $# in
26  set_variable ARCHIVE $argv[1];;
27  *) fatal "Wrong number of arguments."
28 esac
29 
30 JCookie.sh
31 
32 CHECK_EXIT_CODE
33 
34 if [[ -f $DETECTOR ]]; then
35  eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
36 else
39 fi
40 
41 archive-get-calibration.sh $ARCHIVE $DETECTOR_ID $VERSION
42 
43 CHECK_EXIT_CODE
44 
45 RUNS=(`JRuns -D $DETECTOR_ID -F RUN -@ "RUN >= ${RANGE%%-*}" -@ "RUN <= ${RANGE##*-}" | sort -g`)
46 
47 for (( L = 1; $L <= ${#RUNS}; L += $PERIOD )); do
48 
49  let "R = $L + $PERIOD - 1"
50 
51  if (( $R > ${#RUNS} )); then
52  let "R = ${#RUNS}"
53  fi
54 
55  let "LS = $L - $MARGIN"
56  let "RS = $R + $MARGIN"
57 
58  if (( $LS < 1 )); then
59  let "LS = 1"
60  fi
61  if (( $RS > ${#RUNS} )); then
62  let "RS = ${#RUNS}"
63  fi
64 
65  echo "\n\nProcessing runs $RUNS[$L]-$RUNS[$R]\n"
66 
67 
68  set_variable TYPE positions
69 
70  INPUT_FILES=()
71 
72  for (( i = $LS; $i <= $RS; i += 1 )); do
73 
75  set_variable INPUT_FILE KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_event.root
76 
77  if [[ ! -f $INPUT_FILE ]]; then
78  JAcousticsEventBuilder.sh $DETECTOR $RUN
79  fi
80 
81  if [[ -f $INPUT_FILE ]]; then
82  INPUT_FILES+=($INPUT_FILE)
83  fi
84  done
85 
86  if (( ${#INPUT_FILES} != 0 )); then
87 
89  set_variable OUTPUT_FILE katoomba_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}.root
90  set_variable ACOUSTICS_STRIP
91 
92  if [[ ! -f $OUTPUT_FILE ]]; then
93 
94  JKatoomba.sh $DETECTOR $INPUT_FILES[*] $OUTPUT_FILE
95 
96  putFile.sh $OUTPUT_FILE $ARCHIVE $DETECTOR_ID $RUNS[$L] $RUNS[$R] $TYPE $VERSION
97  fi
98  fi
99 
100 
101  set_variable TYPE orientations
102  set_variable OUTPUT_FILE ballarat_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}.root
103 
104  if [[ ! -f $OUTPUT_FILE ]]; then
105 
106  JBallarat.sh $DETECTOR $RUNS[$LS,$RS] $OUTPUT_FILE
107 
108  putFile.sh $OUTPUT_FILE $ARCHIVE $DETECTOR_ID $RUNS[$L] $RUNS[$R] $TYPE $VERSION
109  fi
110 done
111 
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 fatal Wrong number of arguments fi set_variable ARCHIVE $argv[1] set_variable DETECTOR_ID $argv[2] set_variable VERSION $argv[3] RUN
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:23
then
Definition: datalogs.sh:31
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
Definition: JDBToolkit.hh:378
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable TRIPOD $argv[2] set_array INPUT_FILES $argv[3,-1] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O CAN JAcoustics sh $DETECTOR_ID
Definition: footprint.sh:38
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
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 expand_array RUNS for RUN in $RUNS[*]
then JCalibrateToT a
Definition: JTuneHV.sh:113
#define VERSION
Definition: elog-version.h:27
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
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:79
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
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: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
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:104
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
then echo
Definition: JQAQC.sh:90
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
do JPlot2D f $WORKDIR canberra[${EMITTER}] root
Definition: JCanberra.sh:136
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