3 """Define method to construct configured Tile raw channel maker algorithm"""
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.Enums
import ProductionStep
8 from TileConfiguration.TileConfigFlags
import TileRunType
11 """Return component accumulator with configured Tile raw channel maker algorithm
14 flags -- Athena configuration flags
19 from TileConditions.TileInfoLoaderConfig
import TileInfoLoaderCfg
22 kwargs.setdefault(
'name',
'TileRChMaker')
25 if flags.Common.ProductionStep
in [ProductionStep.PileUpPresampling, ProductionStep.PileUpPretracking]:
26 kwargs.setdefault(
'TileDigitsContainer', flags.Overlay.BkgPrefix +
'TileDigitsCnt')
28 kwargs.setdefault(
'TileDigitsContainer',
'TileDigitsCnt')
30 from AthenaCommon.Logging
import logging
31 mlog = logging.getLogger(
'TileRawChannelMakerCfg' )
33 if flags.Tile.doOverflowFit:
34 kwargs.setdefault(
'FitOverflow',
True)
35 from TileRecUtils.TileRawChannelBuilderFitConfig
import TileRawChannelBuilderFitOverflowCfg
37 kwargs.setdefault(
'TileRawChannelBuilderFitOverflow', tileRawChannelBuilderFitOverflow)
39 kwargs.setdefault(
'FitOverflow',
False)
41 tileRawChannelBuilder = []
44 from TileRecUtils.TileRawChannelBuilderFitConfig
import TileRawChannelBuilderFitFilterCfg
46 tileRawChannelBuilder += [tileRawChannelBuilderFitFilter]
47 mlog.info(
" adding now TileRawChannelBuilderFitFilter with name %s to the algorithm: %s",
48 tileRawChannelBuilderFitFilter.name, name)
51 from TileRecUtils.TileRawChannelBuilderMFConfig
import TileRawChannelBuilderMFCfg
53 tileRawChannelBuilder += [tileRawChannelBuilderMF]
54 mlog.info(
" adding now TileRawChannelBuilderMF with name %s to the algorithm: %s",
55 tileRawChannelBuilderMF.name, name)
58 from TileRecUtils.TileRawChannelBuilderOptConfig
import TileRawChannelBuilderOF1Cfg
60 tileRawChannelBuilder += [tileRawChannelBuilderOF1]
61 mlog.info(
" adding now TileRawChannelBuilderOpt2Filter with name %s to the algorithm: %s",
62 tileRawChannelBuilderOF1.name, name)
64 if flags.Tile.doWiener:
65 from TileRecUtils.TileRawChannelBuilderWienerConfig
import TileRawChannelBuilderWienerCfg
67 tileRawChannelBuilder += [tileRawChannelBuilderWiener]
68 mlog.info(
" adding now TileRawChannelBuilderWienerFilter with name %s to the algorithm: %s",
69 tileRawChannelBuilderWiener.name, name)
72 from TileRecUtils.TileRawChannelBuilderOptConfig
import TileRawChannelBuilderOpt2Cfg
74 tileRawChannelBuilder += [tileRawChannelBuilderOpt2]
75 mlog.info(
" adding now TileRawChannelBuilderOpt2Filter with name %s to the algorithm: %s",
76 tileRawChannelBuilderOpt2.name, name)
78 if flags.Tile.doOptATLAS:
79 from TileRecUtils.TileRawChannelBuilderOptConfig
import TileRawChannelBuilderOptATLASCfg
81 tileRawChannelBuilder += [tileRawChannelBuilderOptATLAS]
82 mlog.info(
" adding now TileRawChannelBuilderOpt2Filter with name %s to the algorithm: %s",
83 tileRawChannelBuilderOptATLAS.name, name)
85 kwargs.setdefault(
'TileRawChannelBuilder', tileRawChannelBuilder)
87 if flags.Common.isOverlay
and flags.Concurrency.NumThreads > 0:
88 kwargs.setdefault(
'Cardinality', flags.Concurrency.NumThreads)
90 TileRawChannelMaker=CompFactory.TileRawChannelMaker
97 """Return component accumulator with configured Tile raw channel maker algorithm for HS
100 flags -- Athena configuration flags
103 kwargs.setdefault(
'name',
'TileRChMaker_DigiHSTruth')
104 kwargs.setdefault(
'TileDigitsContainer',
'TileDigitsCnt_DigiHSTruth')
107 rawChannelMaker = acc.getPrimary()
109 rawChannelbuilders = rawChannelMaker.TileRawChannelBuilder
111 for rawChannelBuilder
in rawChannelbuilders:
112 rawChannelBuilder.TileRawChannelContainer = f
'{rawChannelBuilder.TileRawChannelContainer}_DigiHSTruth'
118 """Return component accumulator with configured Output stream for Tile raw channel maker algorithm
121 flags -- Athena configuration flags
122 tileRawChannelMaker -- Tile raw channel maker algorithm
123 streamName -- name of output stream.
127 rawChannelbuilders = tileRawChannelMaker.TileRawChannelBuilder
129 for rawChannelBuilder
in rawChannelbuilders:
130 outputItemList += [f
'TileRawChannelContainer#{rawChannelBuilder.TileRawChannelContainer}']
132 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
139 """Return component accumulator with configured Tile raw channel maker algorithm and Output stream
142 flags -- Athena configuration flags
143 streamName -- name of output stream. Defaults to ESD.
153 """Return component accumulator with configured Tile raw channel maker algorithm and Output stream
156 flags -- Athena configuration flags
157 streamName -- name of output stream. Defaults to ESD.
166 if __name__ ==
"__main__":
168 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
169 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
170 from AthenaCommon.Logging
import log
177 flags.Input.Files = defaultTestFiles.RAW_RUN2
178 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
179 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
180 flags.Tile.RunType = TileRunType.PHY
181 flags.Tile.doFit =
True
182 flags.Tile.doOF1 =
True
183 flags.Tile.doWiener =
True
184 flags.Tile.doOpt2 =
True
185 flags.Tile.doOptATLAS =
True
186 flags.Tile.correctTimeJumps =
True
187 flags.Tile.NoiseFilter = 1
188 flags.Output.ESDFileName =
"myESD.pool.root"
189 flags.Exec.MaxEvents=3
194 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
197 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
203 acc.printConfig(withDetails =
True, summariseProps =
True)
204 acc.store(
open(
'TileRawChannelMaker.pkl',
'wb') )
210 sys.exit(
not sc.isSuccess())