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.TileRawChannelBuilderOptConfig
import TileRawChannelBuilderOF1Cfg
53 tileRawChannelBuilder += [tileRawChannelBuilderOF1]
54 mlog.info(
" adding now TileRawChannelBuilderOpt2Filter with name %s to the algorithm: %s",
55 tileRawChannelBuilderOF1.name, name)
57 if flags.Tile.doWiener:
58 from TileRecUtils.TileRawChannelBuilderWienerConfig
import TileRawChannelBuilderWienerCfg
60 tileRawChannelBuilder += [tileRawChannelBuilderWiener]
61 mlog.info(
" adding now TileRawChannelBuilderWienerFilter with name %s to the algorithm: %s",
62 tileRawChannelBuilderWiener.name, name)
65 from TileRecUtils.TileRawChannelBuilderOptConfig
import TileRawChannelBuilderOpt2Cfg
67 tileRawChannelBuilder += [tileRawChannelBuilderOpt2]
68 mlog.info(
" adding now TileRawChannelBuilderOpt2Filter with name %s to the algorithm: %s",
69 tileRawChannelBuilderOpt2.name, name)
71 if flags.Tile.doOptATLAS:
72 from TileRecUtils.TileRawChannelBuilderOptConfig
import TileRawChannelBuilderOptATLASCfg
74 tileRawChannelBuilder += [tileRawChannelBuilderOptATLAS]
75 mlog.info(
" adding now TileRawChannelBuilderOpt2Filter with name %s to the algorithm: %s",
76 tileRawChannelBuilderOptATLAS.name, name)
78 kwargs.setdefault(
'TileRawChannelBuilder', tileRawChannelBuilder)
80 if flags.Common.isOverlay
and flags.Concurrency.NumThreads > 0:
81 kwargs.setdefault(
'Cardinality', flags.Concurrency.NumThreads)
83 TileRawChannelMaker=CompFactory.TileRawChannelMaker
90 """Return component accumulator with configured Tile raw channel maker algorithm for HS
93 flags -- Athena configuration flags
96 kwargs.setdefault(
'name',
'TileRChMaker_DigiHSTruth')
97 kwargs.setdefault(
'TileDigitsContainer',
'TileDigitsCnt_DigiHSTruth')
100 rawChannelMaker = acc.getPrimary()
102 rawChannelbuilders = rawChannelMaker.TileRawChannelBuilder
104 for rawChannelBuilder
in rawChannelbuilders:
105 rawChannelBuilder.TileRawChannelContainer = f
'{rawChannelBuilder.TileRawChannelContainer}_DigiHSTruth'
111 """Return component accumulator with configured Output stream for Tile raw channel maker algorithm
114 flags -- Athena configuration flags
115 tileRawChannelMaker -- Tile raw channel maker algorithm
116 streamName -- name of output stream.
120 rawChannelbuilders = tileRawChannelMaker.TileRawChannelBuilder
122 for rawChannelBuilder
in rawChannelbuilders:
123 outputItemList += [f
'TileRawChannelContainer#{rawChannelBuilder.TileRawChannelContainer}']
125 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
132 """Return component accumulator with configured Tile raw channel maker algorithm and Output stream
135 flags -- Athena configuration flags
136 streamName -- name of output stream. Defaults to ESD.
146 """Return component accumulator with configured Tile raw channel maker algorithm and Output stream
149 flags -- Athena configuration flags
150 streamName -- name of output stream. Defaults to ESD.
159 if __name__ ==
"__main__":
161 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
162 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
163 from AthenaCommon.Logging
import log
170 flags.Input.Files = defaultTestFiles.RAW_RUN2
171 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
172 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
173 flags.Tile.RunType = TileRunType.PHY
174 flags.Tile.doFit =
True
175 flags.Tile.doOF1 =
True
176 flags.Tile.doWiener =
True
177 flags.Tile.doOpt2 =
True
178 flags.Tile.doOptATLAS =
True
179 flags.Tile.correctTimeJumps =
True
180 flags.Tile.NoiseFilter = 1
181 flags.Output.ESDFileName =
"myESD.pool.root"
182 flags.Exec.MaxEvents=3
187 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
190 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
196 acc.printConfig(withDetails =
True, summariseProps =
True)
197 acc.store(
open(
'TileRawChannelMaker.pkl',
'wb') )
203 sys.exit(
not sc.isSuccess())