ATLAS Offline Software
Functions | Variables
egammaSwToolConfig Namespace Reference

Functions

def _configureClusterCorrections (flags, swTool)
 
def egammaSwToolCfg (flags, name='egammaSwTool', **kwargs)
 

Variables

string __doc__ = "Configure cluster correction"
 
 flags = initConfigFlags()
 
 Files
 
 cfg = ComponentAccumulator()
 
 mlog = logging.getLogger("egammaSwToolConfigTest")
 
 nestLevel
 
 printDefaults
 
 f = open("egammaswtool.pkl", "wb")
 

Function Documentation

◆ _configureClusterCorrections()

def egammaSwToolConfig._configureClusterCorrections (   flags,
  swTool 
)
private

Definition at line 11 of file egammaSwToolConfig.py.

11 def _configureClusterCorrections(flags, swTool):
12  "Add attributes ClusterCorrectionToolsXX to egammaSwTool object"
13 
14  acc = ComponentAccumulator()
15  from CaloClusterCorrection.CaloSwCorrections import (
16  make_CaloSwCorrectionsCfg)
17 
18  clusterTypes = dict(
19  Ele35='ele35', Ele55='ele55', Ele37='ele37',
20  Gam35='gam35_unconv', Gam55='gam55_unconv', Gam37='gam37_unconv',
21  Econv35='gam35_conv', Econv55='gam55_conv', Econv37='gam37_conv'
22  )
23 
24  version = flags.Egamma.Calib.SuperClusterCorrectionVersion
25  suffix = 'EGSuperCluster'
26  attrPref = 'ClusterCorrectionToolsSuperCluster'
27 
28  for attrName, clName in clusterTypes.items():
29  attrName = attrPref + attrName
30  if not hasattr(swTool, attrName):
31  continue
32  toolsAcc = make_CaloSwCorrectionsCfg(
33  flags, clName, suffix=suffix,
34  version=version,
35  cells_name=flags.Egamma.Keys.Input.CaloCells)
36  tools = acc.popToolsAndMerge(toolsAcc)
37  setattr(swTool, attrName, GaudiHandles.PrivateToolHandleArray(tools))
38 
39  return acc
40 
41 

◆ egammaSwToolCfg()

def egammaSwToolConfig.egammaSwToolCfg (   flags,
  name = 'egammaSwTool',
**  kwargs 
)

Definition at line 42 of file egammaSwToolConfig.py.

42 def egammaSwToolCfg(flags, name='egammaSwTool', **kwargs):
43 
44  mlog = logging.getLogger(name)
45  mlog.debug('Start configuration')
46 
47  acc = ComponentAccumulator()
48 
49  egswtool = CompFactory.egammaSwTool(name, **kwargs)
50 
51  # For now, the correction is called, but this might change.
52  utilsAcc = _configureClusterCorrections(flags, egswtool)
53  acc.merge(utilsAcc)
54 
55  acc.setPrivateTools(egswtool)
56  return acc
57 
58 

Variable Documentation

◆ __doc__

string egammaSwToolConfig.__doc__ = "Configure cluster correction"
private

Definition at line 3 of file egammaSwToolConfig.py.

◆ cfg

egammaSwToolConfig.cfg = ComponentAccumulator()

Definition at line 70 of file egammaSwToolConfig.py.

◆ f

egammaSwToolConfig.f = open("egammaswtool.pkl", "wb")

Definition at line 78 of file egammaSwToolConfig.py.

◆ Files

egammaSwToolConfig.Files

Definition at line 65 of file egammaSwToolConfig.py.

◆ flags

egammaSwToolConfig.flags = initConfigFlags()

Definition at line 64 of file egammaSwToolConfig.py.

◆ mlog

egammaSwToolConfig.mlog = logging.getLogger("egammaSwToolConfigTest")

Definition at line 71 of file egammaSwToolConfig.py.

◆ nestLevel

egammaSwToolConfig.nestLevel

Definition at line 75 of file egammaSwToolConfig.py.

◆ printDefaults

egammaSwToolConfig.printDefaults

Definition at line 76 of file egammaSwToolConfig.py.

python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
egammaSwToolConfig.egammaSwToolCfg
def egammaSwToolCfg(flags, name='egammaSwTool', **kwargs)
Definition: egammaSwToolConfig.py:42
CaloSwCorrections.make_CaloSwCorrectionsCfg
def make_CaloSwCorrectionsCfg(flags, key=None, suffix='', version=None, corrlist=None, cells_name=None, source=None, weighting=False, remdup=False, rembad=False, **kw)
Main entry point to create a list of correction tools.
Definition: CaloSwCorrections.py:1222
egammaSwToolConfig._configureClusterCorrections
def _configureClusterCorrections(flags, swTool)
Definition: egammaSwToolConfig.py:11