Example #1
0
 def __init__(self,
              files,
              events=-1,
              load_emu_trees=False,
              load_reco_trees=True):
     from cmsl1t.utils.root_glob import glob
     input_files = []
     for f in files:
         if '*' in f:
             input_files.extend(glob(f))
         else:
             input_files.append(f)
     # this is not efficient
     self._trees = []
     self._names = []
     load_ROOT_library('L1TAnalysisDataformats.so')
     allTrees = get_trees(load_emu_trees, load_reco_trees)
     for name, path in allTrees.iteritems():
         try:
             chain = TreeChain(path, input_files, cache=True, events=events)
         except RuntimeError:
             logger.warn("Cannot find tree: {0} in input file".format(path))
             continue
         self._names.append(name)
         self._trees.append(chain)
def _energySumTypes():
    load_ROOT_library('L1TAnalysisDataformats.so')
    sumTypes = ROOT.l1t.EtSum
    energySumLookup = {
        sumTypes.kTotalEt: {'name': 'Ett', 'type': EnergySum},
        sumTypes.kTotalEtHF: {'name': 'EttHF', 'type': EnergySum},
        sumTypes.kTotalHt: {'name': 'Htt', 'type': EnergySum},
        sumTypes.kTotalHtHF: {'name': 'HttHF', 'type': Met},
        sumTypes.kMissingEt: {'name': 'Met', 'type': Met},
        sumTypes.kMissingEtHF: {'name': 'MetHF', 'type': Met},
        sumTypes.kMissingHt: {'name': 'Mht', 'type': Met},
        sumTypes.kTotalEtx: {'name': 'Mex', 'type': Mex},
        sumTypes.kTotalEty: {'name': 'Mey', 'type': Mey},
    }
    return energySumLookup