Skip to content

Commit

Permalink
Fixed unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
andlessa committed Jan 18, 2024
1 parent 2be74c9 commit f25cfda
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 42 deletions.
30 changes: 15 additions & 15 deletions unittests/simplyGluino_default_nodesMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
0 : 'PV',
1 : 'gluino',
2 : 'gluino',
5 : 'N1',
3 : 'q',
3 : 'N1',
4 : 'q',
8 : 'N1',
6 : 'q',
7 : 'q'
5 : 'q',
6 : 'N1',
7 : 'q',
8 : 'q'
}
},
{
Expand All @@ -92,12 +92,12 @@
0 : 'PV',
1 : 'gluino',
2 : 'gluino',
5 : 'N1',
3 : 'q',
3 : 'N1',
4 : 'q',
8 : 'N1',
6 : 'q',
7 : 'q'
5 : 'q',
6 : 'N1',
7 : 'q',
8 : 'q'
}
},
{
Expand All @@ -120,12 +120,12 @@
0 : 'PV',
1 : 'gluino',
2 : 'gluino',
5 : 'N1',
3 : 'q',
3 : 'N1',
4 : 'q',
8 : 'N1',
6 : 'q',
7 : 'q'
5 : 'q',
6 : 'N1',
7 : 'q',
8 : 'q'
},
'likelihood' : 1.267167e-11,
'l_max' : 0.07085462,
Expand Down
3 changes: 2 additions & 1 deletion unittests/summary_scan_default.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Global results summary (20 files)
#Global results summary (21 files)
#The most constraining analysis corresponds to the one with largest observed r.
#The most senstive (ATLAS/CMS) analysis corresponds to the one with largest expected r from those analyses for which this information is available.
#Analyses used for combination = ATLAS-CONF-2013-037,CMS-SUS-13-012.
Expand All @@ -8,6 +8,7 @@
T1tttt.slha CMS-PAS-SUS-15-002 30.5 -1 ATLAS-CONF-2013-037 5.92 5.47 CMS-SUS-13-012 5.82 8.24 8.87 10.4
T1ttttoff.slha CMS-PAS-SUS-15-002 8.16 -1 N/A -1 -1 CMS-SUS-13-012 0.662 0.936 0.662 0.936
T6bbHH_pyhf.slha N/A -1 -1 N/A -1 -1 N/A -1 -1 -1 -1
TRV1_1800_300_300.slha N/A -1 -1 N/A -1 -1 N/A -1 -1 -1 -1
broken.slha N/A -1 -1 N/A -1 -1 N/A -1 -1 -1 -1
complicated.slha ATLAS-SUSY-2013-02 0.388 -1 ATLAS-CONF-2013-037 0.00183 0.00209 CMS-SUS-13-012 0.13 0.208 0.133 0.21
gluinoToTops.slha CMS-PAS-SUS-15-002 5.52 -1 ATLAS-CONF-2013-037 0.479 0.443 CMS-SUS-13-012 0.844 0.703 1.12 0.884
Expand Down
2 changes: 1 addition & 1 deletion unittests/testBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RunBrowserTest(unittest.TestCase):
def testBrowser(self):

browser = databaseBrowser.Browser("unittest")
self.assertEqual(len(browser),14)
self.assertEqual(len(browser),15)

# Check the upper limit for the HM200 signal region:
ul = browser.getULForSR(expid='ATLAS-SUSY-2018-31', datasetID='SRA_H')
Expand Down
12 changes: 6 additions & 6 deletions unittests/testExpSMSDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ def testDict(self):

database.selectExpResults(useNonValidated=True)
expDict = database.expSMSDict
self.assertEqual(len(list(expDict.getSMS())),71)
self.assertEqual(len(list(expDict.getTx())),550)
self.assertEqual(len(list(expDict.getSMS())),72)
self.assertEqual(len(list(expDict.getTx())),551)

def testFilter(self):

database.selectExpResults(analysisIDs='CMS*',useNonValidated=True)
expDict = database.expSMSDict

self.assertEqual(len(list(expDict.getSMS())),35)
self.assertEqual(len(list(expDict.getTx())),438)
self.assertEqual(len(list(expDict.getSMS())),36)
self.assertEqual(len(list(expDict.getTx())),439)

# Reset database:
database.selectExpResults(useNonValidated=True)
expDict = database.expSMSDict
self.assertEqual(len(list(expDict.getSMS())),71)
self.assertEqual(len(list(expDict.getTx())),550)
self.assertEqual(len(list(expDict.getSMS())),72)
self.assertEqual(len(list(expDict.getTx())),551)

def testNodeDict(self):

