Exemple #1
0
 def testDiMuonBranchExists(self):
     """Tests that the DiMuon branch exists"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testMuon_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertTrue(cmg.aliases.has_key('cmgDiMuonSel'),'We are expecting a branch called cmgDiMuonSel')
Exemple #2
0
    def testMultiJetBranchExists(self):
        """Tests that the multi-object branch exists."""

        output = self.__class__.cfgsRunOnceCache[TestMultiJet.cfg_file_name]
        events = TestTools.getObject(output[1], "Events")

        cmg = cmgTuple.cmgTuple(events)
        self.assertTrue(cmg.aliases.has_key("cmgMultiJet"),
                        "We are expecting a branch called cmgMultiJet")
Exemple #3
0
    def testDiHemiBranchExists(self):
        """Tests that the di-hemisphere branch exists."""

        output = self.__class__.cfgsRunOnceCache["CMGTools/Common/test/testHemi_cfg.py"]
        events = TestTools.getObject(output[1], "Events")

        cmg = cmgTuple.cmgTuple(events)
        self.assertTrue(cmg.aliases.has_key("cmgDiHemi"),
                        "We are expecting a branch called cmgDiHemi")
Exemple #4
0
 def testTauPt(self):
     """Very the default pt selection"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testTau_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertEqual(cmg.Draw("cmgTauSel.pt()","cmgTauSel.pt() < 15.0","goff"),0,\
                      'All taus should have a 15 GeV default cut')
Exemple #5
0
 def testTauID(self):
     """Verify the tauID is applied"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testTau_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertNotEqual(cmg.Draw("cmgTauSel.tauID(\"decayModeFinding\")","cmgTauSel.tauID(\"decayModeFinding\")==1","goff"),0,\
                      'HPS taudID should be filled')
Exemple #6
0
    def testMultiJetBranchExists(self):
        """Tests that the multi-object branch exists."""

        output = self.__class__.cfgsRunOnceCache[TestMultiJet.cfg_file_name]
        events = TestTools.getObject(output[1], "Events")

        cmg = cmgTuple.cmgTuple(events)
        self.assertTrue(cmg.aliases.has_key("cmgMultiJet"),
                        "We are expecting a branch called cmgMultiJet")
Exemple #7
0
 def testBTag(self):
     """Verify that the Btag is applied"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testJet_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertTrue(cmg.Draw("cmgPFJetSel.btag()","cmgPFJetSel.getSelection(\"cuts_btag_loose\")","goff") > 0,\
                      'The btag should be applied')
Exemple #8
0
 def testHasZID(self):
     """Verify that the Z id is applied"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testMuon_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertEqual(cmg.Draw("cmgDiMuonSel.pt()","!cmgDiMuonSel.hasSelection(\"cuts_zmumu\")","goff"),0,\
                      'The Z id should be applied')
Exemple #9
0
 def testHasSelection(self):
     """Verify that hasSelection returns false if there is nothing there"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testMuon_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertEqual(cmg.Draw("cmgDiMuonSel.pt()","cmgDiMuonSel.hasSelection(\"foo_bar_dummy\")","goff"),0,\
                      'foo_bar_dummy must not be found')
Exemple #10
0
 def testLegOrdering(self):
     """Verify that the leg ordering is applied"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testMuon_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertEqual(cmg.Draw("cmgDiMuonSel.mass()","cmgDiMuonSel.leg1().pt() < cmgDiMuonSel.leg2().pt()","goff"),0,\
                      'The legs should be pt ordered')
Exemple #11
0
    def testcmgTriggerObjectFullPt(self):
        """Verify that cmgTriggerObjectFull has some entries"""

        output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        self.assertTrue(cmg.Draw("cmgTriggerObjectFull.pt()",
                                 'cmgTriggerObjectFull.getSelectionRegExp("%s") && cmgTriggerObjectFull.pt() > 0' % self.triggerNameRe,"goff") > 0,\
                         'cmgTriggerObjectFull has some pt')
Exemple #12
0
    def testcmgTriggerObjectSelLength(self):
        """Verify that cmgTriggerObjectSel has length 1"""

        output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        self.assertEquals(cmg.Draw("cmgTriggerObjectSel.pt()",
                                 "cmgTriggerObjectSelVec.size() != 1","goff"), 0,\
                         'cmgTriggerObjectSel should have exactly one entry')
Exemple #13
0
    def testcmgTriggerObjectFullLength(self):
        """Verify that cmgTriggerObjectFull has some entries"""

        output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        self.assertTrue(cmg.Draw("cmgTriggerObjectFull.pt()",
                                 'cmgTriggerObjectFullVec.size() > 0',"goff") > 0,\
                        'cmgTriggerObjectFull should have some entries')
Exemple #14
0
 def testRazorMRT(self):
     """Verify that MRT is set"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testMuon_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertTrue(cmg.Draw("cmgDiMuonSel.mRT()",
                              "(abs(cmgDiMuonSel.mRT() + 9999) > 1e-3) ","goff") > 0,\
                      'MRT should be filled for relevant events')
