34 """Return component accumulator with configured Tile Cell maker algorithm
37 flags -- Athena configuration flags
38 name -- name of Tile cell maker algorithm. Defautls to TileCellMaker
39 or TileCellMakerHG/TileCellMakerLG depending on only used gain.
40 SkipGain - skip given gain. Defaults to -1 [use all gains]. Possible values: 0 [LG], 1 [HG].
41 CaloCellsOutputName -- name of the output calo cell container. Defautls to AllCalo
42 or AllCaloHG/AllCaloLG depending on only used gain.
43 DoCaloNeighborsCorrection -- correct dead cells. Assign as energy the average energy of
44 the surrounding cells. Defaults to False.
45 mergeChannels -- merge DSP results with offline reco results. Defaults to True.
50 useGain = {0 :
'HG', 1 :
'LG'}
52 skipGain = kwargs.get(
'SkipGain', -1)
54 defaultName =
'TileCellMaker' if skipGain == -1
else 'TileCellMaker' + useGain[skipGain]
55 name = kwargs.get(
'name', defaultName)
57 defaultOutputCells =
'AllCalo' if skipGain == -1
else 'AllCalo' + useGain[skipGain]
58 caloCellsOutputName = kwargs.get(
'CaloCellsOutputName', defaultOutputCells)
60 doCaloNeighborsCorrection = kwargs.get(
'DoCaloNeighborsCorrection',
False)
62 from AthenaCommon.Logging
import logging
63 msg = logging.getLogger(
'TileCellMakerCfg' )
65 CaloCellMaker, CaloCellContainerFinalizerTool=CompFactory.getComps(
"CaloCellMaker",
"CaloCellContainerFinalizerTool",)
66 from TileRecUtils.TileCellBuilderConfig
import TileCellBuilderCfg
67 tileCellBuilder = acc.popToolsAndMerge(
TileCellBuilderCfg(flags, SkipGain=skipGain, mergeChannels=mergeChannels) )
71 noiseFilter = flags.Tile.NoiseFilter
73 doCellNoiseFilter = noiseFilter - noiseFilter % 100
74 doRawChannelNoiseFilter = noiseFilter - doCellNoiseFilter - noiseFilter % 10
76 if doRawChannelNoiseFilter == 10:
77 msg.info(
'Use Tile raw channel noise filter')
78 from TileRecUtils.TileRawChannelCorrectionConfig
import TileRawChannelNoiseFilterCfg
80 tileCellBuilder.NoiseFilterTools = [noiseFilter]
82 if doCellNoiseFilter == 100:
83 msg.info(
'Use Tile cell noise filter')
84 from TileRecUtils.TileCellNoiseFilterConfig
import TileCellNoiseFilterCfg
86 cellMakerTools += [ cellNoiseFilter ]
88 if doCaloNeighborsCorrection:
89 msg.info(
'Use Calo cell neighbours average correction')
91 cellMakerTools += [caloCellNeighborsAverageCorrection]
93 if flags.Beam.Type
is not BeamType.TestBeam:
95 cellMakerTools += [caloCellContainerChecker]
97 cellMakerAlg =
CaloCellMaker(name = name, CaloCellMakerToolNames = cellMakerTools,
98 CaloCellsOutputName = caloCellsOutputName)
100 acc.addEventAlgo(cellMakerAlg, primary =
True)