ATLAS Offline Software
TestChainConfiguration.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.Logging import logging
4 logging.getLogger().info("Importing %s",__name__)
5 log = logging.getLogger(__name__)
6 
7 
8 from ..Config.ChainConfigurationBase import ChainConfigurationBase
9 
10 from TriggerMenuMT.CFtest.HLTSignatureConfig import muMenuSequence, elMenuSequence, gamMenuSequence
11 from TriggerMenuMT.CFtest.HLTSignatureHypoTools import dimuDrComboHypoTool
12 from TriggerMenuMT.HLT.Config.MenuComponents import EmptyMenuSequenceCfg
13 
14 #--------------------------------------------------------
15 # fragments generating config will be functions in new JO
16 #--------------------------------------------------------
17 
18 
19 # Muons
20 def muCfg(flags,step,reconame, hyponame):
21  return muMenuSequence(flags,step,reconame, hyponame)
22 
23 def muCfg111(flags):
24  return muCfg(flags,step="1",reconame="v1", hyponame="v1")
25 
26 def muCfg211(flags):
27  return muCfg(flags,step="2",reconame="v1", hyponame="v1")
28 
29 def muCfg311(flags):
30  return muCfg(flags,step="3",reconame="v1", hyponame="v1")
31 
32 def muCfg322(flags):
33  return muCfg(flags,step="3",reconame="v2", hyponame="v2")
34 
35 def muCfg411(flags):
36  return muCfg(flags,step="4",reconame="v1", hyponame="v1")
37 
38 def muCfg222(flags):
39  return muCfg(flags,step="2",reconame="v2", hyponame="v2")
40 
41 
42 # Egamma
43 def elCfg(flags,step,reconame, hyponame):
44  return elMenuSequence(flags,step,reconame, hyponame)
45 
46 def gamCfg(flags,step,reconame, hyponame):
47  return gamMenuSequence(flags,step,reconame, hyponame)
48 
49 def elCfg111(flags):
50  return elCfg(flags,step="1",reconame="v1", hyponame="v1")
51 
52 def elCfg211(flags):
53  return elCfg(flags,step="2",reconame="v1", hyponame="v1")
54 
55 def elCfg222(flags):
56  return elCfg(flags,step="2",reconame="v2", hyponame="v2")
57 
58 def elCfg223(flags):
59  return elCfg(flags,step="2",reconame="v2", hyponame="v3")
60 
61 def elCfg311(flags):
62  return elCfg(flags,step="3",reconame="v1", hyponame="v1")
63 
64 def gamCfg111(flags):
65  return gamCfg(flags,step="1",reconame="v1", hyponame="v1")
66 
67 
68 
69 #----------------------------------------------------------------
70 # Class to configure chain
71 #----------------------------------------------------------------
73 
74  def __init__(self, chainDict):
75  ChainConfigurationBase.__init__(self,chainDict)
76 
77  # ----------------------
78  # Assemble the chain depending on information from chainName
79  # ----------------------
80  def assembleChainImpl(self, flags):
81  chainSteps = []
82  stepDictionary = self.getStepDictionary()
83  key = self.chainPart['extra']
84 
85  log.debug('testChain key = %s', key)
86  if key in stepDictionary:
87  steps=stepDictionary[key]
88  else:
89  raise RuntimeError("Chain configuration unknown for electron chain with key: " + key )
90 
91  for step in steps:
92  chainstep = getattr(self, step)(flags)
93  chainSteps+=[chainstep]
94 
95 
96  myChain = self.buildChain(chainSteps)
97  return myChain
98 
99 
100 
101  def getStepDictionary(self):
102  # --------------------
103  # define names of the steps and obtain the chainStep configuration
104  # --------------------
105 
106  stepDictionary = {
107  #muons
108  'mv1step': ['Step_mu11'],
109  'mv1': ['Step_mu11', 'Step_mu21', 'Step_mu31', 'Step_mu41'],
110  'mv2': ['Step_mu11', 'Step_mu22', 'Step_mu31'],
111  'mEmpty1': ['Step_empty1', 'Step_mu21'], # empty step
112  #'mEmpty1': ['Step_empty1', 'Step_mu11'], # try to break 'Step_mu21'],
113  'mEmpty2': ['Step_mu11' ,'Step_empty2' ,'Step_mu31', 'Step_mu41'], # same as mv1 with empty step
114  'mEmpty3': ['Step_mu11' ,'Step_empty2' ,'Step_empty3', 'Step_mu41'], # empty step + emtpy sequence
115  'mv1dr' : ['Step_mu11Dr', 'Step_mu21', 'Step_mu31', 'Step_mu41'],
116  #egamma
117  'ev1': ['Step_em11', 'Step_em21', 'Step_em31'],
118  'ev2': ['Step_em11', 'Step_em22'],
119  'ev3': ['Step_em11', 'Step_em23'],
120  'gv1': ['Step_gam11'],
121  'ev1dr' : ['Step_em11Dr', 'Step_em21Dr', 'Step_em31']
122  }
123  return stepDictionary
124 
125 
126 
127  def Step_mu11(self, flags):
128  return self.getStep(flags, "mu11",[ muCfg111 ])
129 
130  def Step_mu21(self, flags):
131  return self.getStep(flags, "mu21",[ muCfg211 ])
132 
133  def Step_mu11Dr(self, flags):
134  return self.getStep(flags, "mu11",[ muCfg111 ], comboTools=[dimuDrComboHypoTool])
135 
136  def Step_mu21Dr(self, flags):
137  return self.getStep(flags, "mu21",[ muCfg211 ], comboTools=[dimuDrComboHypoTool])
138 
139  def Step_mu22(self, flags):
140  return self.getStep(flags, "mu22",[ muCfg222 ])
141 
142  def Step_mu31(self, flags):
143  return self.getStep(flags, "mu31",[ muCfg311 ])
144 
145  def Step_mu32(self, flags):
146  return self.getStep(flags, "mu32",[ muCfg322 ])
147 
148  def Step_mu41(self, flags):
149  return self.getStep(flags, "mu41",[ muCfg411 ])
150 
151  def Step_empty1(self, flags):
152  return self.getEmptyStep('empty')
153 
154  def Step_empty2(self, flags):
155  return self.getEmptyStep('empty')
156 
157  def Step_empty3(self, flags):
158  return self.getStep(flags,'emptySeq', [EmptyMenuSequenceCfg], name="EmptySequence")
159 
160  # Electrons
161 
162  def Step_em11(self, flags):
163  return self.getStep(flags, "em11",[ elCfg111 ])
164 
165  def Step_em11Dr(self, flags):
166  return self.getStep(flags, "em11",[ elCfg111 ], comboTools=[dimuDrComboHypoTool])
167 
168  def Step_em21(self, flags):
169  return self.getStep(flags, "em21",[ elCfg211 ])
170 
171  def Step_em21Dr(self, flags):
172  return self.getStep(flags, "em21",[ elCfg211 ], comboTools=[dimuDrComboHypoTool])
173 
174  def Step_em22(self, flags):
175  return self.getStep(flags, "em22",[ elCfg222 ])
176 
177  def Step_em23(self, flags):
178  return self.getStep(flags, "em23",[ elCfg223 ])
179 
180  def Step_em31(self, flags):
181  return self.getStep(flags, "em31",[ elCfg311 ])
182 
183  def Step_gam11(self, flags):
184  return self.getStep(flags, "gam11",[ gamCfg111 ])
185 
grepfile.info
info
Definition: grepfile.py:38
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu32
def Step_mu32(self, flags)
Definition: TestChainConfiguration.py:145
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu31
def Step_mu31(self, flags)
Definition: TestChainConfiguration.py:142
python.HLT.Test.TestChainConfiguration.elCfg223
def elCfg223(flags)
Definition: TestChainConfiguration.py:58
ChainConfigurationBase
Definition: ChainConfigurationBase.py:1
HLTSignatureConfig.gamMenuSequence
def gamMenuSequence(flags, step, reconame, hyponame)
Definition: HLTSignatureConfig.py:98
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu21Dr
def Step_mu21Dr(self, flags)
Definition: TestChainConfiguration.py:136
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu41
def Step_mu41(self, flags)
Definition: TestChainConfiguration.py:148
HLTSignatureConfig.muMenuSequence
def muMenuSequence(flags, step, reconame, hyponame)
Definition: HLTSignatureConfig.py:110
python.HLT.Test.TestChainConfiguration.elCfg311
def elCfg311(flags)
Definition: TestChainConfiguration.py:61
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_empty1
def Step_empty1(self, flags)
Definition: TestChainConfiguration.py:151
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em31
def Step_em31(self, flags)
Definition: TestChainConfiguration.py:180
python.HLT.Test.TestChainConfiguration.muCfg211
def muCfg211(flags)
Definition: TestChainConfiguration.py:26
python.HLT.Test.TestChainConfiguration.elCfg211
def elCfg211(flags)
Definition: TestChainConfiguration.py:52
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em11Dr
def Step_em11Dr(self, flags)
Definition: TestChainConfiguration.py:165
python.HLT.Test.TestChainConfiguration.TestChainConfiguration
Definition: TestChainConfiguration.py:72
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_empty3
def Step_empty3(self, flags)
Definition: TestChainConfiguration.py:157
python.HLT.Test.TestChainConfiguration.muCfg
def muCfg(flags, step, reconame, hyponame)
Definition: TestChainConfiguration.py:20
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu21
def Step_mu21(self, flags)
Definition: TestChainConfiguration.py:130
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em21
def Step_em21(self, flags)
Definition: TestChainConfiguration.py:168
python.HLT.Test.TestChainConfiguration.muCfg411
def muCfg411(flags)
Definition: TestChainConfiguration.py:35
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.assembleChainImpl
def assembleChainImpl(self, flags)
Definition: TestChainConfiguration.py:80
python.HLT.Test.TestChainConfiguration.elCfg222
def elCfg222(flags)
Definition: TestChainConfiguration.py:55
python.HLT.Test.TestChainConfiguration.muCfg322
def muCfg322(flags)
Definition: TestChainConfiguration.py:32
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.getStepDictionary
def getStepDictionary(self)
Definition: TestChainConfiguration.py:101
python.HLT.Test.TestChainConfiguration.elCfg111
def elCfg111(flags)
Definition: TestChainConfiguration.py:49
python.HLT.Test.TestChainConfiguration.gamCfg111
def gamCfg111(flags)
Definition: TestChainConfiguration.py:64
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu11Dr
def Step_mu11Dr(self, flags)
Definition: TestChainConfiguration.py:133
python.HLT.Test.TestChainConfiguration.muCfg311
def muCfg311(flags)
Definition: TestChainConfiguration.py:29
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu11
def Step_mu11(self, flags)
Muons
Definition: TestChainConfiguration.py:127
HLTSignatureConfig.elMenuSequence
def elMenuSequence(flags, step, reconame, hyponame)
Definition: HLTSignatureConfig.py:87
python.HLT.Test.TestChainConfiguration.muCfg222
def muCfg222(flags)
Definition: TestChainConfiguration.py:38
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em23
def Step_em23(self, flags)
Definition: TestChainConfiguration.py:177
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em11
def Step_em11(self, flags)
Definition: TestChainConfiguration.py:162
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu22
def Step_mu22(self, flags)
Definition: TestChainConfiguration.py:139
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.__init__
def __init__(self, chainDict)
Definition: TestChainConfiguration.py:74
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_empty2
def Step_empty2(self, flags)
Definition: TestChainConfiguration.py:154
python.HLT.Test.TestChainConfiguration.elCfg
def elCfg(flags, step, reconame, hyponame)
Definition: TestChainConfiguration.py:43
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_gam11
def Step_gam11(self, flags)
Definition: TestChainConfiguration.py:183
python.HLT.Test.TestChainConfiguration.gamCfg
def gamCfg(flags, step, reconame, hyponame)
Definition: TestChainConfiguration.py:46
python.HLT.Test.TestChainConfiguration.muCfg111
def muCfg111(flags)
Definition: TestChainConfiguration.py:23
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em22
def Step_em22(self, flags)
Definition: TestChainConfiguration.py:174
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em21Dr
def Step_em21Dr(self, flags)
Definition: TestChainConfiguration.py:171