Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:23:59

0001 #!/usr/bin/bash
0002 
0003 #inputs=dst_triggered_event_run2auau-00054920.list, for example
0004 
0005 if [[ $# -lt 1 ]]
0006 then
0007   echo Error, need to specify input file
0008   exit -1
0009 fi
0010 
0011 #generate the run_xxx_yyy string
0012 get_rundirname() {
0013   runtemp=$1
0014   temp=$(( ${runtemp}/100 * 100 ))
0015   low=$(printf "%08d" $temp)
0016   temp=$(( ${temp}+100 ))
0017   high=$(printf "%08d" $temp)
0018   echo run_${low}_${high}
0019 }
0020 
0021 inputs=$1
0022 runno=${inputs##*/}
0023 runno=${runno#*-}
0024 runno=${runno%-*}
0025 runno=${runno%.list}
0026 runno=${runno%.root}
0027 runno=${runno%.prdf}
0028 runno=$((10#${runno}))  # convert to decimal number
0029 echo processing run $runno
0030 
0031 nevents=3000000
0032 if [[ $# -ge 2 ]]
0033 then
0034   nevents=$2
0035 fi
0036 echo Processing $nevents eventsxxx
0037 
0038 build=none          # use current environment
0039 #dbtag=newcdbtag
0040 dbtag=""
0041 
0042 if [[ $USER == "sphnxpro" ]]
0043 then
0044   pass0dir=/sphenix/user/chiu/sphenix_bbc/CDB/PASS0
0045   outbase=DST_MBD_CALIBRATION_run3auau
0046   outdir=/sphenix/lustre01/sphnxpro/physics/mbdcalib/new_2025/$(get_rundirname ${runno})/
0047   logbase=DST_MBD_CALIBRATION_run3auau
0048   logdir=/sphenix/data/data02/sphnxpro/mbdcalib/new_2025/$(get_rundirname ${runno})/
0049   build=new
0050   dbtag=newcdbtag
0051 
0052   if [[ $runno -le 53880 ]]
0053   then
0054     # 2024 Run2pp
0055     echo "This is run2pp"
0056     pass0dir=/sphenix/user/chiu/sphenix_bbc/CDB/2024_PASS0
0057     outbase=DST_MBD_CALIBRATION_run2pp
0058     outdir=/sphenix/lustre01/sphnxpro/physics/mbdcalib/new_2024/$(get_rundirname ${runno})/
0059     logbase=DST_MBD_CALIBRATION_run2pp
0060     logdir=/sphenix/data/data02/sphnxpro/mbdcalib/new_2024/$(get_rundirname ${runno})/
0061     build=new
0062     dbtag=newcdbtag
0063   elif [[ $runno -le 54962 ]]
0064   then
0065     # 2024 Run2auau
0066     echo "This is run2auau"
0067     pass0dir=/sphenix/user/chiu/sphenix_bbc/CDB/2024_PASS0  # need to check this
0068     outbase=DST_MBD_CALIBRATION_run2auau
0069     outdir=/sphenix/lustre01/sphnxpro/physics/mbdcalib/new_2024/$(get_rundirname ${runno})/
0070     logbase=DST_MBD_CALIBRATION_run2auau
0071     logdir=/sphenix/data/data02/sphnxpro/mbdcalib/new_2024/$(get_rundirname ${runno})/
0072     build=new
0073     dbtag=newcdbtag
0074   fi
0075 
0076 else
0077   pass0dir=/sphenix/user/chiu/sphenix_bbc/CDB/PASS0
0078   outbase=DST_MBD_CALIBRATION_run3auau
0079   outdir=/sphenix/user/chiu/sphenix_bbc/run2025/CALIBPRODUCTION/TEST
0080   logbase=DST_MBD_CALIBRATION_run3auau
0081   logdir=/sphenix/user/chiu/sphenix_bbc/run2025/CALIBPRODUCTION/TEST/log
0082 
0083   if [[ $runno -le 53880 ]]
0084   then
0085     # 2024 Run2pp (old config)
0086     outbase=DST_MBD_CALIBRATION_run2pp
0087     outdir=/sphenix/user/chiu/sphenix_bbc/run2024/CALIBPRODUCTION/TEST
0088     logbase=DST_MBD_CALIBRATION_run2pp
0089     logdir=/sphenix/user/chiu/sphenix_bbc/run2024/CALIBPRODUCTION/TEST/log
0090   elif [[ $runno -le 54962 ]]
0091   then
0092     # 2024 Run2auau
0093     outbase=DST_MBD_CALIBRATION_run2auau
0094     outdir=/sphenix/user/chiu/sphenix_bbc/run2024/CALIBPRODUCTION/TEST
0095     logbase=DST_MBD_CALIBRATION_run2auau
0096     logdir=/sphenix/user/chiu/sphenix_bbc/run2024/CALIBPRODUCTION/TEST/log
0097   fi
0098 fi
0099 
0100 ORIG_DIR=${PWD}
0101 #_CONDOR_SCRATCH_DIR=AAA
0102 #echo $_CONDOR_SCRATCH_DIR
0103 
0104 if [[ ! -z "${_CONDOR_SCRATCH_DIR}" ]]
0105 then
0106   mkdir -p ${_CONDOR_SCRATCH_DIR}
0107   cp ${inputs} *.sh *.h *.C ${_CONDOR_SCRATCH_DIR}/
0108   cd ${_CONDOR_SCRATCH_DIR}
0109   pwd
0110   ls -lR
0111   #for f in /sphenix/user/chiu/sphenix_bbc/offline/macros/calibrations/mbd/*
0112   #do
0113   #  ln -sf $f .
0114   #done
0115 fi
0116 
0117 ./run_mbdcal.sh --outbase "$outbase" \
0118   --outdir  "$outdir" \
0119   --logbase "$logbase" \
0120   --logdir  "$logdir" \
0121   --build    $build \
0122   --run      $runno \
0123   --dbtag    "$dbtag" \
0124   --nevents  $nevents \
0125   $inputs
0126 
0127 
0128 if [[ ! -z "${_CONDOR_SCRATCH_DIR}" ]]
0129 then
0130   ls -lR
0131 fi
0132