/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
PhysicsTools/HeppyCore/test/simple_example_cfg.py
61 строка
2 KB
Colin
logging level driven by cfg file
18 мар 2015, 14:21
18 мар 2015, 14:21
9a6bdd0
Код
Авторство
О чём код?
import os import PhysicsTools.HeppyCore.framework.config as cfg from PhysicsTools.HeppyCore.framework.chain import Chain as Events import logging logging.basicConfig(level=logging.INFO) # input component # several input components can be declared, # and added to the list of selected components inputSample = cfg.Component( 'test_component', # create the test file by running # python create_tree.py files = [os.path.abspath('test_tree.root')], ) selectedComponents = [inputSample] from PhysicsTools.HeppyCore.analyzers.Printer import Printer printer = cfg.Analyzer( Printer ) from PhysicsTools.HeppyCore.analyzers.SimpleTreeProducer import SimpleTreeProducer tree = cfg.Analyzer( SimpleTreeProducer, tree_name = 'tree', tree_title = 'A test tree' ) from PhysicsTools.HeppyCore.analyzers.Histogrammer import Histogrammer histos = cfg.Analyzer( Histogrammer, file_label = 'myhists' ) # definition of a sequence of analyzers, # the analyzers will process each event in this order sequence = cfg.Sequence( [ printer, tree, histos ] ) from PhysicsTools.HeppyCore.framework.services.tfile import TFileService output_rootfile = cfg.Service( TFileService, 'myhists', fname='histograms.root', option='recreate' ) services = [output_rootfile] # finalization of the configuration object. config = cfg.Config( components = selectedComponents, sequence = sequence, services = services, events_class = Events ) # print config