src
PhysicsTools
HeppyCore
python
framework
config_test.py
Go to the documentation of this file.
1
from
__future__
import
absolute_import
2
import
unittest
3
import
os
4
import
shutil
5
import
copy
6
7
from
.config
import
*
8
9
class
ConfigTestCase
(unittest.TestCase):
10
11
def
test_analyzer
(self):
12
class
Ana1(
object
):
13
pass
14
ana1 =
Analyzer
(
15
Ana1,
16
toto =
'1'
,
17
tata =
'a'
18
)
19
# checking that the analyzer name does not contain a slash,
20
# to make sure the output directory name does not contain a subdirectory
21
self.assertTrue(
'/'
not
in
ana1.name )
22
23
def
test_MCComponent
(self):
24
DYJets =
MCComponent
(
25
name =
'DYJets'
,
26
files =
'blah_mc.root'
,
27
xSection = 3048.,
28
nGenEvents = 34915945,
29
triggers = [
'HLT_MC'
],
30
vertexWeight = 1.,
31
effCorrFactor = 1 )
32
self.assertTrue(
True
)
33
34
def
test_config
(self):
35
class
Ana1(
object
):
36
pass
37
ana1 =
Analyzer
(
38
Ana1,
39
toto =
'1'
,
40
tata =
'a'
41
)
42
comp1 =
Component
(
43
'comp1'
,
44
files=
'*.root'
,
45
triggers=
'HLT_stuff'
46
)
47
from
PhysicsTools.HeppyCore.framework.chain
import
Chain
as
Events
48
config =
Config
( components = [comp1],
49
sequence = [ana1],
50
services = [],
51
events_class = Events )
52
53
def
test_copy
(self):
54
class
Ana1(
object
):
55
pass
56
ana1 =
Analyzer
(
57
Ana1,
58
instance_label =
'inst1'
,
59
toto =
'1'
,
60
)
61
ana2 = copy.copy(ana1)
62
ana2.instance_label =
'inst2'
63
ana2.toto2 =
'2'
64
self.assertEqual(ana2.name,
'__main__.Ana1_inst2'
)
65
self.assertEqual(ana2.toto2,
'2'
)
66
67
if
__name__ ==
'__main__'
:
68
unittest.main()
config_test.ConfigTestCase.test_analyzer
def test_analyzer(self)
Definition:
config_test.py:11
config_test.ConfigTestCase.test_config
def test_config(self)
Definition:
config_test.py:34
config_test.ConfigTestCase
Definition:
config_test.py:9
config.Component
Definition:
config.py:186
config.Analyzer
Definition:
config.py:79
config.Config
Definition:
config.py:248
config.MCComponent
Definition:
config.py:223
config_test.ConfigTestCase.test_MCComponent
def test_MCComponent(self)
Definition:
config_test.py:23
default_text_conditions_cfi.object
object
Definition:
default_text_conditions_cfi.py:8
config_test.ConfigTestCase.test_copy
def test_copy(self)
Definition:
config_test.py:53
Generated for CMSSW Reference Manual by
1.8.14