/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
PhysicsTools/Heppy/python/analyzers/core/Analyzer.py
36 строк
1 KB
Shahzad Malik Muzaffar
[ANALYSIS] py2/3 compatibility:drop use of __future__
22 ноя 2024, 20:16
22 ноя 2024, 20:16
8d027cc
Код
Авторство
О чём код?
import os import logging from PhysicsTools.HeppyCore.framework.analyzer import Analyzer as CoreAnalyzer class Analyzer(CoreAnalyzer): '''Base Analyzer class. Used in Looper.''' def declareHandles(self): self.handles = {} self.mchandles = {} def beginLoop(self, setup): '''Automatically called by Looper, for all analyzers.''' super(Analyzer, self).beginLoop(setup) self.declareHandles() def process(self, event ): '''Automatically called by Looper, for all analyzers. each analyzer in the sequence will be passed the same event instance. each analyzer can access, modify, and store event information, of any type.''' print(self.cfg_ana.name) self.readCollections( event.input ) def readCollections(self, iEvent ): '''You must call this function at the beginning of the process function of your child analyzer.''' # if not self.beginLoopCalled: # # necessary in case the user calls process to go straight to a given event, before looping # self.beginLoop(setup) for str,handle in self.handles.items(): handle.Load( iEvent ) if self.cfg_comp.isMC: for str,handle in self.mchandles.items(): handle.Load( iEvent )