10 from xml.dom
import minidom
29 from optparse
import OptionParser
36 sz = info[stat.ST_SIZE]
42 string=
"lumiCalc.py -c frontier://LumiCalc/CMS_LUMI_PROD -i "
43 string1=
" --nowarning overview >"
44 string2= string + file + string1 + namefile
45 data = os.system(string2)
48 print "0 lumi are not avaible"
54 url =
"http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet"
57 args[
'level'] =
'CRITICAL'
58 api = DBSAPI.dbsApi.DbsApi(args)
59 files = api.listFiles(path=dataset,tier_list =site,runNumber=run)
64 file1 = open(namefile ,
'w')
65 stringS =
"process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )\n"
66 stringS = stringS +
"readFiles = cms.untracked.vstring()\n"
67 stringS = stringS +
"secFiles = cms.untracked.vstring()\n"
68 stringS = stringS +
"\n"
73 for filename
in file_list:
76 stringS =
"readFiles.extend([\n"
81 stringS = stringS + str(filename)
82 stringS = stringS +
"',\n"
84 filecount = filecount + 1
95 stringS =
"process.source = cms.Source(\"PoolSource\",\n"
96 stringS = stringS +
" fileNames = readFiles,\n"
97 stringS = stringS +
" secondaryFileNames = secFiles\n"
98 stringS = stringS +
")\n"
104 parser = OptionParser()
105 parser.add_option(
"-w",
"--workspace",
106 dest=
"workspaceName",
108 help=
"define workspace: GLOBAL TRACKER ")
110 parser.add_option(
"-r",
"--regexp",
113 default=
'groupName : LIKE %Collisions10% , runNumber : = 136088',
114 help=
" \"{runNumber} >= 148127 and {runNumber} < 148128 \" ")
116 parser.add_option(
"-d",
"--datasetPath",
118 default=
"/MinimumBias/Run2010A-TkAlMinBias-Dec22ReReco_v1/ALCARECO",
119 help=
"For example : --datasetPath /MinimumBias/Run2010A-TkAlMinBias-Dec22ReReco_v1/ALCARECO")
121 parser.add_option(
"-s",
"--site",
124 help=
"For example : site T2_CH_CAF")
126 parser.add_option(
"-i",
"--info",
130 help=
"printout the column names on which it's possible to cut")
132 (options, args) = parser.parse_args()
133 if len(sys.argv) == 1:
134 print(
"\nUsage: %s --help"%sys.argv[0])
143 server = xmlrpclib.ServerProxy(
'http://cms-service-runregistry-api.web.cern.ch/cms-service-runregistry-api/xmlrpc')
146 data = server.RunDatasetTable.export(workspaceName,
'xml_all' ,regexp)
153 for node
in nodelist:
154 if node.nodeType == node.TEXT_NODE:
159 return obj.getElementsByTagName(name)
166 server = xmlrpclib.ServerProxy(
'http://cms-service-runregistry-api.web.cern.ch/cms-service-runregistry-api/xmlrpc')
176 txtLongData+= txtrun + sep +
"\n"
180 if not (test
in lista):
183 file2=open(
"lista_key.txt",
'w')
184 for pkey
in range(len(lista)):
185 pwkey = lista[pkey] +
"\n"
190 for i
in range(len(lista)):
194 nameDBS=str(i)+
".data"
198 nameLumi=str(i)+
".lumi"
199 file1 = open( name ,
'w')
205 if (key == lista[i]):
206 print "running......"
209 txtruns =
"{runNumber} >= " +
printObj(run,
'NUMBER') +
" and {runNumber} < " + str(int(
printObj(run,
'NUMBER'))+1)
210 txtriv = txtruns +
" and {cmpPix} in ('GOOD') and {cmpStrip} in ('GOOD') and {cmpTrack} in ('GOOD')"
211 riv = server.RunDatasetTable.export(
'GLOBAL',
'csv_run_numbers',txtriv)
213 lumirun = server.RunLumiSectionRangeTable.export(
'GLOBAL',
'json',txtruns)
218 stringDBS = uno[
'LogicalFileName']
219 listaDBS += [stringDBS]
224 if (lumirun == comp):
231 string=
"sed -i 's/}{/, /g'"
233 string2= string +
" " + name
236 os.system(
"sed -i 's/\//_/g' lista_key.txt")
238 for rootLSF
in listaDBS:
239 if not (rootLSF
in listaDBS2):
240 listaDBS2.append(rootLSF)
249 return getData(doc,options,dataset,site)
252 items = regexp.split(
',')
255 key,value = item.split(
':')
256 dd[key.replace(
' ',
'')] = value
263 data=
extractData(options.workspaceName,options.regexp,options.dataset,options.site,options)
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
perl if(1 lt scalar(@::datatypes))