3# --------------------------------------------------------------------------------------------
 
    5# Steering script for the compass calibration procedure of the D0ORCA018 (148) detector.
 
    7# --------------------------------------------------------------------------------------------
 
    9if [ -z $JPP_DIR ]; then
 
   10    echo "Variable JPP_DIR undefined."
 
   14source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
 
   16set_variable     WORKDIR                 ${TMPDIR:-/tmp}/
 
   17set_array        RUNS                    16542-16558
 
   20    usage "$script <detector file>"
 
   24    fatal "Wrong number of arguments."
 
   27set_variable     DETECTOR                $1
 
   29if [[ ! -f $DETECTOR ]]; then
 
   30    fatal "Missing pre-calibrated D0ORCA018 input detector file"
 
   33# Some compasses have to be disabled because their unconsistent behavior perturbs the pre-calibration
 
   34# Compasses ORCA.0001.16, ORCA.0011.17, ORCA.0018.11, ORCA.0027.07, ORCA.0027.16, ORCA.0027.18,
 
   35#           ORCA.0028.02, ORCA.0028.03, ORCA.0028.04, ORCA.0028.05, ORCA.0028.07, ORCA.0028.08
 
   38    -W "808488997 set COMPASS_DISABLE"    \
 
   39    -W "813681150 set COMPASS_DISABLE"    \
 
   40    -W "817333825 set COMPASS_DISABLE"    \
 
   41    -W "813574205 set COMPASS_DISABLE"    \
 
   42    -W "816929992 set COMPASS_DISABLE"    \
 
   43    -W "808981255 set COMPASS_DISABLE"    \
 
   44    -W "817313901 set COMPASS_DISABLE"    \
 
   45    -W "817326040 set COMPASS_DISABLE"    \
 
   46    -W "817301285 set COMPASS_DISABLE"    \
 
   47    -W "817303737 set COMPASS_DISABLE"    \
 
   48    -W "817340727 set COMPASS_DISABLE"    \
 
   49    -W "817320273 set COMPASS_DISABLE"    \
 
   52rm -f $WORKDIR/compass-*.root
 
   54JCompass.sh  detector.datx                      $RUNS[*]  $WORKDIR/compass-\[before\].root
 
   56JConvertDetectorFormat -a detector.datx -o ${TMPDIR:-/tmp}/detector.datx
 
   58JCompass.sh  ${TMPDIR:-/tmp}/detector.datx  $RUNS[*]  $WORKDIR/compass-\[after\].root
 
   60set_variable     GRAPHICS_BATCH
 
   62$JPP_DIR/examples/JCompass/plot-compass.sh  detector.datx  $WORKDIR/compass-\[before\].root  $WORKDIR/compass-\[after\].root