本文整理汇总了Python中FWCore.PythonUtilities.LumiList.LumiList.getVLuminosityBlockRange方法的典型用法代码示例。如果您正苦于以下问题:Python LumiList.getVLuminosityBlockRange方法的具体用法?Python LumiList.getVLuminosityBlockRange怎么用?Python LumiList.getVLuminosityBlockRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FWCore.PythonUtilities.LumiList.LumiList
的用法示例。
在下文中一共展示了LumiList.getVLuminosityBlockRange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: customise
# 需要导入模块: from FWCore.PythonUtilities.LumiList import LumiList [as 别名]
# 或者: from FWCore.PythonUtilities.LumiList.LumiList import getVLuminosityBlockRange [as 别名]
def customise(process):
lumiFile = 'Cert_246908-260627_13TeV_PromptReco_Collisions15_25ns_JSON.txt'
runOnMC = True
for i in process.source.fileNames:
if 'Run2015' in i:
runOnMC=False
isTTbar=False
for i in process.source.fileNames:
if '/TT' in i or '/tt' in i:
isTTbar=True
if not runOnMC:
from FWCore.PythonUtilities.LumiList import LumiList
lumiList = LumiList(os.environ["CMSSW_BASE"]+'/src/CATTools/CatProducer/prod/LumiMask/'+lumiFile)
#lumiList = LumiList(os.environ["CMSSW_BASE"]+'/src/CATTools/CommonTools/test/ttbb/'+lumiFile)
process.source.lumisToProcess = lumiList.getVLuminosityBlockRange()
示例2: split_by_lumi
# 需要导入模块: from FWCore.PythonUtilities.LumiList import LumiList [as 别名]
# 或者: from FWCore.PythonUtilities.LumiList.LumiList import getVLuminosityBlockRange [as 别名]
def split_by_lumi(config, dataset_info, task_list):
if config.has_key('lumi mask'):
lumi_mask = LumiList(filename=config['lumi mask'])
dataset_info.total_lumis = 0
for file in dataset_info.files:
dataset_info.lumis[file] = lumi_mask.filterLumis(dataset_info.lumis[file])
dataset_info.total_lumis += len(dataset_info.lumis[file])
lumis_per_task = config['lumis per task']
lumis_processed = 0
task_id = 0
tasks = []
files = iter(dataset_info.files)
file = files.next()
input_files_this_task = [file]
task_lumis_remaining = dataset_info.lumis[file]
while lumis_processed < dataset_info.total_lumis:
for file in input_files_this_task:
common_lumis = set(dataset_info.lumis[file]).intersection(set(task_lumis_remaining))
if len(common_lumis) == 0 or len(dataset_info.lumis[file]) == 0:
input_files_this_task.remove(file)
while lumis_per_task <= len(task_lumis_remaining):
task_lumis = LumiList(lumis=task_lumis_remaining[:lumis_per_task])
task_lumis_remaining = task_lumis_remaining[lumis_per_task:]
tasks.append((input_files_this_task, task_lumis.getVLuminosityBlockRange()))
task_id += 1
lumis_processed += lumis_per_task
try:
file = files.next()
input_files_this_task.append(file)
task_lumis_remaining.extend(dataset_info.lumis[file])
except:
lumis_per_task = len(task_lumis_remaining)
with open(task_list, 'w') as json_file:
json.dump(tasks, json_file)
return len(tasks)
示例3: SingleTopStep2
# 需要导入模块: from FWCore.PythonUtilities.LumiList import LumiList [as 别名]
# 或者: from FWCore.PythonUtilities.LumiList.LumiList import getVLuminosityBlockRange [as 别名]
#.........这里部分代码省略.........
if Config.doDebug:
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger = cms.Service(
"MessageLogger",
destinations=cms.untracked.vstring("cout", "debug"),
debugModules=cms.untracked.vstring("*"),
cout=cms.untracked.PSet(threshold=cms.untracked.string("INFO")),
debug=cms.untracked.PSet(threshold=cms.untracked.string("DEBUG")),
)
logging.basicConfig(level=logging.DEBUG)
else:
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
process.MessageLogger.cerr.threshold = cms.untracked.string("INFO")
logging.basicConfig(level=logging.DEBUG)
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents))
process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))
import os
from FWCore.PythonUtilities.LumiList import LumiList
if not Config.isMC:
ll1 = LumiList(
os.environ["CMSSW_BASE"] + "/../crabs/lumis/Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt"
)
process.source = cms.Source(
"PoolSource",
fileNames=cms.untracked.vstring(options.inputFiles),
cacheSize=cms.untracked.uint32(50 * 1024 * 1024),
lumisToProcess=ll1.getVLuminosityBlockRange() if not Config.isMC else cms.untracked.VLuminosityBlockRange(),
)
print options
# -------------------------------------------------
# Jets
# -------------------------------------------------
from SingleTopPolarization.Analysis.jets_step2_cfi import JetSetup
JetSetup(process, Config)
# -------------------------------------------------
# Leptons
# -------------------------------------------------
from SingleTopPolarization.Analysis.muons_step2_cfi import MuonSetup
MuonSetup(process, Config)
from SingleTopPolarization.Analysis.electrons_step2_cfi import ElectronSetup
ElectronSetup(process, Config)
process.looseVetoMuCount = cms.EDProducer(
"CollectionSizeProducer<reco::Candidate>", src=cms.InputTag("looseVetoMuons")
)
process.looseVetoEleCount = cms.EDProducer(
"CollectionSizeProducer<reco::Candidate>", src=cms.InputTag("looseVetoElectrons")
)
示例4:
# 需要导入模块: from FWCore.PythonUtilities.LumiList import LumiList [as 别名]
# 或者: from FWCore.PythonUtilities.LumiList.LumiList import getVLuminosityBlockRange [as 别名]
process.RPCTwinMuxRawToDigiPAC = process.RPCTwinMuxRawToDigi.clone()
process.RPCTwinMuxRawToDigiPAC.inputTag = cms.InputTag("RPCTwinMuxDigiToRawPAC")
process.RPCTwinMuxRawToDigiPacked = process.RPCTwinMuxRawToDigi.clone()
process.RPCTwinMuxRawToDigiPacked.inputTag = cms.InputTag("RPCTwinMuxDigiToRaw")
process.load("EventFilter.L1TXRawToDigi.twinMuxStage2Digis_cfi")
process.twinMuxStage2DigisPacked = process.twinMuxStage2Digis.clone()
process.twinMuxStage2DigisPacked.DTTM7_FED_Source = cms.InputTag("RPCTwinMuxDigiToRaw")
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
# Source
process.source = cms.Source("PoolSource"
, fileNames = cms.untracked.vstring(options.inputFiles)
, lumisToProcess = lumilist.getVLuminosityBlockRange()
)
#process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) )
process.maxLuminosityBlocks = cms.untracked.PSet(input = cms.untracked.int32(10))
process.p = cms.Path( ( process.rpcUnpackingModule * process.RPCTwinMuxDigiToRawPAC * process.RPCTwinMuxRawToDigiPAC )
+ ( process.RPCTwinMuxRawToDigi
* ( ( process.rpcpacker * process.rpcUnpackingModulePacked )
+ ( process.RPCTwinMuxDigiToRaw
* ( process.RPCTwinMuxRawToDigiPacked + process.twinMuxStage2DigisPacked ) )
)
)
+ process.twinMuxStage2Digis
)