Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:13:10

0001 #!/bin/tcsh
0002 
0003 setenv HOME /phenix/u/$LOGNAME
0004 source /etc/csh.login
0005 foreach i(/etc/profile.d/*.csh)
0006     source $i
0007 end
0008 
0009 #set run list variable
0010 set fileList=$1
0011 
0012 # echo Submitting Pass 1 Condor Jobs
0013 
0014 set v=`cat $1`
0015 set nLines=`wc -l $fileList`
0016 set i=1
0017 set sigma=4.5
0018 
0019 while ( $i <= $#v )
0020     if ( -f  submission/submitFor_Batch$i.sub ) then
0021         rm submission/submitFor_Batch$i.sub
0022     endif
0023     set runnumber=`echo $v[$i] | awk '{print substr($0,113,5)}'`
0024     if( ! -d '/tmp/ahodges/logs/hotTower/log_'$runnumber) then 
0025         mkdir '/tmp/ahodges/logs/hotTower/log_'$runnumber
0026     endif 
0027     if( ! -d 'out/'$runnumber) then 
0028         mkdir 'out/'$runnumber
0029     endif
0030     if( ! -d 'err/'$runnumber) then 
0031         mkdir 'err/'$runnumber
0032     endif
0033 
0034     touch submission/submitFor_Batch$i.sub
0035     echo 'executable = condorsubmitHotMapMakerPass0.csh' >> submission/submitFor_Batch$i.sub
0036     echo 'arguments = $(filename) ' $sigma >> submission/submitFor_Batch$i.sub
0037     echo 'log  = /tmp/ahodges/logs/hotTower/log_'$runnumber'/job-$(Process).log' >> submission/submitFor_Batch$i.sub
0038     echo 'output  = out/'$runnumber'/job-$(Process).out'  >> submission/submitFor_Batch$i.sub 
0039     echo 'error = err/'$runnumber'/job-$(Process).err' >> submission/submitFor_Batch$i.sub
0040     echo 'request_memory = 4GB' >> submission/submitFor_Batch$i.sub
0041     echo 'should_transfer_files  = NO' >> submission/submitFor_Batch$i.sub
0042     echo ""  >> submission/submitFor_Batch$i.sub
0043     echo 'queue filename from '${v[$i]} >> submission/submitFor_Batch$i.sub
0044     condor_submit submission/submitFor_Batch$i.sub
0045    @ i++
0046  end
0047 
0048 echo Jobs submitted, waiting...
0049 set nLines=10
0050 while ($nLines > 9)
0051    sleep 1m
0052    @ nLines=`condor_q | wc -l`
0053    set remaining=`expr $nLines - 9` 
0054    echo There are $remaining jobs remaining 
0055 end
0056 
0057 #hadd files together
0058 echo Submitting HADD jobs
0059 set i=1
0060 while ( $i <= $#v )
0061     set runnumber=`echo $v[$i] | awk '{print substr($0,113,5)}'`
0062     set nFiles=`wc -l $v[$i]`
0063     run_hadd_condor.csh $runnumber 100 $nFiles
0064     @ i++
0065 end
0066    
0067 echo Jobs submitted, waiting...
0068 set nLines=10
0069 while ($nLines > 9)
0070    sleep 1m
0071    @ nLines=`condor_q | wc -l`
0072    set remaining=`expr $nLines - 9` 
0073    echo There are $remaining jobs remaining 
0074 end
0075 
0076     
0077 #hadd big files togehter
0078 echo Combining big files
0079 set i=1
0080 while ( $i <= $#v )
0081     set runnumber=`echo $v[$i] | awk '{print substr($0,113,5)}'`
0082     #echo 'hadd -f -k output/'$runnumber'/DST_CALOR-000'${runnumber}'_badTowerMapTree.root DST_CALOR-000'${runnumber}'-RANGE*.root'
0083     hadd -f -k output/$runnumber/DST_CALOR-000${runnumber}_badTowerMapTree.root output/$runnumber/DST_CALOR-000${runnumber}-RANGE*.root
0084     @ i++
0085 end
0086 
0087 condor_submit hotMapMakerPass1.sub 
0088 
0089 echo Jobs submitted, waiting...
0090 set nLines=10
0091 while ($nLines > 9)
0092    sleep 1m
0093    @ nLines=`condor_q | wc -l`
0094    set remaining=`expr $nLines - 9` 
0095    echo There are $remaining jobs remaining 
0096 end
0097 
0098 echo Finished!
0099 
0100