33 """Return component accumulator with configured Tile Cell maker algorithm
36 flags -- Athena configuration flags
37 name -- name of Tile cell maker algorithm. Defautls to TileCellMaker
38 or TileCellMakerHG/TileCellMakerLG depending on only used gain.
39 SkipGain - skip given gain. Defaults to -1 [use all gains]. Possible values: 0 [LG], 1 [HG].
40 CaloCellsOutputName -- name of the output calo cell container. Defautls to AllCalo
41 or AllCaloHG/AllCaloLG depending on only used gain.
42 DoCaloNeighborsCorrection -- correct dead cells. Assign as energy the average energy of
43 the surrounding cells. Defaults to False.
44 mergeChannels -- merge DSP results with offline reco results. Defaults to True.
49 useGain = {0 :
'HG', 1 :
'LG'}
51 skipGain = kwargs.get(
'SkipGain', -1)
53 defaultName =
'TileCellMaker' if skipGain == -1
else 'TileCellMaker' + useGain[skipGain]
54 name = kwargs.get(
'name', defaultName)
56 defaultOutputCells =
'AllCalo' if skipGain == -1
else 'AllCalo' + useGain[skipGain]
57 caloCellsOutputName = kwargs.get(
'CaloCellsOutputName', defaultOutputCells)
59 doCaloNeighborsCorrection = kwargs.get(
'DoCaloNeighborsCorrection',
False)
61 from AthenaCommon.Logging
import logging
62 msg = logging.getLogger(
'TileCellMakerCfg' )
64 CaloCellMaker, CaloCellContainerFinalizerTool=CompFactory.getComps(
"CaloCellMaker",
"CaloCellContainerFinalizerTool",)
65 from TileRecUtils.TileCellBuilderConfig
import TileCellBuilderCfg
66 tileCellBuilder = acc.popToolsAndMerge(
TileCellBuilderCfg(flags, SkipGain=skipGain, mergeChannels=mergeChannels) )
70 noiseFilter = flags.Tile.NoiseFilter
72 doCellNoiseFilter = noiseFilter - noiseFilter % 100
73 doRawChannelNoiseFilter = noiseFilter - doCellNoiseFilter - noiseFilter % 10
75 if doRawChannelNoiseFilter == 10:
76 msg.info(
'Use Tile raw channel noise filter')
77 from TileRecUtils.TileRawChannelCorrectionConfig
import TileRawChannelNoiseFilterCfg
79 tileCellBuilder.NoiseFilterTools = [noiseFilter]
81 if doCellNoiseFilter == 100:
82 msg.info(
'Use Tile cell noise filter')
83 from TileRecUtils.TileCellNoiseFilterConfig
import TileCellNoiseFilterCfg
85 cellMakerTools += [ cellNoiseFilter ]
87 if doCaloNeighborsCorrection:
88 msg.info(
'Use Calo cell neighbours average correction')
90 cellMakerTools += [caloCellNeighborsAverageCorrection]
94 cellMakerTools += [caloCellContainerChecker]
96 cellMakerAlg =
CaloCellMaker(name = name, CaloCellMakerToolNames = cellMakerTools,
97 CaloCellsOutputName = caloCellsOutputName)
99 acc.addEventAlgo(cellMakerAlg, primary =
True)