Jpp
 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
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 if (( 1 )); then
62  JCalibrateK40 \
63  -d $DEBUG \
64  -f ${FILELISTINTRA2} \
65  -a ${WORKDIR}/${DETX} \
66  -o calibrateK40_sea.root \
67  -b rates \
68  -C JDAQTimesliceL1 \
69  -V0+1e5 \
70  -M2+31
71 fi
72 
73 if (( 1 )); then
74  JMergeCalibrateK40 \
75  -d $DEBUG \
76  -f calibrateK40_sea.root \
77  -o mergecalibrateK40_sea.root
78 fi
79 
80 if (( 1 )); then
81  cp ${WORKDIR}/${DETX} ${WORKDIR}/${BASENAME}_seaCalibration_pmt${pmtName}.detx
82 fi
83 
84 if (( 1 )); then
85  JFitK40 \
86  -d $DEBUG \
87  -f mergecalibrateK40_sea.root \
88  -a ${WORKDIR}/${BASENAME}_seaCalibration_pmt${pmtName}.detx \
89  -o fitK40_pmt${pmtName}_sea.root \
90  -! ${pmtList} \
91  -A \
92  -w
93 fi
94 
95 
data_type w[N+1][M+1]
Definition: JPolint.hh:741
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
JFitK40_t< TF2 > JFitK40
Type definition for backward compatibility.
Definition: JFitK40.hh:806
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
then usage $script< data file >< detectorfile > fi case set_variable DETX
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:74
then echo
static const double C
Physics constants.
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
then JCalibrateToT a
Definition: JTuneHV.sh:103
then cp
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 source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36
version
Definition: JCalibratePMT.sh:7
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62