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


Python Looper.process方法代码示例

本文整理汇总了Python中heppy.framework.looper.Looper.process方法的典型用法代码示例。如果您正苦于以下问题:Python Looper.process方法的具体用法?Python Looper.process怎么用?Python Looper.process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在heppy.framework.looper.Looper的用法示例。


在下文中一共展示了Looper.process方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runLoop

# 需要导入模块: from heppy.framework.looper import Looper [as 别名]
# 或者: from heppy.framework.looper.Looper import process [as 别名]
def runLoop( comp, outDir, config, options):
   
    if options.input is not None:
        comp.files = [options.input]

    fullName = '/'.join( [outDir, comp.name ] )
    # import pdb; pdb.set_trace()
    config.components = [comp]
    memcheck = 2 if getattr(options,'memCheck',False) else -1
    loop = Looper( fullName,
                   config,
                   options.nevents, 0,
                   nPrint = options.nprint,
                   timeReport = options.timeReport,
                   quiet = options.quiet,
                   memCheckFromEvent = memcheck,
                   stopFlag = _globalGracefulStopFlag)
    # print loop
    if options.iEvent is None:
        loop.loop()
        loop.write()
        # print loop
    else:
        # loop.InitOutput()
        iEvent = int(options.iEvent)
        loop.process( iEvent )
    return loop
开发者ID:clementhelsens,项目名称:heppy,代码行数:29,代码来源:heppy_loop.py

示例2: TestAnalysis_ee_ZH

# 需要导入模块: from heppy.framework.looper import Looper [as 别名]
# 或者: from heppy.framework.looper.Looper import process [as 别名]
class TestAnalysis_ee_ZH(unittest.TestCase):
    def setUp(self):
        random.seed(0xDEADBEEF)
        self.outdir = tempfile.mkdtemp()
        fname = "/".join([os.environ["HEPPY"], "test/data/ee_ZH_Zmumu_Hbb.root"])
        config.components[0].files = [fname]
        self.looper = Looper(self.outdir, config, nEvents=50, nPrint=0, timeReport=True)
        import logging

        logging.disable(logging.CRITICAL)

    def tearDown(self):
        shutil.rmtree(self.outdir)
        logging.disable(logging.NOTSET)

    def test_analysis(self):
        """Check for an almost perfect match with reference.
        Will fail if physics algorithms are modified,
        so should probably be removed from test suite,
        or better: be made optional. 
        """
        self.looper.loop()
        self.looper.write()
        rootfile = "/".join([self.outdir, "heppy.analyzers.examples.zh.ZHTreeProducer.ZHTreeProducer_1/tree.root"])
        mean, sigma = plot(rootfile)
        self.assertAlmostEqual(mean, 120.7, 1)
        self.assertAlmostEqual(sigma, 20.3, 1)

    def test_analysis_sorting(self):
        self.looper.process(0)
        self.assertTrue(test_sorted(self.looper.event.rec_particles))
开发者ID:jlingema,项目名称:heppy,代码行数:33,代码来源:test_analysis_ee_ZH.py

示例3: test_process_event

# 需要导入模块: from heppy.framework.looper import Looper [as 别名]
# 或者: from heppy.framework.looper.Looper import process [as 别名]
 def test_process_event(self):
     loop = Looper( self.outdir, config,
                    nEvents=None,
                    nPrint=0 )
     loop.process(10)
     self.assertEqual(loop.event.input.var1, 10)
     loop.process(10)
开发者ID:SDHCAL,项目名称:heppy,代码行数:9,代码来源:test_simple_example.py

示例4: test_analysis_sorting

# 需要导入模块: from heppy.framework.looper import Looper [as 别名]
# 或者: from heppy.framework.looper.Looper import process [as 别名]
 def test_analysis_sorting(self):
     fname = '/'.join([os.environ['HEPPY'],
                               'test/data/ee_ZH_Zmumu_Hbb.root'])
     config.components[0].files = [fname]
     looper = Looper( self.outdir, config,
                                   nEvents=50,
                                   nPrint=0 )
     looper.process(0)
     self.assertTrue(test_sorted(looper.event.rec_particles))
开发者ID:HEP-FCC,项目名称:heppy,代码行数:11,代码来源:test_analysis_ee_ZH.py

示例5: runLoop

# 需要导入模块: from heppy.framework.looper import Looper [as 别名]
# 或者: from heppy.framework.looper.Looper import process [as 别名]
def runLoop( comp, outDir, config, options):
    fullName = '/'.join( [outDir, comp.name ] )
    # import pdb; pdb.set_trace()
    loop = Looper( fullName, comp, config.sequence, config.events_class,
                   options.nevents, 0,
                   nPrint = options.nprint)
    print loop
    if options.iEvent is None:
        loop.loop()
        loop.write()
        print loop
    else:
        # loop.InitOutput()
        iEvent = int(options.iEvent)
        loop.process( iEvent )
    return loop
开发者ID:xccty,项目名称:heppy,代码行数:18,代码来源:heppy_loop.py

示例6: runLoop

# 需要导入模块: from heppy.framework.looper import Looper [as 别名]
# 或者: from heppy.framework.looper.Looper import process [as 别名]
def runLoop( comp, outDir, config, options):
    fullName = '/'.join( [outDir, comp.name ] )
    # import pdb; pdb.set_trace()
    config.components = [comp]
    loop = Looper( fullName,
                   config,
                   options.nevents, 0,
                   nPrint = options.nprint,
                   timeReport = True,
                   quiet=options.quiet)
    # print loop
    if options.iEvent is None:
        loop.loop()
        loop.write()
        # print loop
    else:
        # loop.InitOutput()
        iEvent = int(options.iEvent)
        loop.process( iEvent )
    return loop
开发者ID:broach1,项目名称:heppy,代码行数:22,代码来源:heppy_loop.py

示例7: next

# 需要导入模块: from heppy.framework.looper import Looper [as 别名]
# 或者: from heppy.framework.looper.Looper import process [as 别名]
    # sel_iso_leptons,
    # match_jet_leptons,
    # sel_jets_nolepton,
    # m3, 
    # gen_tree
    ] )

# comp.files.append('example_2.root')
# comp.splitFactor = 2  # splitting the component in 2 chunks

config = cfg.Config(
    components = selectedComponents,
    sequence = sequence,
    services = [],
    events_class = Events
)

if __name__ == '__main__':
    import sys
    from heppy.framework.looper import Looper

    def next():
        loop.process(loop.iEvent+1)

    loop = Looper( 'looper', config,
                   nEvents=100,
                   nPrint=0,
                   timeReport=True)
    loop.process(6)
    print loop.event
开发者ID:jlingema,项目名称:heppy,代码行数:32,代码来源:delphes_cfg.py


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