Jpp  17.3.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
seaTimeCalibration.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 calibration.
12 #
13 # ------------------------------------------------------------------------------------------
14 # all data related to intradom time calibration have to be set in the same directory
15 #
16 # When performing a time calibration between DOMs, some PMT time offsets must be kept fixed.
17 # for standard sea time calibration, the time offsets kept fixed are those of the
18 # reference PMTs. The identity of the reference PMT can be given in argument as an integer
19 # (since all DOMs are supposed to have the same reference PMT, 7 or 15 most of the time).
20 #
21 # In case of a time calibration after a threshold tuning, or in case of different
22 # reference PMT identity for each DOM, a file can be given as an argument. The file
23 # contains a list of DOM and PMT identities that must have a fix time offset.
24 
25 if [ -z $JPP_DIR ]; then
26  echo "Variable JPP_DIR undefined."
27  exit
28 fi
29 
30 source $JPP_DIR/setenv.sh $JPP_DIR
31 
33 
34 if do_usage $*; then
35  usage "$script <working directory> <detector file> <intra data directory> <reference PMTs>"
36 fi
37 
38 case $# in
39  4) set_variable PMT $4;
43  *) fatal "wrong number of arguments!";;
44 esac
45 
46 if [[ ${PMT} =~ ^[+-]?[0-9]+$ ]]; then
47  set_variable pmtList "-1 ${PMT}"
48  set_variable pmtName ${PMT}
49 else
50  set_variable pmtList "`cat ${WORKDIR}/${PMT}`"
51  set_variable pmtName "Mixed"
52 fi
53 
54 FILELISTINTRA1=()
55 for FILEPATH in $(ls ${WORKDIR}/${INTRADIR}/); do
56  FILELISTINTRA1+=("${WORKDIR}/${INTRADIR}/${FILEPATH}")
57 done
58 set_variable FILELISTINTRA2 ${FILELISTINTRA1}
59 set_variable BASENAME ${DETX%.detx}
60 
61 JCalibrateK40 \
62  -d $DEBUG \
63  -f ${FILELISTINTRA2} \
64  -a ${WORKDIR}/${DETX} \
65  -o calibrateK40_sea.root \
66  -b rates \
67  -C JDAQTimesliceL1 \
68  -V0+1e5 \
69  -M2+31
70 
71 JMergeCalibrateK40 \
72  -d $DEBUG \
73  -f calibrateK40_sea.root \
74  -o mergecalibrateK40_sea.root
75 
76 JConvertDetectorFormat -a ${WORKDIR}/${DETX} -o ${WORKDIR}/${BASENAME}_seaCalibration_pmt${pmtName}.detx
77 
78 JFitK40 \
79  -d $DEBUG \
80  -f mergecalibrateK40_sea.root \
81  -a ${WORKDIR}/${BASENAME}_seaCalibration_pmt${pmtName}.detx \
82  -o fitK40_pmt${pmtName}_sea.root \
83  -! ${pmtList} \
84  -A \
85  -w
data_type w[N+1][M+1]
Definition: JPolint.hh:778
version
Definition: JEditTuneHV.sh:5
JFitK40_t< TF2 > JFitK40
Type definition for backward compatibility.
Definition: JFitK40.hh:807
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition: JDataQuality.sh:76
exit
Definition: JPizza.sh:36
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
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:21
then JCalibrateToT a
Definition: JTuneHV.sh:116
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 JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
esac set_variable BASENAME
set_variable INTRADIR
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:46
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62