3"""Define methods to construct configured Tile L2 builder tool and algorithm"""
5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory
import CompFactory
7from 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)
24 acc = ComponentAccumulator()
26 from TileGeoModel.TileGMConfig
import TileGMCfg
27 acc.merge( TileGMCfg(flags) )
29 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
30 acc.merge( TileCablingSvcCfg(flags) )
32 from TileConditions.TileBadChannelsConfig
import TileBadChannelsCondAlgCfg
33 acc.merge( TileBadChannelsCondAlgCfg(flags) )
35 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
36 acc.merge( TileEMScaleCondAlgCfg(flags) )
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')
59 acc = ComponentAccumulator()
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}']) )
95if __name__ ==
"__main__":
97 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
98 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
99 from AthenaCommon.Logging
import log
105 flags = initConfigFlags()
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
115 acc = MainServicesCfg(flags)
117 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
118 acc.merge( TileRawDataReadingCfg(flags, readDigits=
False, readMuRcv=
False) )
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())
This class emulates the algorithms processed at the TileCal ROD DSP level to contribute to the LVL2 t...
TileRawChannelToL2OutputCfg(flags, streamName='RDO', **kwargs)
TileL2BuilderCfg(flags, **kwargs)
TileRawChannelToL2Cfg(flags, **kwargs)