Exemple #15
0
    def testcmgTriggerObjectFullLength(self):
        """Verify that cmgTriggerObjectFull has some entries"""

        output = self.__class__.cfgsRunOnceCache[
            'CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        self.assertTrue(cmg.Draw("cmgTriggerObjectFull.pt()",
                                 'cmgTriggerObjectFullVec.size() > 0',"goff") > 0,\
                        'cmgTriggerObjectFull should have some entries')
Exemple #16
0
    def testcmgTriggerObjectFullPt(self):
        """Verify that cmgTriggerObjectFull has some entries"""

        output = self.__class__.cfgsRunOnceCache[
            'CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        self.assertTrue(cmg.Draw("cmgTriggerObjectFull.pt()",
                                 'cmgTriggerObjectFull.getSelectionRegExp("%s") && cmgTriggerObjectFull.pt() > 0' % self.triggerNameRe,"goff") > 0,\
                         'cmgTriggerObjectFull has some pt')
Exemple #17
0
    def testcmgTriggerObjectSelLength(self):
        """Verify that cmgTriggerObjectSel has length 1"""

        output = self.__class__.cfgsRunOnceCache[
            'CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        self.assertEquals(cmg.Draw("cmgTriggerObjectSel.pt()",
                                 "cmgTriggerObjectSelVec.size() != 1","goff"), 0,\
                         'cmgTriggerObjectSel should have exactly one entry')
Exemple #18
0
    def testcmgTriggerObjectSelTriggerFirseRegExp(self):
        """Verify that cmgTriggerObjectSel has the selected trigger fires"""

        output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)

        self.assertTrue(cmg.Draw("cmgTriggerObjectSel.pt()",
                                 'cmgTriggerObjectSel.getSelectionRegExp("%s")' % self.triggerNameRe,"goff") > 0,\
                         'There must be at least one event where the trigger fired')
Exemple #19
0
    def testcmgTriggerObjectSelTriggerFires(self):
        """Verify that cmgTriggerObjectSel has the selected trigger fires"""

        output = self.__class__.cfgsRunOnceCache[
            'CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)

        self.assertTrue(cmg.Draw("cmgTriggerObjectSel.pt()",
                                 'cmgTriggerObjectSel.getSelection("%s")' % self.triggerName,"goff") > 0,\
                         'There must be at least one event where the trigger fired')
Exemple #20
0
 def testMuonIsolation(self):
     """Verify that the isolation variables are set"""
     
     output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testMuon_cfg.py']
     events = TestTools.getObject(output[1], 'Events')
     
     cmg = cmgTuple.cmgTuple(events)
     self.assertEqual(cmg.Draw("abs(cmgMuonSel.absIso() + 3)","abs(cmgMuonSel.absIso() + 3) < 1e-6","goff"),0,\
                      'There must be no isolations unset by pat')
     #9999 is the value of Unset(double)
     self.assertEqual(cmg.Draw("abs(cmgMuonSel.absIso() + 9999*3)","abs(cmgMuonSel.absIso() + 9999*3) < 1e-6","goff"),0,\
                      'There must be no isolations unset by cmgTools')
Exemple #21
0
    def testcmgTriggerObjectSelTriggerExists(self):
        """Verify that cmgTriggerObjectSel has the selected trigger"""

        output = self.__class__.cfgsRunOnceCache['CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        entries = cmg.tree.GetEntries()

        self.assertEquals(cmg.Draw("cmgTriggerObjectSel.pt()",
                                 'cmgTriggerObjectSel.hasSelection("%s")' % self.triggerName,"goff"), entries,\
                         'Each event has the test trigger present')
Exemple #22
0
    def testcmgTriggerObjectSelTriggerExists(self):
        """Verify that cmgTriggerObjectSel has the selected trigger"""

        output = self.__class__.cfgsRunOnceCache[
            'CMGTools/Common/test/testTriggerObjects_cfg.py']
        events = TestTools.getObject(output[1], 'Events')

        cmg = cmgTuple.cmgTuple(events)
        entries = cmg.tree.GetEntries()

        self.assertEquals(cmg.Draw("cmgTriggerObjectSel.pt()",
                                 'cmgTriggerObjectSel.hasSelection("%s")' % self.triggerName,"goff"), entries,\
                         'Each event has the test trigger present')