ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EventSelectionAlgorithms
python
EventSelectionConfigMass_unitTest.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
"""Unit tests for LJETMASS_N (NObjectMassSelectorAlg) and LJETMASSWINDOW_N
4
(NLargeRJetMassWindowSelectorAlg), including veto-mode parsing."""
5
6
import
unittest
7
from
EventSelectionAlgorithms.EventSelectionConfigTestSupport
import
run, named, prop
8
9
LRJ = {
"largeRjets"
:
"AnaLRJets"
}
10
11
12
class
TestLJetMass
(unittest.TestCase):
13
def
test_minimal
(self):
14
algs = named(
run
(
"LJETMASS_N 50000 >= 1"
, containers=LRJ),
"NLJETMASS"
)
15
self.assertEqual(len(algs), 1)
16
self.assertEqual(algs[0].getType(),
"CP::NObjectMassSelectorAlg"
)
17
self.assertEqual(prop(algs[0],
"minMass"
), 50000.0)
18
self.assertEqual(prop(algs[0],
"sign"
),
"GE"
)
19
self.assertEqual(prop(algs[0],
"count"
), 1)
20
21
def
test_extra_selection
(self):
22
algs = named(
run
(
"LJETMASS_N topjet 50000 >= 1"
, containers=LRJ),
"NLJETMASS"
)
23
self.assertIn(
"topjet"
, prop(algs[0],
"objectSelection"
))
24
25
26
class
TestLJetMassWindow
(unittest.TestCase):
27
def
test_minimal
(self):
28
algs = named(
run
(
"LJETMASSWINDOW_N 60000 100000 >= 1"
, containers=LRJ),
"NLJETMASSWINDOW"
)
29
self.assertEqual(len(algs), 1)
30
self.assertEqual(algs[0].getType(),
"CP::NLargeRJetMassWindowSelectorAlg"
)
31
self.assertEqual(prop(algs[0],
"lowMass"
), 60000.0)
32
self.assertEqual(prop(algs[0],
"highMass"
), 100000.0)
33
self.assertEqual(prop(algs[0],
"count"
), 1)
34
self.assertFalse(prop(algs[0],
"vetoMode"
,
False
))
35
36
def
test_veto
(self):
37
algs = named(
run
(
"LJETMASSWINDOW_N 60000 100000 >= 1 veto"
, containers=LRJ),
"NLJETMASSWINDOW"
)
38
self.assertTrue(prop(algs[0],
"vetoMode"
))
39
40
def
test_extra_selection
(self):
41
algs = named(
run
(
"LJETMASSWINDOW_N topjet 60000 100000 >= 1"
, containers=LRJ),
"NLJETMASSWINDOW"
)
42
self.assertIn(
"topjet"
, prop(algs[0],
"ljetSelection"
))
43
self.assertEqual(prop(algs[0],
"lowMass"
), 60000.0)
44
45
def
test_extra_selection_and_veto
(self):
46
algs = named(
run
(
"LJETMASSWINDOW_N topjet 60000 100000 >= 1 veto"
, containers=LRJ),
"NLJETMASSWINDOW"
)
47
self.assertIn(
"topjet"
, prop(algs[0],
"ljetSelection"
))
48
self.assertTrue(prop(algs[0],
"vetoMode"
))
49
50
def
test_wrong_argcount
(self):
51
self.assertRaises(ValueError, run,
"LJETMASSWINDOW_N 60000 >= 1"
, containers=LRJ)
52
53
54
if
__name__ ==
"__main__"
:
55
unittest.main()
python.EventSelectionConfigMass_unitTest.TestLJetMassWindow
Definition
EventSelectionConfigMass_unitTest.py:26
python.EventSelectionConfigMass_unitTest.TestLJetMassWindow.test_veto
test_veto(self)
Definition
EventSelectionConfigMass_unitTest.py:36
python.EventSelectionConfigMass_unitTest.TestLJetMassWindow.test_extra_selection
test_extra_selection(self)
Definition
EventSelectionConfigMass_unitTest.py:40
python.EventSelectionConfigMass_unitTest.TestLJetMassWindow.test_minimal
test_minimal(self)
Definition
EventSelectionConfigMass_unitTest.py:27
python.EventSelectionConfigMass_unitTest.TestLJetMassWindow.test_wrong_argcount
test_wrong_argcount(self)
Definition
EventSelectionConfigMass_unitTest.py:50
python.EventSelectionConfigMass_unitTest.TestLJetMassWindow.test_extra_selection_and_veto
test_extra_selection_and_veto(self)
Definition
EventSelectionConfigMass_unitTest.py:45
python.EventSelectionConfigMass_unitTest.TestLJetMass
Definition
EventSelectionConfigMass_unitTest.py:12
python.EventSelectionConfigMass_unitTest.TestLJetMass.test_extra_selection
test_extra_selection(self)
Definition
EventSelectionConfigMass_unitTest.py:21
python.EventSelectionConfigMass_unitTest.TestLJetMass.test_minimal
test_minimal(self)
Definition
EventSelectionConfigMass_unitTest.py:13
run
int run(int argc, char *argv[])
Definition
ttree2hdf5.cxx:28
Generated on
for ATLAS Offline Software by
1.17.0