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
pre-calibration.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
5 
8 set_variable ACOUSTICS_THREADS 10
9 
10 if do_usage $*; then
11  usage "$script [version]"\
12  "\nAuxiliary script to run pre-calibrations of all detectors,"\
13  "\nincluding automatic disabling of 'bad' transmissions (see JAcousticsDisable.sh)."
14 fi
15 
16 if (( $# == 1 )); then
17  VERSION=${1}
18 else
19  fatal "Wrong number of arguments."
20 fi
21 
22 
23 # -----------------------------------------------------------------------------------------------
24 # Run pre-calibration of given detector with optional inputs.
25 # The last directory corresponds to the current detector and
26 # the preceding directories to the input detectors.
27 #
28 # \param 1-N directories
29 # -----------------------------------------------------------------------------------------------
30 fuction run()
31 {
32  DETECTORS=($argv[1,-2])
33  DETECTOR=$argv[-1]
34 
35  DIR=$WORKDIR/${DETECTOR}.${VERSION}.A # without disabled transmissions
36 
37  mkdir -p $DIR
38  pushd $DIR
39 
40  JMergeDisable -f$WORKDIR/${^DETECTORS}.${VERSION}.B/disable.txt -o disable.log
41  #JMergeDisable -o disable.log
42 
43  # replace disabled transmissions by those of input detectors
44 
45  sed '/cat>disable.txt<<EOF/,/EOF/ccat>disable.txt<<EOF\n# disable transmissions\nEOF' \
46  $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh > pre-calibration_${DETECTOR}.sh
47  sed -i '/disable transmissions/r disable.log' pre-calibration_${DETECTOR}.sh
48 
49  chmod +x pre-calibration_${DETECTOR}.sh
50 
51  ./pre-calibration_${DETECTOR}.sh $WORKDIR/${^DETECTORS}.${VERSION}.B >& pre-calibration.log
52 
53 
54  # disable transmissions
55 
56  eval `JPrintDetector -a detector.datx -O IDENTIFIER`
57 
58  JAcousticsDisable.sh detector.datx KM3NeT_${(l:8::0::0:)DETECTOR_ID}_*_event.root disable.log
59 
60  popd
61 
62 
63  DIR=$WORKDIR/${DETECTOR}.${VERSION}.B # with disabled transmissions
64 
65  mkdir -p $DIR
66  pushd $DIR
67 
68  cp $WORKDIR/${DETECTOR}.${VERSION}.A/disable.log .
69 
70  # introduce disabled transmissions
71 
72  sed '/cat>disable.txt<<EOF/,/EOF/ccat>disable.txt<<EOF\n# disable transmissions\nEOF' \
73  $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh > pre-calibration_${DETECTOR}.sh
74  sed -i '/disable transmissions/r disable.log' pre-calibration_${DETECTOR}.sh
75 
76  chmod +x pre-calibration_${DETECTOR}.sh
77 
78  ./pre-calibration_${DETECTOR}.sh $WORKDIR/${^DETECTORS}.${VERSION}.B >& pre-calibration.log
79 
80  popd
81 }
82 
83 
84 # ORCA
85 
86 run D_ORCA006
87 run D_ORCA006 D0ORCA010
88 run D0ORCA010 D1ORCA011
89 run D1ORCA011 D0ORCA015
90 run D0ORCA015 D1ORCA015
91 run D1ORCA015 D0ORCA018
92 
93 
94 # ARCA
95 
96 run D0ARCA006
97 run D0ARCA006 D0ARCA009
98 run D0ARCA009 D0ARCA021
99 run D0ARCA021 D0ARCA028
100 
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 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
then
Definition: datalogs.sh:34
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DETECTOR_ID set_array RUNS if do_usage *then usage $script< source directory > nThe source directory corresponds to a pre calibrated D0ARCA009 detector fi case set_variable DIR
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then usage $script fi DETECTORS
Definition: JMultiPMT.sh:45
then JCalibrateToT a
Definition: JTuneHV.sh:107
&set_variable VERSION
Definition: getLs.sh:21
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
* usage
do set_variable INPUT_FILE $WORKDIR KM3NeT_
then cp
then eval ls $DIR $ID $TYPE _
Definition: getArchive.sh:108
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
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
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62