|
def | __init__ (self, chainDict) |
|
def | getStep (self, flags, stepName, sequenceCfgArray, comboHypoCfg=ComboHypoCfg, comboTools=[], **stepArgs) |
|
def | getEmptyStep (self, stepID, stepPartName) |
|
def | buildChain (self, chainSteps) |
|
def | assembleChainImpl (self, flags) |
|
def | assembleChain (self, flags) |
|
Definition at line 18 of file ChainConfigurationBase.py.
◆ __init__()
def ChainConfigurationBase.ChainConfigurationBase.__init__ |
( |
|
self, |
|
|
|
chainDict |
|
) |
| |
Definition at line 20 of file ChainConfigurationBase.py.
27 self.dict.
update(chainDict)
29 self.chainName = self.dict[
'chainName']
30 self.chainL1Item = self.dict[
'L1item']
33 if len( self.dict[
'chainParts'] ) != 1:
34 raise RuntimeError(
"Passed chain dictionary with %i chainParts to ChainConfigurationBase, but this constructor only supports chains with a single part" % len( self.dict[
'chainParts'] ) )
36 self.chainPart = self.dict[
'chainParts'][0]
37 self.L1Threshold = self.chainPart[
'L1threshold']
38 self.mult =
int(self.chainPart[
'multiplicity'])
39 self.chainPartName = self.chainPart[
'chainPartName']
40 self.chainPartNameNoMult =
''
41 self.chainPartNameNoMultwL1 =
''
43 self.chainPartNameNoMult = self.chainPartName[1:]
if self.mult > 1
else self.chainPartName
44 self.chainPartNameNoMultwL1 +=
"_"+self.chainL1Item
◆ assembleChain()
def ChainConfigurationBase.ChainConfigurationBase.assembleChain |
( |
|
self, |
|
|
|
flags |
|
) |
| |
◆ assembleChainImpl()
def ChainConfigurationBase.ChainConfigurationBase.assembleChainImpl |
( |
|
self, |
|
|
|
flags |
|
) |
| |
◆ buildChain()
def ChainConfigurationBase.ChainConfigurationBase.buildChain |
( |
|
self, |
|
|
|
chainSteps |
|
) |
| |
Definition at line 70 of file ChainConfigurationBase.py.
70 def buildChain(self, chainSteps):
73 if isinstance(self.chainPart, dict):
74 alignmentGroups = [self.chainPart[
'alignmentGroup']]
75 elif isinstance(self.chainPart, list):
77 alignmentGroups = [cp[
'alignmentGroup']
for cp
in self.chainPart]
78 testAlignGrps =
list(
set(alignmentGroups))
79 if not(len(testAlignGrps) == 1
and testAlignGrps[0] ==
'JetMET'):
80 log.error(
"ChainConfigurationBase.buildChain(): number of chainParts does not correspond chainSteps")
81 log.error(
'ChainConfigurationBase.buildChain() chainPart: %s',self.chainPart)
82 log.error(
"ChainConfigurationBase.buildChain() alignmentGroups: %s", alignmentGroups)
83 log.error(
"ChainConfigurationBase.buildChain() chainName: %s", self.chainName)
84 log.error(
"ChainConfigurationBase.buildChain() chainSteps: %s", chainSteps)
86 alignmentGroups = testAlignGrps
89 log.error(
"ChainConfigurationBase.buildChain(): chainPart is not a list or dict, not sure what to do here! %s ", self.chainPart)
92 myChain = Chain(name = self.chainName,
93 ChainSteps = chainSteps,
94 L1decisions = [L1decision],
95 nSteps = [len(chainSteps)],
96 alignmentGroups = alignmentGroups
◆ getEmptyStep()
def ChainConfigurationBase.ChainConfigurationBase.getEmptyStep |
( |
|
self, |
|
|
|
stepID, |
|
|
|
stepPartName |
|
) |
| |
Definition at line 65 of file ChainConfigurationBase.py.
65 def getEmptyStep(self, stepID, stepPartName):
66 stepName =
'Step%s'%
str(stepID) +
'_' + stepPartName
67 log.debug(
"Configuring empty step %s", stepName)
68 return ChainStep(stepName, chainDicts=[self.dict], isEmpty =
True)
◆ getStep()
def ChainConfigurationBase.ChainConfigurationBase.getStep |
( |
|
self, |
|
|
|
flags, |
|
|
|
stepName, |
|
|
|
sequenceCfgArray, |
|
|
|
comboHypoCfg = ComboHypoCfg , |
|
|
|
comboTools = [] , |
|
|
** |
stepArgs |
|
) |
| |
Definition at line 46 of file ChainConfigurationBase.py.
46 def getStep(self, flags, stepName, sequenceCfgArray, comboHypoCfg=ComboHypoCfg, comboTools=[], **stepArgs):
47 log.debug(
"Configuring step %s with %d chainParts", stepName, len(self.dict[
'chainParts']))
50 seqArray = [functools.partial(gen, flags, **stepArgs)
for gen
in sequenceCfgArray]
53 if inspect.signature(comboHypoCfg).parameters
and all(inspect.signature(comboTool).parameters
for comboTool
in comboTools):
55 if 'flags' in inspect.signature(comboHypoCfg).parameters:
56 comboHypoCfg = functools.partial(comboHypoCfg, flags)
59 return ChainStep(stepName, seqArray,
60 [self.dict], comboHypoCfg = comboHypoCfg, comboToolConfs = comboTools)
63 raise RuntimeError(
"[getStep] No sequences generated for step %s!", stepName)
◆ chainL1Item
ChainConfigurationBase.ChainConfigurationBase.chainL1Item |
◆ chainName
ChainConfigurationBase.ChainConfigurationBase.chainName |
◆ chainPart
ChainConfigurationBase.ChainConfigurationBase.chainPart |
◆ chainPartName
ChainConfigurationBase.ChainConfigurationBase.chainPartName |
◆ chainPartNameNoMult
ChainConfigurationBase.ChainConfigurationBase.chainPartNameNoMult |
◆ chainPartNameNoMultwL1
ChainConfigurationBase.ChainConfigurationBase.chainPartNameNoMultwL1 |
◆ dict
ChainConfigurationBase.ChainConfigurationBase.dict |
◆ L1Threshold
ChainConfigurationBase.ChainConfigurationBase.L1Threshold |
◆ mult
ChainConfigurationBase.ChainConfigurationBase.mult |
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.