ATLAS Offline Software
Loading...
Searching...
No Matches
TileTMDBDigitsMonitorAlgorithm.py
Go to the documentation of this file.
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4'''@file TileTMDBDigitsMonitorAlgorithm.py
5@author
6@date
7@brief Python configuration of TileTMDBDigitsMonitorAlgorithm algorithm for the Run III
8'''
9
11 '''Function to configures some algorithms in the monitoring system.'''
12 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13 result = ComponentAccumulator()
14
15 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
16 result.merge( TileCablingSvcCfg(flags) )
17
18 from AthenaMonitoring import AthMonitorCfgHelper
19 helper = AthMonitorCfgHelper(flags, 'TileTMDBDigitsMonitoring')
20
21
22 from AthenaConfiguration.ComponentFactory import CompFactory
23 tileTMDBDigitsMonAlg = helper.addAlgorithm(CompFactory.TileTMDBDigitsMonitorAlgorithm, 'TileTMDBDigitsMonAlg')
24
25 tileTMDBDigitsMonAlg.TriggerChain = ''
26
27
28 run = str(flags.Input.RunNumbers[0])
29 from TileMonitoring.TileMonitoringCfgHelper import addTileTMDB_1DHistogramsArray, addTileTMDB_2DHistogramsArray
30
31
32
33
34 addTileTMDB_2DHistogramsArray(helper, tileTMDBDigitsMonAlg, name = 'TMDB_DigitsPedestal',
35 value = 'pedestal', title = 'Mean pedestal (sample[0])',
36 path = 'Tile/TMDBDigits', type='TProfile2D', run = run)
37
38 addTileTMDB_2DHistogramsArray(helper, tileTMDBDigitsMonAlg, name = 'TMDB_DigitsAmplitude',
39 value = 'amplitude', title = 'Difference between maximum and minimum sample',
40 path = 'Tile/TMDBDigits', type='TProfile2D', run = run)
41
42 addTileTMDB_2DHistogramsArray(helper, tileTMDBDigitsMonAlg, name = 'TMDB_DigitsHFN',
43 value = 'HFN', title = 'Mean RMS of 7 samples (HFN)',
44 path = 'Tile/TMDBDigits', type='TProfile2D', run = run)
45
46
47 addTileTMDB_1DHistogramsArray(helper, tileTMDBDigitsMonAlg, name = 'TMDB_DigitsCellPedestal',
48 xvalue = 'pedestal', title = 'Pedestal (sample[0]);[ADC]',
49 path = 'Tile/TMDBDigits', type='TH1D', run = run,
50 xbins = 101, xmin = -0.5, xmax = 100.5)
51
52 addTileTMDB_1DHistogramsArray(helper, tileTMDBDigitsMonAlg, name = 'TMDB_DigitsCellHFN',
53 xvalue = 'HFN', title = 'Mean RMS (HFN);[ADC]',
54 path = 'Tile/TMDBDigits', type='TH1D', run = run,
55 xbins = 41, xmin = -0.5, xmax = 40.5)
56
57 addTileTMDB_1DHistogramsArray(helper, tileTMDBDigitsMonAlg, name = 'TMDB_DigitsCellAmplitude',
58 xvalue = 'amplitude', title = 'Difference between maximum and minimum sample;[ADC]',
59 path = 'Tile/TMDBDigits', type='TH1D', run = run,
60 xbins = 101, xmin = -0.5, xmax = 100.5)
61
62
63 accumalator = helper.result()
64 result.merge(accumalator)
65 return result
66
67
68
69if __name__=='__main__':
70 # Setup logs
71 from AthenaCommon.Logging import log
72 from AthenaCommon.Constants import INFO
73 log.setLevel(INFO)
74
75 # Set the Athena configuration flags
76 from AthenaConfiguration.AllConfigFlags import initConfigFlags
77 from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultTestFiles
78 flags = initConfigFlags()
79 flags.Input.Files = defaultTestFiles.RAW_RUN2
80 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
81 flags.Output.HISTFileName = 'TileTMDBDigitsMonitorOutput.root'
82 flags.DQ.useTrigger = False
83 flags.DQ.enableLumiAccess = False
84 flags.Exec.MaxEvents = 3
85 flags.fillFromArgs()
86 flags.lock()
87
88 # Initialize configuration object, add accumulator, merge, and run.
89 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
90 cfg = MainServicesCfg(flags)
91
92 from TileByteStream.TileByteStreamConfig import TileRawDataReadingCfg
93 cfg.merge( TileRawDataReadingCfg(flags, readDigits=False, readRawChannel=False,
94 readMuRcv=False, readMuRcvDigits=True) )
95
96 tileTMDBDigitsMonitorAccumulator = TileTMDBDigitsMonitoringConfig(flags)
97
98 cfg.merge(tileTMDBDigitsMonitorAccumulator)
99
100 cfg.printConfig(withDetails = True, summariseProps = True)
101 flags.dump()
102
103
104 cfg.store( open('TileTMDBDigitsMonitorAlgorithm.pkl','wb') )
105
106 sc = cfg.run()
107
108 import sys
109 sys.exit(not sc.isSuccess())