/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/FWLite/test/chainEvent_python.py
41 строка
993 B
Shahzad Malik Muzaffar
[CORE] py2/3 compatibility:drop use of __future__
22 ноя 2024, 20:16
22 ноя 2024, 20:16
4759e53
Код
Авторство
О чём код?
#! /usr/bin/env python3 from builtins import range from DataFormats.FWLite import Events, Handle print("starting python test") files = ['empty_a.root', 'good_a.root', 'empty_a.root', 'good_b.root'] events = Events (files) thingHandle = Handle ('std::vector<edmtest::Thing>') indicies = events.fileIndicies() for event in events: newIndicies = event.fileIndicies() if indicies != newIndicies: print("new file") indicies = newIndicies event.getByLabel ('Thing', thingHandle) thing = thingHandle.product() for loop in range (thing.size()): print(thing.at (loop).a) events.toBegin() for event in events: pass events.toBegin() for event in events: event.getByLabel ('Thing', thingHandle) thing = thingHandle.product() for loop in range (thing.size()): print(thing.at (loop).a) for i in range(events.size()): if not events.to(i): print("failed to go to index ",i) exit(1) print("Python test succeeded!")