9 # ------------------------------------------------------------------------------------------ 
   11 #                         Utility script to test sea time recalibration. 
   13 # ------------------------------------------------------------------------------------------ 
   14 # the detector file used as a starting point is supposed to correspond to the latest sea  
   17 if [ -z $JPP_DIR ]; 
then 
   18     echo "Variable JPP_DIR undefined." 
   22 source $JPP_DIR/setenv.sh $JPP_DIR
 
   26 if ( do_usage $* ); 
then 
   27     usage "$script <working directory> <detector file> <data hv odd fix> <data hv even fix>" 
   35         *) fatal 
"wrong number of arguments!";;
 
   39 # generic name for all files: detector files, root data files, root results files... 
   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" 
   49                 -
f ${WORKDIR}/${DATAHVODDFIX} \
 
   50                 -
a ${WORKDIR}/${DETX} \
 
   51                 -
o calibrateK40_searecalibration_oddFix.root \
 
   62                 -
a ${WORKDIR}/${DETX} \
 
   63                 -
o calibrateK40_searecalibration_evenFix.root \
 
   73                 -
f calibrateK40_searecalibration_oddFix.root \
 
   74                 -
o mergecalibrateK40_searecalibration_oddFix.root
 
   80                 -
f calibrateK40_searecalibration_evenFix.root \
 
   81                 -
o mergecalibrateK40_searecalibration_evenFix.root
 
   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 
   89                 -
a ${WORKDIR}/${DETX} \
 
   90                 -
o ${WORKDIR}/${
BASENAME}_pmtOdd_map.txt \
 
   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 
   97         cp ${WORKDIR}/${DETX} ${WORKDIR}/${
BASENAME}_intra_pmtOdd.detx 
 
   98         cp ${WORKDIR}/${DETX} ${WORKDIR}/${
BASENAME}_intra_pmtEven.detx        
 
  101 # when the HV and time offset off odd PMTs are kept fix,  
  102 # the time offset of even PMTs are estimated 
  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`" \
 
  114 # when the HV and time offset off even PMTs are kept fix,  
  115 # the time offset of odd PMTs are estimated 
  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`" \
 
  128 # create a new detector for saving the merging of the 2 previous detector files 
  130         cp ${WORKDIR}/${DETX} ${WORKDIR}/${
BASENAME}_searecalibration.detx
 
  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). 
  139                 -
a ${WORKDIR}/${
BASENAME}_intra_pmtOdd.detx \
 
  140                 -b ${WORKDIR}/${
BASENAME}_intra_pmtEven.detx \
 
  141                 -
o ${WORKDIR}/${
BASENAME}_searecalibration.detx \
 
set_variable DATAHVODDFIX
 
void set_variable(const std::string &name, const std::string &value)
Set environment variable. 
 
JFitK40_t< TF2 > JFitK40
Type definition for backward compatibility. 
 
then usage $script< data file >< detectorfile > fi case set_variable DETX
 
do set_array DAQHEADER JPrintDAQHeader f
 
static const double C
Physics constants. 
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
then usage $script< working directory >< detectorfile >< datahvoddfix >< datahvevenfix > fi case set_variable DATAHVEVENFIX
 
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
 
then $JPP_DIR software JCalibrate JCalibrateToT a
 
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 typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
 
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
 
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
 
#define DEBUG(A)
Message macros.