Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:25

0001 #!/bin/bash
0002 
0003 # pattern test data harvesting script
0004 #
0005 # 
0006 #
0007 #
0008 # usage :
0009 #     getPattData.sh pattId run
0010 #
0011 
0012 # set variables
0013 ecalDir='/nfshome0/ecaldev/trigg_patt_test'
0014 hcalDir='/nfshome0/toole/hcal_pattern_test_files'
0015 rctDir='/nfshome0/rctpro'
0016 scDir='/home/hwtest/patt_test'
0017 gctDir='/nfshome0/gctdev/patt_test'
0018 
0019 # get dataset info
0020 pattId=$1
0021 run=$2
0022 
0023 pattDir=`awk "/$pattId/ { print "'$2'" }" pattIndex.dat`
0024 pattName=`awk "/$pattId/ { print "'$3'" }" pattIndex.dat`
0025 
0026 # create local directory
0027 targDir=$pattName-$run
0028 if [[ ! -d $targDir ]]; then mkdir $targDir; fi;
0029 
0030 # copy data files
0031 echo "Copying data for run $run of pattern $pattId from $pattDir/$pattName"
0032 ecalFile=$ecalDir/$pattDir/$pattName-$pattId-ecal-0-*.txt
0033 hcalFile=$hcalDir/$pattDir/$pattName-$pattId-hcal-0-.xml
0034 rctFile=$rctDir/$pattDir/$pattName-$pattId-rct-$run-*.txt
0035 scFile=$scDir/$pattDir/$pattName-$pattId-sc-$run-0.txt
0036 gctFile=$gctDir/$pattDir/$pattName-$pattId-gct-$run-0.txt
0037 
0038 scp "cmsusr0:\"$ecalFile\"" $targDir/.
0039 scp "cmsusr0:\"$hcalFile\"" $targDir/.
0040 scp "cmsusr0:\"$rctFile\"" $targDir/.
0041 scp "cmsusr0:\"$gctFile\"" $targDir/.
0042 scp "cms-bris-pc01:\"$scFile\"" $targDir/.
0043 
0044 #copy config files
0045 conf=`awk "/$pattId/ { print "'$4'" }" pattIndex.dat`
0046 confFile=src/L1Trigger/HardwareValidation/hwtest/$conf.cfg
0047 if [ -e $CMSSW_BASE/$confFile ]; then 
0048     cp $CMSSW_BASE/$confFile .
0049     echo "Copying $CMSSW_BASE/$confFile to local directory"
0050 else 
0051     if [ -e $CMSSW_RELEASE_BASE/$confFile ]; then 
0052         cp $CMSSW_RELEASE_BASE/$confFile .
0053         echo "Copying $CMSSW_RELEASE_BASE/$confFile to local directory"
0054     else echo "Could not find $confFile in local area or release. Did you do eval scram ru -sh?"
0055     fi
0056 fi
0057 
0058 # replace filename placeholders
0059 mv $conf.cfg $conf.tmp
0060 sed -e "s/PATTERN/$pattName/" -e "s/ID/$pattId/" -e "s/RUN/$run/" < $conf.tmp > $conf.cfg
0061 rm $conf.tmp
0062 
0063