11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 acc = ComponentAccumulator()
14 from TileConditions.TileInfoLoaderConfig
import TileInfoLoaderCfg
15 acc.merge( TileInfoLoaderCfg(flags) )
17 kwargs.setdefault(
'name',
'TileMuRcvRChMaker')
18 kwargs.setdefault(
'TileDigitsContainer',
'MuRcvDigitsCnt')
20 if 'TileRawChannelBuilder' not in kwargs:
22 from TileConditions.TilePulseShapeConfig
import TileCondToolMuRcvPulseShapeCfg
23 pulseShapeTool = acc.popToolsAndMerge( TileCondToolMuRcvPulseShapeCfg(flags) )
25 from TileConditions.TileOFCConfig
import TileCondToolOfcCfg
26 ofcTool = acc.popToolsAndMerge( TileCondToolOfcCfg(flags,
27 OptFilterDeltaCorrelation =
True,
28 TileCondToolPulseShape = pulseShapeTool) )
30 from TileRecUtils.TileRawChannelBuilderOptConfig
import TileRawChannelBuilderOpt2FilterCfg
31 rawChanBuilder = acc.popToolsAndMerge( TileRawChannelBuilderOpt2FilterCfg(flags,
35 NoiseFilterTools = [],
36 TileCondToolOfc = ofcTool,
37 TileRawChannelContainer = MuRcvRawChCnt) )
40 kwargs.setdefault(
'TileRawChannelBuilder', [rawChanBuilder])
42 from AthenaConfiguration.ComponentFactory
import CompFactory
43 TileRawChannelMaker=CompFactory.TileRawChannelMaker
50 '''Function to configure Tile TMDB raw channel monitoring algorithm.'''
51 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
52 result = ComponentAccumulator()
54 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
55 result.merge( TileCablingSvcCfg(flags) )
57 from AthenaConfiguration.Enums
import Format
58 if flags.Input.Format == Format.BS:
59 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
60 result.merge(TileRawDataReadingCfg(flags, readDigits=
False, readRawChannel=
False,
61 readMuRcv=
True, readMuRcvDigits=
True, readMuRcvRawCh=
True))
63 isDSP = (MuRcvRawChCnt ==
"MuRcvRawChCnt")
67 name = kwargs.get(
'name',
'TileTMDBRawChanDspMonAlg' if isDSP
else 'TileTMDBRawChanMonAlg')
69 from AthenaMonitoring
import AthMonitorCfgHelper
70 helper = AthMonitorCfgHelper(flags,
'TileTMDBRawChannelDspMonitoring' if isDSP
else 'TileTMDBRawChannelMonitoring')
72 from AthenaConfiguration.ComponentFactory
import CompFactory
73 tileTMDBRawChanMonAlg = helper.addAlgorithm(CompFactory.TileTMDBRawChannelMonitorAlgorithm, name)
74 tileTMDBRawChanMonAlg.TriggerChain =
''
75 tileTMDBRawChanMonAlg.MuRcvRawChCnt = MuRcvRawChCnt
76 tileTMDBRawChanMonAlg.DSP = isDSP
77 tileTMDBRawChanMonAlg.FillEfficiencyHistograms = FillEfficiencyHistograms
78 tileTMDBRawChanMonAlg.FillRawChannelHistograms = FillRawChannelHistograms
80 topPath =
'Tile/TMDBRawChannel/DSP' if isDSP
else 'Tile/TMDBRawChannel'
81 run = str(flags.Input.RunNumbers[0])
83 if FillRawChannelHistograms:
92 from TileMonitoring.TileMonitoringCfgHelper
import addTileTMDB_1DHistogramsArray, addTileTMDB_2DHistogramsArray
94 addTileTMDB_2DHistogramsArray(helper, tileTMDBRawChanMonAlg, name =
'TMDB_RawAmplitude',
95 value =
'amplitude', title =
'Amplitude Map',
96 path = topPath, type=
'TProfile2D', run = run)
98 addTileTMDB_2DHistogramsArray(helper, tileTMDBRawChanMonAlg, name =
'TMDB_RawTime',
99 value =
'time', title =
'Time Map',
100 path = topPath, type=
'TProfile2D', run = run)
102 addTileTMDB_1DHistogramsArray(helper, tileTMDBRawChanMonAlg, name =
'TMDB_RawCellTime',
103 xvalue =
'time', title =
'Time;[ns]',
104 path = topPath, type=
'TH1D', run = run,
105 xbins = 120, xmin = -60, xmax = 60)
107 addTileTMDB_1DHistogramsArray(helper, tileTMDBRawChanMonAlg, name =
'TMDB_RawCellAmplitude',
108 xvalue =
'amplitude', title =
'Amplitude;[ADC]',
109 path = topPath, type=
'TH1D', run = run,
110 xbins = 276, xmin = minAmplitude, xmax = maxAmplitude)
113 if FillEfficiencyHistograms:
115 from TileConditions.TileTMDBConfig
import TileTMDBCondAlgCfg
116 result.merge( TileTMDBCondAlgCfg(flags) )
118 from TileCalibBlobObjs.Classes
import TileCalibUtils
as Tile
119 from TileMonitoring.TileMonitoringCfgHelper
import getLabels, getPartitionName
121 arrayTGC = helper.addArray([2], tileTMDBRawChanMonAlg,
'TGC_TrSec_number_Good_Muons')
122 for postfix, tool
in arrayTGC.Tools.items():
123 ros = int(postfix.split(
'_').pop()) + 3
124 partition = getPartitionName(ros)
126 fullName =
'sector;TGC_TrSec_number_Good_Muons_{}'.format(partition)
127 fullTitle =
'Number of Good Muons in TGC trigger sectors {}'.format(partition)
129 tool.defineHistogram(fullName, path = topPath, type =
'TH1D', title = fullTitle,
130 xbins = 48, xmin = -0.5, xmax = 47.5)
133 cells = [
'D6',
'D5+D6']
134 thresholds = [
'500MeV',
'600MeV']
135 tileTMDBRawChanMonAlg.NumberOfThresholds = len(thresholds)
136 arrayThreshD = helper.addArray([2, len(thresholds), len(cells)], tileTMDBRawChanMonAlg,
'TMDB_coincidence_threshold')
137 for postfix, tool
in arrayThreshD.Tools.items():
138 elements = postfix.split(
'_')
139 cell = int(elements.pop())
140 threshold = int(elements.pop())
141 ros = int(elements.pop()) + 3
142 partition = getPartitionName(ros)
144 labels = getLabels((
'modules'), partition)
146 fullName =
'module;TMDB_{}_{}_coincidence_{}'.format(partition, cells[cell], thresholds[threshold])
147 fullTitle =
'Number coincidence from all Good Muons in TMDB {} {} over {} threshold'.format(partition, cells[cell], thresholds[threshold])
149 tool.defineHistogram(fullName, path = topPath, type =
'TH1D', title = fullTitle, xlabels = labels,
150 xbins = Tile.MAX_DRAWER, xmin = -0.5, xmax = Tile.MAX_DRAWER - 0.5)
153 accumalator = helper.result()
154 result.merge(accumalator)