Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration.sh
Go to the documentation of this file.
1#!/bin/zsh
2script=${0##*/}
3
4source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
5
6set_variable DEBUG 2
7set_variable WORKDIR `pwd`
8set_variable ACOUSTICS_THREADS 10
9
10if 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)."
14fi
15
16if (( $# == 1 )); then
17 VERSION=${1}
18else
19 fatal "Wrong number of arguments."
20fi
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# -----------------------------------------------------------------------------------------------
30fuction 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
86run D_ORCA006
87run D_ORCA006 D0ORCA010
88run D0ORCA010 D1ORCA011
89run D1ORCA011 D0ORCA015
90run D0ORCA015 D1ORCA015
91run D1ORCA015 D0ORCA018
92
93
94# ARCA
95
96run D0ARCA006
97run D0ARCA006 D0ARCA009
98run D0ARCA009 D0ARCA021
99run D0ARCA021 D0ARCA028
100