6 @file TileTestBeamRecoConfig.py
9 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
10 from AthenaConfiguration.ComponentFactory
import CompFactory
17 ''' Function to configure reconstruction of Tile raw channels from digits.'''
21 suffix =
"Flx" if useFELIX
else ""
22 kwargs.setdefault(
'name', f
'TileRCh{suffix}Maker')
23 kwargs.setdefault(
'TileDigitsContainer', f
'TileDigits{suffix}Cnt')
24 kwargs.setdefault(
'Cardinality', flags.Concurrency.NumThreads)
25 kwargs.setdefault(
'TileInfoName', f
'TileInfo{suffix}')
27 from TileRecUtils.TileRawChannelMakerConfig
import TileRawChannelMakerCfg
30 rawChannelBuilderFitFilter = rawChMaker.TileRawChannelBuilder[
'TileRawChannelBuilderFitFilter']
31 rawChannelBuilderFitFilter.FrameLength = nsamples
32 rawChannelBuilderFitFilter.SaturatedSample = 4095
if useFELIX
else -1
33 for tool
in rawChMaker.TileRawChannelBuilder:
34 tool.TileRawChannelContainer =
str(tool.TileRawChannelContainer).
replace(
'TileRawChannel', f
'TileRawChannel{suffix}')
35 tool.TileInfoName = f
'TileInfo{suffix}'
38 from TileConditions.TileInfoLoaderConfig
import TileInfoLoaderCfg
39 acc.merge(
TileInfoLoaderCfg(flags, name=f
'TileInfoLoader{suffix}', TileInfo=f
'TileInfo{suffix}',
40 NSamples=nsamples, TrigSample=((nsamples-1)//2) ))
45 def TileTestBeamRecoCfg(flags, useDemoCabling, nsamples, useFELIX=False, filterDigits=False, filterChannels=True):
47 ''' Function to configure reconstruction of Tile TestBeam data.'''
51 suffix =
"Flx" if useFELIX
else ""
52 digitsContainer = f
'TileDigits{suffix}Cnt'
53 rawChannelContainer = flags.Tile.RawChannelContainer.replace(
'TileRawChannel', f
'TileRawChannel{suffix}')
56 if useFELIX
and filterDigits:
57 digitsContainer =
'TileDigitsFlxFiltered'
58 TileDigitsGainFilter = CompFactory.TileDigitsGainFilter
60 InputDigitsContainer=
'TileDigitsFlxCnt',
61 OutputDigitsContainer=digitsContainer) )
66 if useFELIX
and filterChannels:
67 rawChannelContainerFiltered = f
'{rawChannelContainer}Filtered'
68 TileRawChannelGainFilter = CompFactory.TileRawChannelGainFilter
70 OutputRawChannelContainer=rawChannelContainerFiltered) )
71 rawChannelContainer = rawChannelContainerFiltered
74 from TileRecUtils.TileCellMakerConfig
import TileCellMakerCfg
75 skipGains = [0, 1]
if flags.Tile.RunType.isBiGain()
else [-1]
76 gainName = {-1 :
"", 0 :
"HG", 1 :
"LG"}
77 for skipGain
in skipGains:
78 cellMaker = acc.getPrimaryAndMerge(
TileCellMakerCfg(flags, name=f
'TileCell{suffix}Maker{gainName[skipGain]}',
79 CaloCellsOutputName=f
'AllCalo{suffix}{gainName[skipGain]}',
80 mergeChannels=
False, SkipGain=skipGain))
81 cellBuilder = cellMaker.CaloCellMakerToolNames[
'TileCellBuilder']
82 cellBuilder.TileRawChannelContainer = rawChannelContainer
83 cellBuilder.UseDemoCabling = useDemoCabling
84 cellBuilder.maskBadChannels =
False
85 cellBuilder.MBTSContainer =
""
86 cellBuilder.E4prContainer =
""
90 ADCmax = 4095
if useFELIX
else 1023
91 ADCmaskValue = 4800
if useFELIX
else 2047
92 from TileConditions.TileInfoLoaderConfig
import TileInfoLoaderCfg
93 acc.merge(
TileInfoLoaderCfg(flags, name=f
'TileInfoLoader{suffix}', TileInfo=f
'TileInfo{suffix}',
94 NSamples=nsamples, TrigSample=((nsamples-1)//2),
95 ADCmax=ADCmax, ADCmaskValue=ADCmaskValue))
100 if __name__ ==
'__main__':
103 from AthenaCommon.Logging
import log
108 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
109 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
112 parser = flags.getArgumentParser()
113 parser.add_argument(
'--demo-cabling', dest=
'demoCabling', type=int, default=2018, help=
'Time Demonatrator cabling to be used')
114 parser.add_argument(
'--nsamples', type=int, default=15, help=
'Number of samples')
115 args, _ = parser.parse_known_args()
117 flags.Exec.MaxEvents = 3
118 flags.Common.isOnline =
True
119 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
120 flags.Input.Files = defaultTestFiles.RAW_RUN3
121 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA
123 flags.Tile.doFit =
True
124 flags.Tile.useDCS =
False
125 flags.Tile.NoiseFilter = 0
126 flags.Tile.correctTime =
False
127 flags.Tile.correctTimeJumps =
False
128 flags.Tile.BestPhaseFromCOOL =
False
129 flags.Tile.doOverflowFit =
False
131 flags.fillFromArgs(parser=parser)
136 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
139 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
150 cfg.getCondAlgo(
'TileHid2RESrcIDCondAlg').RODStatusProxy =
None
152 cfg.printConfig(withDetails=
True, summariseProps=
True, printDefaults=
True)
156 sys.exit(
not sc.isSuccess())