5 @file TileMuonFitMonitorAlgorithm.py
6 @brief Python configuration of TileMuonFitMonitorAlgorithm algorithm for the Run III
8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
13 ''' Function to configure TileMuonFitMonitorAlgorithm algorithm in the monitoring system.'''
22 from AthenaMonitoring
import AthMonitorCfgHelper
23 helper = AthMonitorCfgHelper(flags,
'TileMuonFitMonitoring')
26 TileMuonFitMonitorAlgorithm=CompFactory.TileMuonFitMonitorAlgorithm
27 tileMuonFitMonAlg = helper.addAlgorithm(TileMuonFitMonitorAlgorithm,
'TileMuonFitMonAlg')
29 tileMuonFitMonAlg.TriggerChain =
''
34 kwargs.setdefault(
'fillHistogramsForL1Triggers', [
'AnyPhysTrig',
'bit7_Calib'])
35 l1Triggers = kwargs[
'fillHistogramsForL1Triggers']
37 for k, v
in kwargs.items():
38 setattr(tileMuonFitMonAlg, k, v)
40 run =
str(flags.Input.RunNumbers[0])
43 executeTimeGroup = helper.addGroup(tileMuonFitMonAlg,
'TileMuonFitMonExecuteTime',
'Tile/')
44 executeTimeGroup.defineHistogram(
'TIME_execute', path =
'MuonFit', type=
'TH1F',
45 title =
'Time for execute TileMuonFitMonAlg algorithm;time [#mus]',
46 xbins = 100, xmin = 0, xmax = 10000)
49 from TileCalibBlobObjs.Classes
import TileCalibUtils
as Tile
50 from TileMonitoring.TileMonitoringCfgHelper
import addTile2DHistogramsArray
54 xvalue =
'zPosition', yvalue =
'xPosition',
55 title =
'Tile MuonFit position at y=0;z [mm];x [mm]', path =
'Tile/MuonFit',
56 xbins = 69, xmin = -6900, xmax = 6900., ybins = 44, ymin = -4400., ymax = 4400.,
57 type=
'TH2D', run = run, triggers = l1Triggers)
61 xvalue =
'zPosition', yvalue =
'theta', path =
'Tile/MuonFit',
62 title =
'Tile MuonFit vertical axis component;z [mm];sin(#theta)',
63 xbins = 49, xmin = -4900, xmax = 4900., ybins = 50, ymin = -0., ymax = 1.,
64 type=
'TH2D', run = run, triggers = l1Triggers)
66 from TileMonitoring.TileMonitoringCfgHelper
import addTile1DHistogramsArray
70 title =
'Number of Tile MuonFit reconstructed', path =
'Tile/MuonFit',
71 xbins = 10, xmin = -0.5, xmax = 9.5, type =
'TH1F', run = run,
72 triggers = l1Triggers, perPartition =
False)
76 title =
'Number of Tile cells per MuonFit track', path =
'Tile/MuonFit',
77 xbins = 10, xmin = -0.5, xmax = 9.5, type =
'TH1F', run = run,
78 triggers = l1Triggers, perPartition =
False)
82 title =
'Tile MuonFit total energy;Muon energy [MeV]', path =
'Tile/MuonFit',
83 xbins = 50, xmin = 0., xmax = 10000., type =
'TH1F', run = run,
84 triggers = l1Triggers, perPartition =
False)
88 title =
'Tile MuonFit time at y=0 plane;Muon time [ns]', path =
'Tile/MuonFit',
89 xbins = 49, xmin = -73.5, xmax = 73.5, type =
'TH1F', run = run,
90 triggers = l1Triggers, perPartition =
False)
94 title =
'Tile MuonFit total path length;Muon path length [mm]', path =
'Tile/MuonFit',
95 xbins = 50, xmin = 0., xmax = 10000., type =
'TH1F', run = run,
96 triggers = l1Triggers, perPartition =
False)
100 title =
'Tile MuonFit energy density;Muon energy loss [MeV/mm]', path =
'Tile/MuonFit',
101 xbins = 50, xmin = 0., xmax = 10., type =
'TH1F', run = run,
102 triggers = l1Triggers, perPartition =
False)
106 title =
'Tile MuonFit sinus of the angle in the x-y plane;sin(#phi)', path =
'Tile/MuonFit',
107 xbins = 100, xmin = -1., xmax = 1., type =
'TH1F', run = run,
108 triggers = l1Triggers, perPartition =
False)
112 title =
'Tile MuonFit sinus of the angle in the y-z plane;sin(#theta)', path =
'Tile/MuonFit',
113 xbins = 50, xmin = 0., xmax = 1., type =
'TH1F', run = run,
114 triggers = l1Triggers, perPartition =
False)
117 addTile1DHistogramsArray(helper, tileMuonFitMonAlg, name =
'TileMuonFitPositionTime', xvalue =
'zPosition', value =
'time',
118 title =
'Tile MuonFit average time vs z position at y=0 plane;z [mm]; t [ns]', path =
'Tile/MuonFit',
119 xbins = 79, xmin = -7900., xmax = 7900., type =
'TProfile', run = run,
120 triggers = l1Triggers, perPartition =
False)
122 from TileMonitoring.TileMonitoringCfgHelper
import getPartitionName
126 addTile1DHistogramsArray(helper, tileMuonFitMonAlg, name =
'TileMuonFitPartitionTime', xvalue =
'partition', value =
'time',
127 title =
'Tile MuonFit average time vs partition at y=0 plane;; t [ns]', path =
'Tile/MuonFit',
128 xbins = Tile.MAX_ROS - 1, xmin = -0.5, xmax = Tile.MAX_ROS - 1.5, xlabels = partitionLabels,
129 type =
'TProfile', run = run, triggers = l1Triggers, perPartition =
False)
132 accumalator = helper.result()
133 result.merge(accumalator)
136 if __name__==
'__main__':
139 from AthenaCommon.Logging
import log
144 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
145 from AthenaConfiguration.TestDefaults
import defaultTestFiles
147 flags.Input.Files = defaultTestFiles.ESD
148 flags.Output.HISTFileName =
'TileMuonFitMonitorOutput.root'
149 flags.DQ.useTrigger =
False
150 flags.DQ.enableLumiAccess =
False
151 flags.Exec.MaxEvents = 3
156 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
157 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
161 from TileCosmicAlgs.TileMuonFitterConfig
import TileMuonFitterCfg
164 l1Triggers = [
'bit0_RNDM',
'bit1_ZeroBias',
'bit2_L1Cal',
'bit3_Muon',
165 'bit4_RPC',
'bit5_FTK',
'bit6_CTP',
'bit7_Calib',
'AnyPhysTrig']
168 fillHistogramsForL1Triggers = l1Triggers) )
170 cfg.printConfig(withDetails =
True, summariseProps =
True)
173 cfg.store(
open(
'TileMuonFitMonitorAlgorithm.pkl',
'wb') )
179 sys.exit(
not sc.isSuccess())