本文整理汇总了Python中WMCore.DataStructs.Run.Run.extendLumis方法的典型用法代码示例。如果您正苦于以下问题:Python Run.extendLumis方法的具体用法?Python Run.extendLumis怎么用?Python Run.extendLumis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.DataStructs.Run.Run
的用法示例。
在下文中一共展示了Run.extendLumis方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadFilesByBlock
# 需要导入模块: from WMCore.DataStructs.Run import Run [as 别名]
# 或者: from WMCore.DataStructs.Run.Run import extendLumis [as 别名]
def loadFilesByBlock(self, blockname):
"""
_loadFilesByBlock_
Get all files associated with a block
"""
dbsFiles = []
findFiles = self.daoFactory(classname="LoadFilesByBlock")
results = findFiles.execute(blockname=blockname, transaction=False)
for entry in results:
# Add loaded information
dbsfile = DBSBufferFile(id=entry['id'])
dbsfile.update(entry)
dbsFiles.append(dbsfile)
for dbsfile in dbsFiles:
if 'runInfo' in dbsfile.keys():
# Then we have to replace it with a real run
for r in dbsfile['runInfo'].keys():
run = Run(runNumber=r)
run.extendLumis(dbsfile['runInfo'][r])
dbsfile.addRun(run)
del dbsfile['runInfo']
if 'parentLFNs' in dbsfile.keys():
# Then we have some parents
for lfn in dbsfile['parentLFNs']:
newFile = DBSBufferFile(lfn=lfn)
dbsfile['parents'].add(newFile)
del dbsfile['parentLFNs']
return dbsFiles
示例2: findUploadableFilesByDAS
# 需要导入模块: from WMCore.DataStructs.Run import Run [as 别名]
# 或者: from WMCore.DataStructs.Run.Run import extendLumis [as 别名]
def findUploadableFilesByDAS(self, datasetpath):
"""
_findUploadableDAS_
Find all the uploadable files for a given DatasetPath.
"""
dbsFiles = []
findFiles = self.daoFactory(classname="LoadDBSFilesByDAS")
results = findFiles.execute(datasetpath=datasetpath, transaction=False)
for entry in results:
# Add loaded information
dbsfile = DBSBufferFile(id=entry['id'])
dbsfile.update(entry)
dbsFiles.append(dbsfile)
for dbsfile in dbsFiles:
if 'runInfo' in dbsfile.keys():
# Then we have to replace it with a real run
for r in dbsfile['runInfo'].keys():
run = Run(runNumber=r)
run.extendLumis(dbsfile['runInfo'][r])
dbsfile.addRun(run)
del dbsfile['runInfo']
if 'parentLFNs' in dbsfile.keys():
# Then we have some parents
for lfn in dbsfile['parentLFNs']:
newFile = DBSBufferFile(lfn=lfn)
dbsfile['parents'].add(newFile)
del dbsfile['parentLFNs']
return dbsFiles
示例3: runHandler
# 需要导入模块: from WMCore.DataStructs.Run import Run [as 别名]
# 或者: from WMCore.DataStructs.Run.Run import extendLumis [as 别名]
def runHandler():
"""
_runHandler_
Sink to add run information to a file. Given the following XML:
<Runs>
<Run ID="122023">
<LumiSection NEvents="100" ID="215"/>
<LumiSection NEvents="100" ID="216"/>
</Run>
<Run ID="122024">
<LumiSection ID="1"/>
<LumiSection ID="2"/>
</Run>
</Runs>
Create a WMCore.DataStructs.Run object for each run and call the
addRunInfoToFile() function to add the run information to the file
section.
"""
while True:
fileSection, node = (yield)
for subnode in node.children:
if subnode.name == "Run":
runId = subnode.attrs.get("ID", None)
if runId is None:
continue
lumis = []
for lumi in subnode.children:
if "ID" in lumi.attrs:
lumiNumber = int(lumi.attrs['ID'])
nEvents = lumi.attrs.get("NEvents", None)
if nEvents is not None:
try:
nEvents = int(nEvents)
except ValueError:
nEvents = None
lumis.append((lumiNumber, nEvents))
runInfo = Run(runNumber=runId)
runInfo.extendLumis(lumis)
Report.addRunInfoToFile(fileSection, runInfo)
示例4: getChunkFiles
# 需要导入模块: from WMCore.DataStructs.Run import Run [as 别名]
# 或者: from WMCore.DataStructs.Run.Run import extendLumis [as 别名]
def getChunkFiles(self, collectionName, filesetName, chunkOffset, chunkSize=100):
"""
_getChunkFiles_
Retrieve a chunk of files from the given collection and task.
"""
chunkFiles = []
files = self._getFilesetInfo(collectionName, filesetName, chunkOffset, chunkSize)
files = mergeFakeFiles(files)
for fileInfo in files:
newFile = File(lfn=fileInfo["lfn"], size=fileInfo["size"],
events=fileInfo["events"], parents=set(fileInfo["parents"]),
locations=set(fileInfo["locations"]), merged=fileInfo["merged"])
for run in fileInfo["runs"]:
newRun = Run(run["run_number"])
newRun.extendLumis(run["lumis"])
newFile.addRun(newRun)
chunkFiles.append(newFile)
return chunkFiles
示例5: Run
# 需要导入模块: from WMCore.DataStructs.Run import Run [as 别名]
# 或者: from WMCore.DataStructs.Run.Run import extendLumis [as 别名]
#!/usr/bin/env python
import random
from WMCore.FwkJobReport import Report
from WMCore.DataStructs.Run import Run
from WMCore.Services.UUIDLib import makeUUID
outputModules = ["outputModule1", "outputModule2", "outputModule3",
"outputModule4", "outputModule5", "outputModule6",
"outputModule7", "outputModule8", "outputModule9",
"outputModule10"]
runInfo = Run(1)
runInfo.extendLumis([11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40])
totalReports = 25
inputFilesPerReport = 50
inputFileCounter = 0
for i in range(totalReports):
loadTestReport = Report.Report("cmsRun1")
loadTestReport.addInputSource("PoolSource")
for j in range(inputFilesPerReport):
inputFile = loadTestReport.addInputFile("PoolSource", lfn = "input%i" % inputFileCounter,
events = 600000, size = 600000)
inputFileCounter += 1
示例6: Run
# 需要导入模块: from WMCore.DataStructs.Run import Run [as 别名]
# 或者: from WMCore.DataStructs.Run.Run import extendLumis [as 别名]
#!/usr/bin/env python
import random
from WMCore.FwkJobReport import Report
from WMCore.DataStructs.Run import Run
from WMCore.Services.UUIDLib import makeUUID
outputModules = ["write_A_Calo_RAW", "write_A_Cosmics_RAW",
"write_A_HcalHPDNoise_RAW", "write_A_MinimumBias_RAW",
"write_A_RandomTriggers_RAW", "write_A_Calibration_TestEnables_RAW",
"write_HLTDEBUG_Monitor_RAW"]
runInfo = Run(1)
runInfo.extendLumis([11, 12, 13, 14, 15])
for i in range(100):
loadTestReport = Report.Report("cmsRun1")
loadTestReport.addInputSource("PoolSource")
inputFile = loadTestReport.addInputFile("PoolSource", lfn = makeUUID(),
events = 600000, size = 600000)
Report.addRunInfoToFile(inputFile, runInfo)
for outputModule in outputModules:
loadTestReport.addOutputModule(outputModule)
datasetInfo = {"applicationName": "cmsRun", "applicationVersion": "CMSSW_3_3_5_patch3",
"primaryDataset": outputModule, "dataTier": "RAW",
"processedDataset": "LoadTest10"}
fileAttrs = {"lfn": makeUUID(), "location": "cmssrm.fnal.gov",
"checksums": {"adler32": "ff810ec3", "cksum": "2212831827"},
"events": random.randrange(500, 5000, 50),