ATLAS Offline Software
Add422Config.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 def getAlg422(cfg):
6  for comp in cfg.getSequence().Members:
7  if comp.name == 'CaloTopoClusters422Maker':
8  return comp
9  return None
10 
11 def fixMakerTool422(alg):
12  if not hasattr(alg, 'ClusterMakerTools'):
13  return False
14 
15  for tool in alg.ClusterMakerTools:
16  if tool.name == 'TopoMaker':
17  assert tool.CellThresholdOnEorAbsEinSigma == 0
18  tool.CellThresholdOnEorAbsEinSigma = 2.0
19  return True
20 
21  return False
22 
24  if not hasattr(alg, 'ClusterCorrectionTools'):
25  return False
26 
27  for tool in alg.ClusterCorrectionTools:
28 
29  if tool.name == 'CaloClusterSnapshot':
30  assert tool.OutputName == 'CaloTopoClusters'
31  tool.OutputName = 'CaloTopoClusters422Snap'
32  return True
33 
34  return False
35 
36 
37 def Add422Cfg(flags):
38 
39  cfg = ComponentAccumulator()
40 
41  from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
42 
43  calo_acc422 = CaloTopoClusterCfg(flags,clustersname='CaloTopoClusters422')
44 
45  alg = getAlg422(calo_acc422)
46  assert fixMakerTool422(alg)
47  assert fixSnapshotTool422(alg)
48 
49  cfg.merge(calo_acc422)
50 
51  return cfg
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
Add422Config.Add422Cfg
def Add422Cfg(flags)
Definition: Add422Config.py:37
Add422Config.fixSnapshotTool422
def fixSnapshotTool422(alg)
Definition: Add422Config.py:23
Add422Config.fixMakerTool422
def fixMakerTool422(alg)
Definition: Add422Config.py:11
python.CaloTopoClusterConfig.CaloTopoClusterCfg
def CaloTopoClusterCfg(flags, cellsname="AllCalo", clustersname=None, clustersnapname="CaloTopoClusters")
Definition: CaloTopoClusterConfig.py:318
Add422Config.getAlg422
def getAlg422(cfg)
Definition: Add422Config.py:5