ATLAS Offline Software
make_repeatedCondConfigurer.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 from TrigHLTJetHypo.FastReductionAlgToolFactory import toolfactory
4 
5 from AthenaCommon.Logging import logging
6 from AthenaCommon.Constants import DEBUG
7 
8 logger = logging.getLogger( __name__)
9 logger.setLevel(DEBUG)
10 
11 def make_repeatedCond(tree_id, tree_pid, clique,
12  multiplicity=1,
13  chainPartInd=-1,
14  conditionMakers=[],
15  invert=False):
16 
17  """makes a RepeatedConditionConfigurer from explicit arguments)"""
18 
19  toolclass, name = toolfactory('RepeatedConditionConfigTool')
20  repeated_args = {'name': name}
21  repeated_args['conditionMakers'] = sorted(conditionMakers, key=lambda cm: cm.name() if callable(cm.name) else cm.name)
22  repeated_args['id'] = tree_id
23  repeated_args['pid'] = tree_pid
24  repeated_args['clique'] = clique
25  repeated_args['multiplicity'] = multiplicity
26  repeated_args['chainPartInd'] = chainPartInd
27  repeated_args['invert'] = invert
28 
29  return toolclass(**repeated_args)
30 
31 def make_repeatedObj(repArgs, conditionMakers=[]):
32  """makes a RepeatedConditionConfigurer from an objects holding
33  the necessary parameters, usually built by a scenanario_XX module."""
34 
35  return make_repeatedCond(tree_id=repArgs.tree_id,
36  tree_pid=repArgs.tree_pid,
37  clique=repArgs.clique,
38  multiplicity=repArgs.multiplicity,
39  chainPartInd=repArgs.chainPartInd,
40  invert = repArgs.invert,
41  conditionMakers=conditionMakers,)
42 
43 
45  """paramsrepcondarg container the parameters for building the internal
46  condition configurers, and the containing RepeatedCondition configurer"""
47 
48  condobjs = []
49  for key, vals in repcondarg.condargs:
50  toolclass, name = toolfactory(key)
51  vals['name'] = name
52  condobjs.append(toolclass(**vals))
53 
54  return make_repeatedObj(repcondarg, condobjs)
55 
56 
python.make_repeatedCondConfigurer.make_repeatedObj
def make_repeatedObj(repArgs, conditionMakers=[])
Definition: make_repeatedCondConfigurer.py:31
python.make_repeatedCondConfigurer.make_repeatedCond
def make_repeatedCond(tree_id, tree_pid, clique, multiplicity=1, chainPartInd=-1, conditionMakers=[], invert=False)
Definition: make_repeatedCondConfigurer.py:11
Constants
some useful constants -------------------------------------------------—
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
python.make_repeatedCondConfigurer.make_repeatedCondCfgFromParams
def make_repeatedCondCfgFromParams(repcondarg)
Definition: make_repeatedCondConfigurer.py:44
python.FastReductionAlgToolFactory.toolfactory
toolfactory
Definition: FastReductionAlgToolFactory.py:106