ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
ChainConfigurationBase.ChainConfigurationBase Class Reference
Inheritance diagram for ChainConfigurationBase.ChainConfigurationBase:
Collaboration diagram for ChainConfigurationBase.ChainConfigurationBase:

Public Member Functions

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)
 

Public Attributes

 dict
 
 chainName
 
 chainL1Item
 
 chainPart
 
 L1Threshold
 
 mult
 
 chainPartName
 
 chainPartNameNoMult
 
 chainPartNameNoMultwL1
 

Detailed Description

Definition at line 18 of file ChainConfigurationBase.py.

Constructor & Destructor Documentation

◆ __init__()

def ChainConfigurationBase.ChainConfigurationBase.__init__ (   self,
  chainDict 
)

Definition at line 20 of file ChainConfigurationBase.py.

20  def __init__(self, chainDict):
21 
22  # Consider using translation from dict["chainName"] to dict.chainName (less typing),
23  # though need to be able to access list of dictionaries as value of chainPart as well
24  # dict = type("dict", (object,), dict)
25 
26  self.dict = {}
27  self.dict.update(chainDict)
28 
29  self.chainName = self.dict['chainName']
30  self.chainL1Item = self.dict['L1item']
31 
32  # check dictionary contains only one chain part
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'] ) )
35 
36  self.chainPart = self.dict['chainParts'][0]
37  self.L1Threshold = self.chainPart['L1threshold'] # now threshold is always there
38  self.mult = int(self.chainPart['multiplicity'])
39  self.chainPartName = self.chainPart['chainPartName']
40  self.chainPartNameNoMult = ''
41  self.chainPartNameNoMultwL1 = ''
42 
43  self.chainPartNameNoMult = self.chainPartName[1:] if self.mult > 1 else self.chainPartName
44  self.chainPartNameNoMultwL1 += "_"+self.chainL1Item
45 

Member Function Documentation

◆ assembleChain()

def ChainConfigurationBase.ChainConfigurationBase.assembleChain (   self,
  flags 
)

Definition at line 105 of file ChainConfigurationBase.py.

105  def assembleChain(self, flags):
106  return self.assembleChainImpl(flags)

◆ assembleChainImpl()

def ChainConfigurationBase.ChainConfigurationBase.assembleChainImpl (   self,
  flags 
)

Definition at line 102 of file ChainConfigurationBase.py.

102  def assembleChainImpl(self, flags):
103  return
104 

◆ buildChain()

def ChainConfigurationBase.ChainConfigurationBase.buildChain (   self,
  chainSteps 
)

Definition at line 70 of file ChainConfigurationBase.py.

70  def buildChain(self, chainSteps):
71 
72  alignmentGroups = []
73  if isinstance(self.chainPart, dict):
74  alignmentGroups = [self.chainPart['alignmentGroup']]
75  elif isinstance(self.chainPart, list):
76 
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)
85  else:
86  alignmentGroups = testAlignGrps
87 
88  else:
89  log.error("ChainConfigurationBase.buildChain(): chainPart is not a list or dict, not sure what to do here! %s ", self.chainPart)
90 
91  L1decision = mapThresholdToL1DecisionCollection(self.L1Threshold)
92  myChain = Chain(name = self.chainName,
93  ChainSteps = chainSteps,
94  L1decisions = [L1decision],
95  nSteps = [len(chainSteps)], # not true for combined chains
96  alignmentGroups = alignmentGroups
97  )
98 
99  return myChain
100 

◆ 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)
69 

◆ 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']))
48 
49  # do not generate Menu Sequences, just store the functions that can do that
50  seqArray = [functools.partial(gen, flags, **stepArgs) for gen in sequenceCfgArray]
51 
52  if (len(seqArray)>0):
53  if inspect.signature(comboHypoCfg).parameters and all(inspect.signature(comboTool).parameters for comboTool in comboTools):
54  # Bind flags to comboHypo generator if needed
55  if 'flags' in inspect.signature(comboHypoCfg).parameters:
56  comboHypoCfg = functools.partial(comboHypoCfg, flags)
57  # Be carefull: custom ComboHpos are passed as partial functions, others no
58  # TODO: make uniform way to pass ComboHypo to the step (all partial functions)
59  return ChainStep(stepName, seqArray,
60  [self.dict], comboHypoCfg = comboHypoCfg, comboToolConfs = comboTools)
61 
62  # if not returned any step
63  raise RuntimeError("[getStep] No sequences generated for step %s!", stepName)
64 

Member Data Documentation

◆ chainL1Item

ChainConfigurationBase.ChainConfigurationBase.chainL1Item

Definition at line 30 of file ChainConfigurationBase.py.

◆ chainName

ChainConfigurationBase.ChainConfigurationBase.chainName

Definition at line 29 of file ChainConfigurationBase.py.

◆ chainPart

ChainConfigurationBase.ChainConfigurationBase.chainPart

Definition at line 36 of file ChainConfigurationBase.py.

◆ chainPartName

ChainConfigurationBase.ChainConfigurationBase.chainPartName

Definition at line 39 of file ChainConfigurationBase.py.

◆ chainPartNameNoMult

ChainConfigurationBase.ChainConfigurationBase.chainPartNameNoMult

Definition at line 40 of file ChainConfigurationBase.py.

◆ chainPartNameNoMultwL1

ChainConfigurationBase.ChainConfigurationBase.chainPartNameNoMultwL1

Definition at line 41 of file ChainConfigurationBase.py.

◆ dict

ChainConfigurationBase.ChainConfigurationBase.dict

Definition at line 26 of file ChainConfigurationBase.py.

◆ L1Threshold

ChainConfigurationBase.ChainConfigurationBase.L1Threshold

Definition at line 37 of file ChainConfigurationBase.py.

◆ mult

ChainConfigurationBase.ChainConfigurationBase.mult

Definition at line 38 of file ChainConfigurationBase.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
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.
Definition: bitmask.h:232
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
str
Definition: BTagTrackIpAccessor.cxx:11
HLTSeedingConfig.mapThresholdToL1DecisionCollection
def mapThresholdToL1DecisionCollection(threshold)
Definition: HLTSeedingConfig.py:79
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67