Expand Down
38 changes: 19 additions & 19 deletions unittests/testInclusiveExpResult.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_expsms_inclusive(self):
nodes_and_indices = getNodesIndices(expsms)
self.assertEqual(nodes_and_indices,
[('PV', 0), ('Inclusive', 1), ('HSCP', 2),
('*anySM', 3), ('MET', 4)])
('MET', 3), ('*anySM', 4)])
self.assertTrue(isinstance(expsms.canonName,InclusiveValue))


Expand All @@ -56,8 +56,8 @@ def test_expsms_inclusive(self):
matched = tx.hasSMSas(smsA)
nodes_and_indices = getNodesIndices(matched)
self.assertEqual(nodes_and_indices,[('PV', 0), ('gluino', 1),
('sta_1', 2), ('W+', 3),
('N1', 4), ('N2', 5), ('sta_1~', 6), ('q', 7),
('sta_1', 2), ('N1', 3),
('W+', 4), ('N2', 5), ('sta_1~', 6), ('q', 7),
('q', 8), ('W-', 9)])


Expand All @@ -66,8 +66,8 @@ def test_expsms_inclusive(self):
matched = tx.hasSMSas(smsB)
nodes_and_indices = getNodesIndices(matched)
self.assertEqual(nodes_and_indices,[('PV', 0), ('gluino', 1),
('sta_1', 2), ('q', 3),
('N1', 4), ('q', 5)])
('sta_1', 2), ('N1', 3),
('q', 4), ('q', 5)])

edges = getEdges(matched)
self.assertEqual(edges,sorted([('PV', 'gluino'), ('PV', 'sta_1'),
Expand All @@ -80,8 +80,8 @@ def test_expsms_inclusive(self):
matched = tx.hasSMSas(smsC)
nodes_and_indices = getNodesIndices(matched)
self.assertEqual(nodes_and_indices,[('PV', 0), ('gluino', 1),
('sta_1', 2), ('Z', 3),
('N1', 4), ('N2', 5),
('sta_1', 2), ('N1', 3),
('Z', 4), ('N2', 5),
('q', 6), ('q', 7)])

smsD = '(PV > sta_1,gluino(1)), (gluino(1) > u,u~,N2(2)), (N2(2) > W-, sta_1)'
Expand All @@ -100,10 +100,10 @@ def test_inclusive_dt(self):
expsms = list(tx.smsMap.keys())[0]
self.assertTrue(isinstance(expsms.canonName,InclusiveValue))
nodes_and_indices = getNodesIndices(expsms)
self.assertEqual(nodes_and_indices,[('PV', 0), ('C1+', 1),
('C1-', 2), ('*anySM', 3),
('MET', 4), ('*anySM', 5),
('MET', 6)])
self.assertEqual(nodes_and_indices,[('PV', 0), ('C1', 1),
('C1', 2), ('MET', 3),
('*anySM', 4), ('MET', 5),
('*anySM', 6)])

smsA = '(PV > C1-(1),C1+(2)), (C1+(2) > u,N1), (C1-(1) > W-,N1)'
slhafile="./testFiles/slha/longLived.slha"
Expand All @@ -112,10 +112,10 @@ def test_inclusive_dt(self):
smsA = ExpSMS.from_string(smsA,model=model)
matched = tx.hasSMSas(smsA)
nodes_and_indices = getNodesIndices(matched)
self.assertEqual(nodes_and_indices,[('PV', 0), ('C1+', 1),
('C1-', 2), ('q', 3),
('N1', 4), ('W-', 5),
('N1', 6)])
self.assertEqual(nodes_and_indices,[('PV', 0), ('C1-', 1),
('C1+', 2), ('N1', 3),
('W-', 4), ('N1', 5),
('q', 6)])
edges = getEdges(matched)
self.assertEqual(edges,sorted([('PV', 'C1+'), ('PV', 'C1-'),
('C1+', 'q'), ('C1+', 'N1'),
Expand All @@ -126,10 +126,10 @@ def test_inclusive_dt(self):
smsA = ExpSMS.from_string(smsA,model=model)
matched = tx.hasSMSas(smsA)
nodes_and_indices = getNodesIndices(matched)
self.assertEqual(nodes_and_indices,[('PV', 0), ('C1+', 1),
('C1-', 2), ('q', 3),
('N1', 4), ('q', 5),
('N1', 6), ('nu', 7),
self.assertEqual(nodes_and_indices,[('PV', 0), ('C1-', 1),
('C1+', 2), ('N1', 3),
('q', 4), ('N1', 5),
('q', 6), ('nu', 7),
('e-', 8)])
edges = getEdges(matched)
self.assertEqual(edges,sorted([('C1+', 'N1'), ('C1+', 'q'),
Expand Down

0 comments on commit f25cfda

Please sign in to comment.