ATLAS Offline Software
egammaNbCellsGainAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 #
4 # @file egammaD3PDAnalysis/python/egamaNbCellsGainAlgConfig.py
5 # @date Aug. 2013
6 # @brief Configure egamaNbCellsGainAlg to fill UserData.
7 #
8 
9 
10 from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
11 from D3PDMakerCoreComps.resolveSGKey import resolveSGKey
12 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13 from AthenaConfiguration.ComponentFactory import CompFactory
14 
15 D3PD = CompFactory.D3PD
16 
17 
19  (flags,
20  prefix = '',
21  sgkey = D3PDMakerFlags.ElectronSGKey,
22  typeName = 'ElectronContainer',
23  allowMissing = False):
24  """Configure egammaNbCellsGainAlg for D3PD making.
25 
26  PREFIX is a prefix to add to the name of the algorithm scheduled.
27 
28  SGKEY/TYPENAME is the StoreGate key of the input electron container
29  and the name of its type.
30 
31  If ALLOWMISSING is true, don't fail if the SG key doesn't exist.
32  """
33 
34  acc = ComponentAccumulator()
35 
36  if (not D3PDMakerFlags.MakeEgammaUserData or
37  D3PDMakerFlags.HaveEgammaUserData):
38  return acc
39 
41  resolved_sgkey = resolveSGKey (flags, sgkey)
42  auxprefix = (D3PDMakerFlags.EgammaUserDataPrefix + '_' +
43  resolved_sgkey + '_')
44 
45  algName = 'egammaNbCellsGainAlg' + resolved_sgkey
46 
48  (algName,
49  Getter = DVGetter
50  (prefix + 'egammaNbCellsGainAlgGetter',
51  TypeName = typeName,
52  SGKey = sgkey),
53  AllowMissing = allowMissing,
54  AuxPrefix = auxprefix,)
55 
56  acc.addEventAlgo (myAlg)
57 
58  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
D3PD::SGDataVectorGetterTool
Getter tool to retrieve DataVector/List collections from StoreGate.
Definition: SGDataVectorGetterTool.h:55
D3PD::egammaNbCellsGainAlg
Count the number of cells in each gain, layer by layer.
Definition: egammaNbCellsGainAlg.h:35
python.egammaNbCellsGainAlgConfig.egammaNbCellsGainAlgCfg
def egammaNbCellsGainAlgCfg(flags, prefix='', sgkey=D3PDMakerFlags.ElectronSGKey, typeName='ElectronContainer', allowMissing=False)
Definition: egammaNbCellsGainAlgConfig.py:19