5 @file TileTowerMonitorAlgorithm.py
6 @brief Python configuration of TileTowerMonitorAlgorithm algorithm for the Run III
8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
13 ''' Function to configure TileTowerMonitorAlgorithm algorithm in the monitoring system.'''
20 from TileMonitoring.TileTowerBuilderConfig
import TileTowerBuilderAlgCfg
25 from AthenaMonitoring
import AthMonitorCfgHelper
26 helper = AthMonitorCfgHelper(flags,
'TileTowerMonitoring')
29 TileTowerMonitorAlgorithm=CompFactory.TileTowerMonitorAlgorithm
30 tileTowerMonAlg = helper.addAlgorithm(TileTowerMonitorAlgorithm,
'TileTowerMonAlg')
32 tileTowerMonAlg.TriggerChain =
''
37 kwargs.setdefault(
'fillHistogramsForL1Triggers', [
'AnyPhysTrig',
'bit7_Calib'])
38 l1Triggers = kwargs[
'fillHistogramsForL1Triggers']
40 for k, v
in kwargs.items():
41 setattr(tileTowerMonAlg, k, v)
43 run =
str(flags.Input.RunNumbers[0])
46 executeTimeGroup = helper.addGroup(tileTowerMonAlg,
'TileTowerMonExecuteTime',
'Tile/')
47 executeTimeGroup.defineHistogram(
'TIME_execute', path =
'Tower', type=
'TH1F',
48 title =
'Time for execute TileTowerMonAlg algorithm;time [#mus]',
49 xbins = 100, xmin = 0, xmax = 100000)
52 from TileCalibBlobObjs.Classes
import TileCalibUtils
as Tile
53 from TileMonitoring.TileMonitoringCfgHelper
import addTileEtaPhiMapsArray
57 title =
'Most energetic Tile Tower position', path =
'Tile/Tower',
58 run = run, triggers = l1Triggers, perSample =
False)
62 title =
'Position correlation of Tile Tower opposite to most energetic tower',
63 path =
'Tile/Tower', run = run, triggers = l1Triggers, perSample =
False,
64 etaTitle =
'#Delta #eta', etabins = 41, etamin = -2.05, etamax = 2.05,
65 phiTitle =
'#Delta #phi', phibins = Tile.MAX_DRAWER + 1, phimin = -0.05, phimax = 6.45)
68 from TileMonitoring.TileMonitoringCfgHelper
import addTile1DHistogramsArray
72 title =
'E_{T} [MeV] in most energetic Tile Tower', path =
'Tile/Tower',
73 xbins = 80, xmin = 0., xmax = 20000., type =
'TH1D', run = run,
74 triggers = l1Triggers, perPartition =
True, perSample =
False,
75 perGain =
False, subDirectory =
True, allPartitions =
True)
79 title =
'All Tile Towers Energy [MeV]', path =
'Tile/Tower',
80 xbins = 80, xmin = 0., xmax = 20000., type =
'TH1D', run = run,
81 triggers = l1Triggers, perPartition =
True, perSample =
False,
82 perGain =
False, subDirectory =
True, allPartitions =
True)
85 accumalator = helper.result()
86 result.merge(accumalator)
89 if __name__==
'__main__':
92 from AthenaCommon.Logging
import log
97 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
98 from AthenaConfiguration.TestDefaults
import defaultTestFiles
100 flags.Input.Files = defaultTestFiles.ESD
101 flags.Output.HISTFileName =
'TileTowerMonitorOutput.root'
102 flags.DQ.useTrigger =
False
103 flags.DQ.enableLumiAccess =
False
104 flags.Exec.MaxEvents = 3
109 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
110 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
114 l1Triggers = [
'bit0_RNDM',
'bit1_ZeroBias',
'bit2_L1Cal',
'bit3_Muon',
115 'bit4_RPC',
'bit5_FTK',
'bit6_CTP',
'bit7_Calib',
'AnyPhysTrig']
118 fillHistogramsForL1Triggers = l1Triggers) )
120 cfg.printConfig(withDetails =
True, summariseProps =
True)
123 cfg.store(
open(
'TileTowerMonitorAlgorithm.pkl',
'wb') )
129 sys.exit(
not sc.isSuccess())