ATLAS Offline Software
CaloThinCellsBySamplingAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 # File: CaloRec/python/CaloThinCellsBySamplingAlgConfig.py
4 # Created: Nov 2019, sss
5 # Purpose: Configure CaloThinCellsBySamplingAlg.
6 
7 from AthenaConfiguration.ComponentFactory import CompFactory
8 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9 
10 
11 def CaloThinCellsBySamplingAlgCfg (flags, streamName,
12  samplings = [],
13  cells = 'AllCalo'):
14  result = ComponentAccumulator()
15 
16  CaloThinCellsBySamplingAlg=CompFactory.CaloThinCellsBySamplingAlg
17  alg = CaloThinCellsBySamplingAlg ('CaloThinCellsBySamplingAlg_' + '_'.join (samplings) + '_' + streamName,
18  StreamName = streamName,
19  SamplingCellsName = samplings,
20  Cells = cells)
21  result.addEventAlgo (alg)
22 
23  if "AOD" in streamName:
24  #Add cell-container to AOD:
25  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD
26  toAOD=[f'CaloCellContainer#{cells}',]
27  result.merge(addToAOD(flags, toAOD))
28 
29  return result
30 
31 
32 if __name__ == "__main__":
33  from AthenaConfiguration.AllConfigFlags import initConfigFlags
34  from AthenaConfiguration.TestDefaults import defaultTestFiles,defaultGeometryTags
35 
36  only = ['CaloThinCellsBySamplingAlg_TileGap3_StreamAOD']
37 
38  flags1 = initConfigFlags()
39  flags1.Input.Files = defaultTestFiles.RAW_RUN2
40  flags1.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
41  flags1.lock()
42  acc1 = CaloThinCellsBySamplingAlgCfg (flags1, 'StreamAOD',
43  ['TileGap3'])
44  acc1.printConfig(summariseProps=True, onlyComponents=only)
45  acc1.wasMerged()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:142
python.CaloThinCellsBySamplingAlgConfig.CaloThinCellsBySamplingAlgCfg
def CaloThinCellsBySamplingAlgCfg(flags, streamName, samplings=[], cells='AllCalo')
Definition: CaloThinCellsBySamplingAlgConfig.py:11