Jpp  16.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
seaTimeRecalibration.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author acreusot
5 #
6 version=1.0
7 script=${0##*/}
8 
9 # ------------------------------------------------------------------------------------------
10 #
11 # Utility script to test sea time recalibration.
12 #
13 # ------------------------------------------------------------------------------------------
14 # the detector file used as a starting point is supposed to correspond to the latest sea
15 # time calibration.
16 
17 if [ -z $JPP_DIR ]; then
18  echo "Variable JPP_DIR undefined."
19  exit
20 fi
21 
22 source $JPP_DIR/setenv.sh $JPP_DIR
23 
25 
26 if do_usage $*; then
27  usage "$script <working directory> <detector file> <data hv odd fix> <data hv even fix>"
28 fi
29 
30 case $# in
35  *) fatal "wrong number of arguments!";;
36 esac
37 
38 
39 # generic name for all files: detector files, root data files, root results files...
41 
42 if [ ! -f "${WORKDIR}/${DETX}" ]; then
43  echo "WARNING: detector file from sea calibration not found, check that the path to the file is correct or that the file has effectively been created"
44 fi
45 
46 if (( 1 )); then
47  JCalibrateK40 \
48  -d $DEBUG \
50  -a ${WORKDIR}/${DETX} \
51  -o calibrateK40_searecalibration_oddFix.root \
52  -b rates \
53  -C JDAQTimesliceL1 \
54  -V0+1e5 \
55  -M2+31
56 fi
57 
58 if (( 1 )); then
59  JCalibrateK40 \
60  -d $DEBUG \
61  -f ${WORKDIR}/${DATAHVEVENFIX} \
62  -a ${WORKDIR}/${DETX} \
63  -o calibrateK40_searecalibration_evenFix.root \
64  -b rates \
65  -C JDAQTimesliceL1 \
66  -V0+1e5 \
67  -M2+31
68 fi
69 
70 if (( 1 )); then
71  JMergeCalibrateK40 \
72  -d $DEBUG \
73  -f calibrateK40_searecalibration_oddFix.root \
74  -o mergecalibrateK40_searecalibration_oddFix.root
75 fi
76 
77 if (( 1 )); then
78  JMergeCalibrateK40 \
79  -d $DEBUG \
80  -f calibrateK40_searecalibration_evenFix.root \
81  -o mergecalibrateK40_searecalibration_evenFix.root
82 fi
83 
84 # this creates the odd/even PMT maps. If the HV of odd PMTs is kept fix, then you need to
85 # keep fix the time offset of odd PMTs
86 if (( 1 )); then
87  ./createPMTMap \
88  -d $DEBUG \
89  -a ${WORKDIR}/${DETX} \
90  -o ${WORKDIR}/${BASENAME}_pmtOdd_map.txt \
91  -T "odd"
92 fi
93 
94 # create new detector files to perform sea recalibration on the 2 populations
95 # this 2 new files will be merged at the end of the script
96 if (( 1 )); then
97  cp ${WORKDIR}/${DETX} ${WORKDIR}/${BASENAME}_intra_pmtOdd.detx
98  cp ${WORKDIR}/${DETX} ${WORKDIR}/${BASENAME}_intra_pmtEven.detx
99 fi
100 
101 # when the HV and time offset off odd PMTs are kept fix,
102 # the time offset of even PMTs are estimated
103 if (( 1 )); then
104  JFitK40 \
105  -d $DEBUG \
106  -f mergecalibrateK40_searecalibration_oddFix.root \
107  -a ${WORKDIR}/${BASENAME}_intra_pmtEven.detx \
108  -o fitK40_searecalibration_oddFix.root \
109  -! "`cat ${WORKDIR}/${BASENAME}_pmtOdd_map.txt`" \
110  -A \
111  -w
112 fi
113 
114 # when the HV and time offset off even PMTs are kept fix,
115 # the time offset of odd PMTs are estimated
116 if (( 1 )); then
117  JFitK40 \
118  -d $DEBUG \
119  -f mergecalibrateK40_searecalibration_evenFix.root \
120  -a ${WORKDIR}/${BASENAME}_intra_pmtOdd.detx \
121  -o fitK40_searecalibration_evenFix.root \
122  -! "`cat ${WORKDIR}/${BASENAME}_pmtOdd_map.txt`" \
123  -A \
124  -w \
125  -r
126 fi
127 
128 # create a new detector for saving the merging of the 2 previous detector files
129 if (( 1 )); then
130  cp ${WORKDIR}/${DETX} ${WORKDIR}/${BASENAME}_searecalibration.detx
131 fi
132 
133 # merge the 2 detector files of odd/even PMT populations: the time offsets of odd pmts
134 # are taken from the first detector file (option -a), the ones of even PMTs from the second
135 # detector file (option -b) and both are saved in the third detector file (option -c).
136 if (( 1 )); then
137  ./mergeTimeOffsets \
138  -d $DEBUG \
139  -a ${WORKDIR}/${BASENAME}_intra_pmtOdd.detx \
140  -b ${WORKDIR}/${BASENAME}_intra_pmtEven.detx \
141  -o ${WORKDIR}/${BASENAME}_searecalibration.detx \
142  -T "odd"
143 fi
144 
set_variable DATAHVODDFIX
data_type w[N+1][M+1]
Definition: JPolint.hh:757
JFitK40_t< TF2 > JFitK40
Type definition for backward compatibility.
Definition: JFitK40.hh:807
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
exit
Definition: JPizza.sh:36
data_type r[M+1]
Definition: JPolint.hh:758
then echo
static const double C
Physics constants.
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:20
do set_variable OUTPUT_DIRECTORY $WORKDIR T
set_variable DETX
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
then JConvertDetectorFormat a $DETECTOR[1] o
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG if do_usage *then usage $script< working directory >< detectorfile >< datahvoddfix >< datahvevenfix > fi case set_variable DATAHVEVENFIX
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then JCalibrateToT a
Definition: JTuneHV.sh:116
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
then cp
esac set_variable BASENAME
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
version
Definition: JCalibratePMT.sh:7