3 """Define methods to construct configured Tile L2 builder tool and algorithm"""
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.Enums
import ProductionStep
11 """Return component accumulator with configured private Tile L2 builder tool
14 flags -- Athena configuration flags
17 kwargs.setdefault(
'name',
'TileL2Builder')
19 rawChannelContainer =
'TileRawChannelCnt'
20 if (flags.Input.isMC
or flags.Overlay.DataOverlay):
21 rawChannelContainer = flags.Tile.RawChannelContainer
22 kwargs.setdefault(
'TileRawChannelContainer', rawChannelContainer)
26 from TileGeoModel.TileGMConfig
import TileGMCfg
29 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
32 from TileConditions.TileBadChannelsConfig
import TileBadChannelsCondAlgCfg
35 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
38 TileL2Builder=CompFactory.TileL2Builder
46 """Return component accumulator with configured Tile raw channels to L2 algorithm
49 flags -- Athena configuration flags
52 kwargs.setdefault(
'name',
'TileRawChannelToL2')
54 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
55 kwargs.setdefault(
'TileL2Container', flags.Overlay.BkgPrefix +
'TileL2Cnt')
57 kwargs.setdefault(
'TileL2Container',
'TileL2Cnt')
61 if 'TileL2Builder' not in kwargs:
63 kwargs[
'TileL2Builder'] = l2Builder
66 TileRawChannelToL2=CompFactory.TileRawChannelToL2
73 """Return component accumulator with configured Tile raw channels to L2 algorithm with Output stream
76 flags -- Athena configuration flags
77 streamName -- name of output stream. Defaults to RDO.
81 tileRawChanToL2Alg = acc.getPrimary()
83 if 'TileL2Container' in tileRawChanToL2Alg._properties:
84 tileL2Container = tileRawChanToL2Alg._properties[
'TileL2Container']
86 tileL2Container = tileRawChanToL2Alg._descriptors[
'TileL2Container'].default
88 if flags.Output.doWriteRDO:
89 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
90 acc.merge(
OutputStreamCfg(flags, streamName, [f
'TileL2Container#{tileL2Container}']) )
95 if __name__ ==
"__main__":
97 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
98 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
99 from AthenaCommon.Logging
import log
106 flags.Input.Files = defaultTestFiles.RAW_RUN2
107 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
108 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
110 flags.Output.ESDFileName =
"myESD.pool.root"
114 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
117 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
121 acc.getService(
'StoreGateSvc').Dump =
True
124 acc.printConfig(withDetails =
True, summariseProps =
True)
125 acc.store(
open(
'TileL2.pkl',
'wb') )
128 sc = acc.run(maxEvents=3)
132 sys.exit(
not sc.isSuccess())