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 
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'],
112  #'mEmpty1': ['Step_empty1', 'Step_mu11'], # try to break 'Step_mu21'],
113  'mEmpty2': ['Step_mu11' ,'Step_empty2' ,'Step_mu32', 'Step_mu41'],
114  'mv1dr' : ['Step_mu11Dr', 'Step_mu21', 'Step_mu31', 'Step_mu41'],
115  #egamma
116  'ev1': ['Step_em11', 'Step_em21', 'Step_em31'],
117  'ev2': ['Step_em11', 'Step_em22'],
118  'ev3': ['Step_em11', 'Step_em23'],
119  'gv1': ['Step_gam11'],
120  'ev1dr' : ['Step_em11Dr', 'Step_em21Dr', 'Step_em31']
121  }
122  return stepDictionary
123 
124 
125 
126  def Step_mu11(self, flags):
127  return self.getStep(flags, "mu11",[ muCfg111 ])
128 
129  def Step_mu21(self, flags):
130  return self.getStep(flags, "mu21",[ muCfg211 ])
131 
132  def Step_mu11Dr(self, flags):
133  return self.getStep(flags, "mu11",[ muCfg111 ], comboTools=[dimuDrComboHypoTool])
134 
135  def Step_mu21Dr(self, flags):
136  return self.getStep(flags, "mu21",[ muCfg211 ], comboTools=[dimuDrComboHypoTool])
137 
138  def Step_mu22(self, flags):
139  return self.getStep(flags, "mu22",[ muCfg222 ])
140 
141  def Step_mu31(self, flags):
142  return self.getStep(flags, "mu31",[ muCfg311 ])
143 
144  def Step_mu32(self, flags):
145  return self.getStep(flags, "mu32",[ muCfg322 ])
146 
147  def Step_mu41(self, flags):
148  return self.getStep(flags, "mu41",[ muCfg411 ])
149 
150  def Step_empty1(self, flags):
151  return self.getEmptyStep(1,'empty')
152 
153  def Step_empty2(self, flags):
154  return self.getEmptyStep(2,'empty')
155 
156  # Electrons
157 
158  def Step_em11(self, flags):
159  return self.getStep(flags, "em11",[ elCfg111 ])
160 
161  def Step_em11Dr(self, flags):
162  return self.getStep(flags, "em11",[ elCfg111 ], comboTools=[dimuDrComboHypoTool])
163 
164  def Step_em21(self, flags):
165  return self.getStep(flags, "em21",[ elCfg211 ])
166 
167  def Step_em21Dr(self, flags):
168  return self.getStep(flags, "em21",[ elCfg211 ], comboTools=[dimuDrComboHypoTool])
169 
170  def Step_em22(self, flags):
171  return self.getStep(flags, "em22",[ elCfg222 ])
172 
173  def Step_em23(self, flags):
174  return self.getStep(flags, "em23",[ elCfg223 ])
175 
176  def Step_em31(self, flags):
177  return self.getStep(flags, "em31",[ elCfg311 ])
178 
179  def Step_gam11(self, flags):
180  return self.getStep(flags, "gam11",[ gamCfg111 ])
181 
grepfile.info
info
Definition: grepfile.py:38
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu32
def Step_mu32(self, flags)
Definition: TestChainConfiguration.py:144
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu31
def Step_mu31(self, flags)
Definition: TestChainConfiguration.py:141
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:135
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu41
def Step_mu41(self, flags)
Definition: TestChainConfiguration.py:147
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:150
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em31
def Step_em31(self, flags)
Definition: TestChainConfiguration.py:176
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:161
python.HLT.Test.TestChainConfiguration.TestChainConfiguration
Definition: TestChainConfiguration.py:72
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:129
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em21
def Step_em21(self, flags)
Definition: TestChainConfiguration.py:164
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:132
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:126
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:173
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em11
def Step_em11(self, flags)
Definition: TestChainConfiguration.py:158
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_mu22
def Step_mu22(self, flags)
Definition: TestChainConfiguration.py:138
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:153
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:179
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:170
python.HLT.Test.TestChainConfiguration.TestChainConfiguration.Step_em21Dr
def Step_em21Dr(self, flags)
Definition: TestChainConfiguration.py:167