ATLAS Offline Software
Public Member Functions | List of all members
python.tests.test_CA.Test Class Reference
Inheritance diagram for python.tests.test_CA.Test:
Collaboration diagram for python.tests.test_CA.Test:

Public Member Functions

def test_basic (self)
 
def test_merge (self)
 
def test_merge_fail (self)
 

Detailed Description

Definition at line 12 of file test_CA.py.

Member Function Documentation

◆ test_basic()

def python.tests.test_CA.Test.test_basic (   self)

Definition at line 13 of file test_CA.py.

13  def test_basic(self):
14  flags = initConfigFlags()
15  flags.lock()
16 
17  cfg = MainServicesCfg(flags)
18  cfg.addSequence(CompFactory.AthSequencer("MySeq"))
19 
20  cfg.addEventAlgo( MyAlg("MyAlg1", eta = 2.5, pt = 42.),
21  sequenceName = "MySeq" )
22 
23  cfg.addEventAlgo( MyAlg("MyAlg2", eta = 5.1, pt = 20.*Units.GeV, filterPassed = False),
24  sequenceName = "MySeq" )
25 
26  # alg3 should never be executed due to filterPassed of alg2
27  cfg.addEventAlgo( MyAlg("MyAlg3", eta = 4.9, pt = 15.*Units.GeV,
28  mytool = MyTool("MyTool", counter = 50, parent="MyAlg3")),
29  sequenceName = "MySeq" )
30 
31  cfg.addService( MySvc(), create=True )
32 
33  with open('test_CA.pkl','wb') as f:
34  cfg.store(f)
35  sc = cfg.run(2)
36  self.assertFalse(sc.isFailure())
37 

◆ test_merge()

def python.tests.test_CA.Test.test_merge (   self)

Definition at line 38 of file test_CA.py.

38  def test_merge(self):
39  cfg1 = ComponentAccumulator()
40  cfg2 = ComponentAccumulator()
41  cfg1.addEventAlgo( MyAlg(name='Alg1', px=1) )
42  cfg2.addEventAlgo( MyAlg(name='Alg2', px=2) )
43  cfg1.merge(cfg2)
44 

◆ test_merge_fail()

def python.tests.test_CA.Test.test_merge_fail (   self)

Definition at line 45 of file test_CA.py.

45  def test_merge_fail(self):
46  cfg1 = ComponentAccumulator()
47  cfg2 = ComponentAccumulator()
48  cfg1.addEventAlgo( MyAlg(px=1) )
49  cfg2.addEventAlgo( MyAlg(px=2) )
50  with self.assertRaises(ValueError):
51  cfg1.merge(cfg2)
52 
53 

The documentation for this class was generated from the following file:
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19