File indexing completed on 2025-08-03 08:20:22
0001
0002
0003 filename=`basename ${1}`
0004 destination=${2}
0005 rename=${3:-${filename}}
0006
0007 if [[ "$USER" == "chiu" ]]
0008 then
0009 echo $0 $filename $destination $rename
0010 exit
0011 fi
0012
0013 mv ${filename} ${rename}
0014 filename=${rename}
0015
0016 echo stageout ${filename} ${destination} start `date`
0017
0018 regex_dsttype_run="(DST_[A-Z_]+[a-z0-9]+)_([a-z0-9]+)_(202[345]p[0-9][0-9][0-9])-([0-9]+)-([0-9]+)"
0019 regex_dsttype_range="(DST_[A-Z_]+[a-z0-9]+)_([a-z0-9]+)_(202[345]p[0-9][0-9][0-9])-([0-9]+)-([0-9]+)-([0-9]+)"
0020
0021
0022 base=${filename/.root/}
0023 dstname=${base%%-*}
0024
0025
0026 if [[ $base =~ $regex_dsttype_run ]]; then
0027 dsttype=${BASH_REMATCH[1]}
0028 echo $dsttype ...
0029 build=${BASH_REMATCH[2]}
0030 echo $build
0031 dbtag=${BASH_REMATCH[3]}
0032 echo $dbtag
0033 runnumber=${BASH_REMATCH[4]}
0034 echo $runnumber
0035 segment=${BASH_REMATCH[5]}
0036 echo $segment
0037 fi
0038
0039 if [[ $base =~ $regex_dsttype_range ]]; then
0040 dsttype=${BASH_REMATCH[1]}
0041 echo $dsttype ...
0042 build=${BASH_REMATCH[2]}
0043 echo $build
0044 dbtag=${BASH_REMATCH[3]}
0045 echo $dbtag
0046 runnumber=${BASH_REMATCH[4]}
0047 echo $runnumber
0048 runnumber2=${BASH_REMATCH[5]}
0049 echo $runnumber
0050 segment=${BASH_REMATCH[6]}
0051 echo $segment
0052 fi
0053
0054 nevents_=$( root.exe -q -b GetEntries.C\(\"${filename}\"\) | awk '/Number of Entries/{ print $4; }' )
0055 nevents=${nevents_:--1}
0056
0057
0058 echo ./cups.py -r ${runnumber} -s ${segment} -d ${dstname} stageout ${filename} ${destination} --dsttype ${dsttype} --dataset ${build}_${dbtag} --nevents ${nevents} --inc --prodtype many
0059 ./cups.py -r ${runnumber} -s ${segment} -d ${dstname} stageout ${filename} ${destination} --dsttype ${dsttype} --dataset ${build}_${dbtag} --nevents ${nevents} --inc --prodtype many
0060
0061
0062 echo stageout ${filename} ${destination} finish `date`
0063
0064
0065
0066