ATLAS Offline Software
CaloMonitoringConfig.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 CaloMonitoringConfig.py
7 @brief Python configuration of Calo Monitoring for the Run III
8 '''
9 
10 def CaloMonitoringCfg(flags):
11  ''' Function to configure Calo 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( 'CaloMonitoringCfg' )
18 
19  environment = flags.DQ.Environment
20 
21  if environment in ('online', 'tier0', 'tier0ESD'):
22  msg.info('Setup Calo Monitoring for ESD data due to environment: %s', environment)
23 
24  from CaloMonitoring.TileCalCellMonAlg import TileCalCellMonAlgConfig
25  acc.merge( TileCalCellMonAlgConfig(flags) )
26 
27  from CaloMonitoring.LArCellMonAlg import LArCellMonConfig
28  acc.merge( LArCellMonConfig(flags) )
29 
30  from CaloMonitoring.LArClusterCellMonAlg import LArClusterCellMonConfig
31  acc.merge( LArClusterCellMonConfig(flags) )
32 
33  # FIXME could not be included yet, some trigger configurations are missing
34  #from CaloMonitoring.CaloBaselineMonAlg import CaloBaselineMonConfig
35  #acc.merge( CaloBaselineMonConfig(flags,False) )
36 
37  return acc
38 
39 
40 
41 if __name__=='__main__':
42 
43  from AthenaConfiguration.AllConfigFlags import initConfigFlags
44  from AthenaConfiguration.TestDefaults import defaultTestFiles
45  flags = initConfigFlags()
46  flags.Input.Files = defaultTestFiles.ESD
47 
48  flags.Output.HISTFileName = 'CaloMonitoringOutput.root'
49  flags.DQ.enableLumiAccess = True
50  flags.DQ.useTrigger = False
51  flags.DQ.Environment = 'tier0'
52 
53  flags.lock()
54 
55  # Initialize configuration object, add accumulator, merge, and run.
56  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
57  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
58  acc = MainServicesCfg(flags)
59  acc.merge(PoolReadCfg(flags))
60 
61  acc.merge( CaloMonitoringCfg(flags) )
62 
63  acc.printConfig(withDetails = True, summariseProps = True)
64  flags.dump()
65  acc.store(open("CaloMonitoring.pkl","wb"))
66 
67  sc = acc.run(maxEvents = 3)
68  import sys
69  # Success should be 0
70  sys.exit(not sc.isSuccess())
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
CaloMonitoringConfig.CaloMonitoringCfg
def CaloMonitoringCfg(flags)
Definition: CaloMonitoringConfig.py:10
LArClusterCellMonAlg.LArClusterCellMonConfig
def LArClusterCellMonConfig(flags)
Definition: LArClusterCellMonAlg.py:5
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
LArCellMonAlg.LArCellMonConfig
def LArCellMonConfig(flags)
Definition: LArCellMonAlg.py:5
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TileCalCellMonAlg.TileCalCellMonAlgConfig
def TileCalCellMonAlgConfig(flags, **kwargs)
Definition: TileCalCellMonAlg.py:12