Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-26 10:51:02

0001 #!/usr/bin/env python3
0002 
0003 from __future__ import print_function
0004 import urllib
0005 import string
0006 import os
0007 import sys
0008 import subprocess
0009 
0010 DATASET="/MinimumBias/Run2012C-SiStripCalMinBias-v2/ALCARECO"
0011 FIRSTRUN=0 #200190
0012 
0013 runs = []
0014 results = sorted(subprocess.getstatusoutput('dbs search --query="find run,sum(block.numevents) where dataset='+DATASET+' and run>='+str(FIRSTRUN)+'"')[1].splitlines())
0015 for line in results:
0016    linesplit = line.split('   ')
0017    if(len(linesplit)<2):continue
0018    run     = int(line.split('   ')[0])
0019    NEvents = int(line.split('   ')[1])
0020    if(NEvents>100000): runs.append(run)
0021 
0022 
0023 
0024 subprocess.getstatusoutput('mkdir -p runs')
0025 for r in runs:
0026     initEnv=''
0027     initEnv+='cd ' + os.getcwd() + '/runs/'+str(r)+'/;'
0028     initEnv+='source /afs/cern.ch/cms/cmsset_default.sh' + ';'
0029     initEnv+='eval `scramv1 runtime -sh`;'
0030     subprocess.getstatusoutput('mkdir -p runs/'+str(r))
0031     print("submitting jobs for run " + str(r))
0032     config_file=open('runs/'+str(r)+'/cmsDriver.sh','w')
0033     config_file.write( initEnv + 'cmsDriver.py run'+str(r)+' --datatier ALCARECO --conditions auto:com10 -s ALCA:PromptCalibProdSiStripGains --eventcontent ALCARECO -n -1 --dasquery=\'file dataset=/MinimumBias/Run2012C-SiStripCalMinBias-v2/ALCARECO run='+str(r)+'\'  --fileout file:run'+str(r)+'_out.root')
0034     config_file.close()
0035     out = subprocess.getoutput('bsub -q 2nw -J gainPCLrun' + str(r) +' "sh ' +  os.getcwd() + '/runs/'+str(r)+'/cmsDriver.sh"')
0036 #    print('bsub -q 2nw -J gainPCLrun' + str(r) +' " ' + initEnv + 'cmsDriver.py run'+str(r)+' --datatier ALCARECO --conditions auto:com10 -s ALCA:PromptCalibProdSiStripGains --eventcontent ALCARECO -n -1 --dasquery=\'file dataset=/MinimumBias/Run2012C-SiStripCalMinBias-v2/ALCARECO run='+str(r)+'\'  --fileout file:run'+str(r)+'_out.root "')
0037 
0038 
0039