Beispiel #1
0
    def __init__(self, tree_names, trees):
        self._trees = trees
        for name, tree in zip(tree_names, trees):
            setattr(self, "_" + name, tree)
        self._l1Sums = {}

        if 'event' in tree_names:
            self._run = self._event.Event.run
            self._lumi = self._event.Event.lumi
        else:
            self._run, self._lumi = 0, 0

        if "caloTowers" in tree_names:
            self._caloTowers = CachedIndexedTree(self._caloTowers.L1CaloTower,
                                                 'nTower')

        if "emuCaloTowers" in tree_names:
            self._emuCaloTowers = CachedIndexedTree(
                self._emuCaloTowers.L1CaloTower, 'nTower')

        if "muonReco" in tree_names:
            self.muons = CachedIndexedTree(self._muonReco.Muon, 'nMuons')

        if "upgrade" in tree_names:
            self._upgrade = self._upgrade.L1Upgrade
            self._l1Jets = [
                L1Jet(self._upgrade, i) for i in range(self._upgrade.nJets)
                if self._upgrade.jetBx[i] == 0
            ]
            self._readUpgradeSums()

        if "emuUpgrade" in tree_names:
            self._emuUpgrade = self._emuUpgrade.L1Upgrade
            self._l1EmuJets = [
                L1Jet(self._emuUpgrade, i)
                for i in range(self._emuUpgrade.nJets)
                if self._emuUpgrade.jetBx[i] == 0
            ]
            self._readEmuUpgradeSums()

        if "jetReco" in tree_names:
            self._pfJets = []
            for i in range(self._jetReco.Jet.nJets):
                self._pfJets.append(PFJet(self._jetReco.Jet, i))
            self._caloJets = []
            for i in range(self._jetReco.Jet.nCaloJets):
                self._caloJets.append(CaloJet(self._jetReco.Jet, i))

        if "genTree" in tree_names:
            self._genJets = []
            for i in range(self._genTree.Generator.nJet):
                self._genJets.append(GenJet(self._genTree.Generator, i))
            self._makeGenSums(self._genTree.Generator)
Beispiel #2
0
    def __init__(self, trees):
        self._trees = trees
        # add names, aliases?
        # lets assume fixed for now:
        self._caloTowers, self._emuCaloTower, self._jetReco,\
            self._metFilterReco, self._muonReco, self._recoTree,\
            self._upgrade, self._emuUpgrade = self._trees

        self._caloTowers = CachedIndexedTree(self._caloTowers.L1CaloTower,
                                             'nTower')
        self._emuCaloTower = CachedIndexedTree(self._emuCaloTower.L1CaloTower,
                                               'nTower')
        self._upgrade = self._upgrade.L1Upgrade
        self._emuUpgrade = self._emuUpgrade.L1Upgrade

        self._jets = []
        for i in range(self._jetReco.Jet.nJets):
            self._jets.append(Jet(self._jetReco.Jet, i))

        self._l1Sums = {}
        self._readUpgradeSums()
        self._readEmuUpgradeSums()
    def __init__(self, tree_names, trees):
        self._trees = trees
        for name, tree in zip(tree_names, trees):
            setattr(self, "_" + name, tree)
        self._l1Sums = {}

        if "caloTowers" in tree_names:
            self._caloTowers = CachedIndexedTree(self._caloTowers.L1CaloTower,
                                                 'nTower')

        if "emuCaloTowers" in tree_names:
            self._emuCaloTowers = CachedIndexedTree(
                self._emuCaloTowers.L1CaloTower, 'nTower')

        if "muonReco" in tree_names:
            self.muons = CachedIndexedTree(self._muonReco.Muon, 'nMuons')

        if "upgrade" in tree_names:
            self._upgrade = self._upgrade.L1Upgrade
            self._l1Jets = [
                L1Jet(self._upgrade, i) for i in range(self._upgrade.nJets)
            ]
            self._readUpgradeSums()

        if "emuUpgrade" in tree_names:
            self._emuUpgrade = self._emuUpgrade.L1Upgrade
            self._l1EmuJets = [
                L1Jet(self._emuUpgrade, i)
                for i in range(self._emuUpgrade.nJets)
            ]
            self._readEmuUpgradeSums()

        if "jetReco" in tree_names:
            self._jets = []
            for i in range(self._jetReco.Jet.nJets):
                self._jets.append(Jet(self._jetReco.Jet, i))
Beispiel #4
0
 def __init__(self):
     self._tree = CachedIndexedTree(DummyTree(3), 'size')