Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:24

0001 #!/bin/env python
0002 
0003 from __future__ import print_function
0004 import os
0005 
0006 # Path of the input tables
0007 INPUTPATH = '/afs/cern.ch/cms/OO/mag_field/versions_new/version_18l_160812_3_8t_v9_small_fin'
0008 #INPUTPATH = '/afs/cern.ch/cms/OO/mag_field/versions_new/version_18l_160812_3t_v9_large_fin'
0009 #INPUTPATH = '/afs/cern.ch/cms/OO/mag_field/versions_new/version_18l_160812_3_5t_v9_large_fin'
0010 #INPUTPATH = '/afs/cern.ch/cms/OO/mag_field/versions_new/version_18l_160812_3_8t_v9_large_fin'
0011 
0012 
0013 f = open('tableList.txt', 'w') #will write a list of tables here, for further validation scripts
0014 for part in range (1, 3) : 
0015     for sector in range (1, 13) :
0016         subdir = 's'+str(sector).zfill(2)
0017         os.system('mkdir -p '+subdir)
0018         for volume in range (1, 465) :
0019             volNo=str(volume+1000*part)
0020             type='rpz' # for Tubs, Cone, TruncTubs
0021             if (volume>=138 and volume <= 402) :
0022                 type = 'xyz' #for Box, Trapezoid         
0023             fullpath = INPUTPATH+'/'+subdir+'_'+str(part)+'/v-'+type+'-'+volNo+'.table'
0024             f.write(fullpath+'\n')
0025             status = os.system('${CMSSW_BASE}/test/${SCRAM_ARCH}/prepareFieldTable '+fullpath +' '+ subdir+'/grid.'+volNo+'.bin '+ str(sector))
0026             if status != 0 :
0027                 print('ERROR table not processed:', fullpath)
0028         
0029 f.close()