ATLAS Offline Software
TileMonitoringConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 '''
6 @file TileMonitoringConfig.py
7 @brief Python configuration of Tile Monitoring for the Run III
8 '''
9 
10 def TileMonitoringCfg(flags):
11  ''' Function to configure Tile Monitoring in the monitoring system for Run III.'''
12 
13  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
14  acc = ComponentAccumulator()
15 
16  from AthenaCommon.Logging import logging
17  msg = logging.getLogger( 'TileMonitoringCfg' )
18 
19  environment = flags.DQ.Environment
20 
21  if environment in ('online', 'tier0', 'tier0Raw'):
22  msg.info('Setup Tile Monitoring for RAW data due to environment: %s', environment)
23 
24  from TileMonitoring.TileDQFragMonitorAlgorithm import TileDQFragMonitoringConfig
25  acc.merge( TileDQFragMonitoringConfig(flags) )
26 
27  from TileMonitoring.TileMBTSMonitorAlgorithm import TileMBTSMonitoringConfig
28  acc.merge( TileMBTSMonitoringConfig(flags) )
29 
30  from TileMonitoring.TileDigiNoiseMonitorAlgorithm import TileDigiNoiseMonitoringConfig
31  acc.merge( TileDigiNoiseMonitoringConfig(flags) )
32 
33  if environment in ('online', 'tier0', 'tier0ESD'):
34  msg.info('Setup Tile Monitoring for ESD data due to environment: %s', environment)
35 
36  from TileMonitoring.TileCellMonitorAlgorithm import TileCellMonitoringConfig
37  acc.merge( TileCellMonitoringConfig(flags) )
38 
39  from TileMonitoring.TileTowerMonitorAlgorithm import TileTowerMonitoringConfig
40  acc.merge( TileTowerMonitoringConfig(flags) )
41 
42  from TileMonitoring.TileClusterMonitorAlgorithm import TileClusterMonitoringConfig
43  acc.merge( TileClusterMonitoringConfig(flags) )
44 
45  from TileMonitoring.TileMuIdMonitorAlgorithm import TileMuIdMonitoringConfig
46  acc.merge( TileMuIdMonitoringConfig(flags) )
47 
48  from TileMonitoring.TileJetMonitorAlgorithm import TileJetMonitoringConfig
49  acc.merge( TileJetMonitoringConfig(flags) )
50 
51  if flags.IOVDb.DatabaseInstance == 'CONDBR2' and flags.DQ.triggerDataAvailable:
52  from TileMonitoring.TileTMDBRawChannelMonitorAlgorithm import TileTMDBRawChannelMonitoringConfig
53  acc.merge( TileTMDBRawChannelMonitoringConfig(flags, FillRawChannelHistograms = False, FillEfficiencyHistograms = True) )
54 
55  from AthenaConfiguration.Enums import BeamType
56  if flags.Beam.Type in [BeamType.Cosmics, BeamType.SingleBeam]:
57  from TileCosmicAlgs.TileMuonFitterConfig import TileMuonFitterCfg
58  acc.merge(TileMuonFitterCfg(flags))
59 
60  from TileMonitoring.TileMuonFitMonitorAlgorithm import TileMuonFitMonitoringConfig
61  acc.merge( TileMuonFitMonitoringConfig(flags) )
62 
63  return acc
64 
65 
66 
67 if __name__=='__main__':
68 
69  from AthenaConfiguration.AllConfigFlags import initConfigFlags
70  from AthenaCommon.Logging import log
71  from AthenaCommon.Constants import INFO
72  log.setLevel(INFO)
73 
74  flags = initConfigFlags()
75  flags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q431/22.0/v1/myESD.pool.root']
76  flags.Output.HISTFileName = 'TileMonitoringOutput.root'
77  flags.DQ.enableLumiAccess = False
78  flags.DQ.useTrigger = False
79  flags.DQ.Environment = 'tier0'
80  flags.Exec.MaxEvents = 3
81  flags.fillFromArgs()
82  flags.lock()
83 
84  # Initialize configuration object, add accumulator, merge, and run.
85  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
86  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
87  acc = MainServicesCfg(flags)
88  acc.merge(PoolReadCfg(flags))
89 
90  acc.merge( TileMonitoringCfg(flags) )
91 
92  acc.printConfig(withDetails = True, summariseProps = True)
93  flags.dump()
94  acc.store(open("TileMonitoring.pkl","wb"))
95 
96  sc = acc.run()
97  import sys
98  # Success should be 0
99  sys.exit(not sc.isSuccess())
TileTMDBRawChannelMonitorAlgorithm.TileTMDBRawChannelMonitoringConfig
def TileTMDBRawChannelMonitoringConfig(flags, MuRcvRawChCnt="MuRcvRawChCnt", FillRawChannelHistograms=True, FillEfficiencyHistograms=False, **kwargs)
Definition: TileTMDBRawChannelMonitorAlgorithm.py:48
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TileJetMonitorAlgorithm.TileJetMonitoringConfig
def TileJetMonitoringConfig(flags, **kwargs)
Definition: TileJetMonitorAlgorithm.py:11
TileMuIdMonitorAlgorithm.TileMuIdMonitoringConfig
def TileMuIdMonitoringConfig(flags, **kwargs)
Definition: TileMuIdMonitorAlgorithm.py:8
TileMuonFitMonitorAlgorithm.TileMuonFitMonitoringConfig
def TileMuonFitMonitoringConfig(flags, **kwargs)
Definition: TileMuonFitMonitorAlgorithm.py:11
TileTowerMonitorAlgorithm.TileTowerMonitoringConfig
def TileTowerMonitoringConfig(flags, **kwargs)
Definition: TileTowerMonitorAlgorithm.py:11
TileClusterMonitorAlgorithm.TileClusterMonitoringConfig
def TileClusterMonitoringConfig(flags, **kwargs)
Definition: TileClusterMonitorAlgorithm.py:8
TileMBTSMonitorAlgorithm.TileMBTSMonitoringConfig
def TileMBTSMonitoringConfig(flags, **kwargs)
Definition: TileMBTSMonitorAlgorithm.py:10
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
TileCellMonitorAlgorithm.TileCellMonitoringConfig
def TileCellMonitoringConfig(flags, **kwargs)
Definition: TileCellMonitorAlgorithm.py:8
Constants
some useful constants -------------------------------------------------—
Trk::open
@ open
Definition: BinningType.h:40
TileMonitoringConfig.TileMonitoringCfg
def TileMonitoringCfg(flags)
Definition: TileMonitoringConfig.py:10
TileDigiNoiseMonitorAlgorithm.TileDigiNoiseMonitoringConfig
def TileDigiNoiseMonitoringConfig(flags, **kwargs)
Definition: TileDigiNoiseMonitorAlgorithm.py:8
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TileDQFragMonitorAlgorithm.TileDQFragMonitoringConfig
def TileDQFragMonitoringConfig(flags, **kwargs)
Definition: TileDQFragMonitorAlgorithm.py:10
TileMuonFitterConfig.TileMuonFitterCfg
def TileMuonFitterCfg(flags, **kwargs)
Definition: TileMuonFitterConfig.py:12
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69