/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
PhysicsTools/Heppy/python/physicsobjects/TriggerObject.py
28 строк
964 B
Colin
imported analysis code from CMGTools. JSONAnalyzer working
30 окт 2014, 17:33
30 окт 2014, 17:33
be7fae5
Код
Авторство
О чём код?
from PhysicsTools.Heppy.physicsobjects.PhysicsObject import * import fnmatch class TriggerObject( PhysicsObject): '''With a nice printout, and functions to investigate the path and filters in the trigger object.''' def hasPath( self, path ): '''Returns true if this trigger object was used in path (path can contain a wildcard). ''' selNames = fnmatch.filter( self.getSelectionNames(), path ) if len(selNames)>0: return True else: return False def __str__(self): base = super(TriggerObject, self).__str__() specific = [] theStrs = [base] for name in self.getSelectionNames(): hasSel = self.getSelection( name ) if hasSel: specific.append( ''.join(['\t', name]) ) if len(specific)>0: specific.insert(0,'Paths:') theStrs.extend( specific ) return '\n'.join(theStrs)