当前位置: 首页>>代码示例>>Python>>正文


Python LumiList.getVLuminosityBlockRange方法代码示例

本文整理汇总了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()  
开发者ID:YoungKwonJo,项目名称:Analysis2,代码行数:21,代码来源:customise_cff.py

示例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)
开发者ID:muell149,项目名称:lobster,代码行数:40,代码来源:splitter.py

示例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")
    )
开发者ID:HEP-KBFI,项目名称:stpol,代码行数:69,代码来源:selection_step2_cfg.py

示例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
)
开发者ID:BetterWang,项目名称:cmssw,代码行数:32,代码来源:testRPCTwinMux_cfg.py


注:本文中的FWCore.PythonUtilities.LumiList.LumiList.getVLuminosityBlockRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。