ATLAS Offline Software
Loading...
Searching...
No Matches
TestUtils Namespace Reference

Classes

class  makeChainStep

Functions

 writeEmulationFiles (data)
 makeChain (flags, name, L1Thresholds, ChainSteps, Streams="physics:Main", Groups=["RATE:TestRateGroup", "BW:TestBW"])

Variables

int chainsCounter = 0

Function Documentation

◆ makeChain()

TestUtils.makeChain ( flags,
name,
L1Thresholds,
ChainSteps,
Streams = "physics:Main",
Groups = ["RATE:TestRateGroup", "BW:TestBW"] )
In addition to making the chain object fills the flags that are used to generate MnuCOnfig JSON file

Definition at line 36 of file TestUtils.py.

36def makeChain( flags, name, L1Thresholds, ChainSteps, Streams="physics:Main", Groups=["RATE:TestRateGroup", "BW:TestBW"]):
37 """
38 In addition to making the chain object fills the flags that are used to generate MnuCOnfig JSON file
39 """
40 prop = ChainProp( name=name, l1SeedThresholds=L1Thresholds, groups=Groups )
41 chainDict = dictFromChainName( flags, prop )
42 global chainsCounter
43 chainDict["chainCounter"] = chainsCounter
44 chainsCounter += 1
45
46 #set default chain prescale
47 chainDict['prescale'] = 1
48
49 listOfChainDicts = splitChainDictInLegs(chainDict)
50 L1decisions = [ mapThresholdToL1DecisionCollection(stri) for stri in L1Thresholds]
51 # create the ChainSteps, with the chaindict
52 StepConfig = []
53 for step in ChainSteps:
54 StepConfig+=[ChainStep(step.name,
55 step.seq,
56 chainDicts=step.chainDicts if step.chainDicts else listOfChainDicts,
57 comboHypoCfg=step.comboHypoCfg,
58 comboToolConfs=step.comboToolConfs, isEmpty=step.isEmpty)]
59
60 chainConfig = Chain( name=name, L1decisions=L1decisions, ChainSteps=StepConfig )
61 HLTMenuConfig.registerChain( chainDict )
62
63 return chainConfig

◆ writeEmulationFiles()

TestUtils.writeEmulationFiles ( data)
Writes emulation files. key in the dict is a file name (+.dat), list which is value of each dict el is enetered into the file, one el. per line

Definition at line 14 of file TestUtils.py.

14def writeEmulationFiles(data):
15 """Writes emulation files. key in the dict is a file name (+.dat), list which is value of each dict el is enetered into the file, one el. per line"""
16 for name, d in data.items():
17 with open(name+".dat", "w") as f:
18 for event in d:
19 f.write(event)
20 f.write("\n")
21
22

Variable Documentation

◆ chainsCounter

int TestUtils.chainsCounter = 0

Definition at line 34 of file TestUtils.py.